dom/plugins/ipc/BrowserStreamParent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/plugins/ipc/BrowserStreamParent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef mozilla_plugins_BrowserStreamParent_h
    1.10 +#define mozilla_plugins_BrowserStreamParent_h
    1.11 +
    1.12 +#include "mozilla/plugins/PBrowserStreamParent.h"
    1.13 +#include "mozilla/plugins/AStream.h"
    1.14 +
    1.15 +namespace mozilla {
    1.16 +namespace plugins {
    1.17 +
    1.18 +class PluginInstanceParent;
    1.19 +
    1.20 +class BrowserStreamParent : public PBrowserStreamParent, public AStream
    1.21 +{
    1.22 +  friend class PluginModuleParent;
    1.23 +  friend class PluginInstanceParent;
    1.24 +
    1.25 +public:
    1.26 +  BrowserStreamParent(PluginInstanceParent* npp,
    1.27 +                      NPStream* stream);
    1.28 +  virtual ~BrowserStreamParent();
    1.29 +
    1.30 +  virtual bool IsBrowserStream() MOZ_OVERRIDE { return true; }
    1.31 +
    1.32 +  virtual bool AnswerNPN_RequestRead(const IPCByteRanges& ranges,
    1.33 +                                     NPError* result) MOZ_OVERRIDE;
    1.34 +
    1.35 +  virtual bool RecvNPN_DestroyStream(const NPReason& reason) MOZ_OVERRIDE;
    1.36 +
    1.37 +  virtual bool RecvStreamDestroyed() MOZ_OVERRIDE;
    1.38 +
    1.39 +  int32_t WriteReady();
    1.40 +  int32_t Write(int32_t offset, int32_t len, void* buffer);
    1.41 +  void StreamAsFile(const char* fname);
    1.42 +
    1.43 +  void NPP_DestroyStream(NPReason reason);
    1.44 +
    1.45 +private:
    1.46 +  using PBrowserStreamParent::SendNPP_DestroyStream;
    1.47 +
    1.48 +  PluginInstanceParent* mNPP;
    1.49 +  NPStream* mStream;
    1.50 +  nsCOMPtr<nsISupports> mStreamPeer;
    1.51 +
    1.52 +  enum {
    1.53 +    ALIVE,
    1.54 +    DYING,
    1.55 +    DELETING
    1.56 +  } mState;
    1.57 +};
    1.58 +
    1.59 +} // namespace plugins
    1.60 +} // namespace mozilla
    1.61 +
    1.62 +#endif

mercurial