dom/plugins/ipc/BrowserStreamParent.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef mozilla_plugins_BrowserStreamParent_h
     7 #define mozilla_plugins_BrowserStreamParent_h
     9 #include "mozilla/plugins/PBrowserStreamParent.h"
    10 #include "mozilla/plugins/AStream.h"
    12 namespace mozilla {
    13 namespace plugins {
    15 class PluginInstanceParent;
    17 class BrowserStreamParent : public PBrowserStreamParent, public AStream
    18 {
    19   friend class PluginModuleParent;
    20   friend class PluginInstanceParent;
    22 public:
    23   BrowserStreamParent(PluginInstanceParent* npp,
    24                       NPStream* stream);
    25   virtual ~BrowserStreamParent();
    27   virtual bool IsBrowserStream() MOZ_OVERRIDE { return true; }
    29   virtual bool AnswerNPN_RequestRead(const IPCByteRanges& ranges,
    30                                      NPError* result) MOZ_OVERRIDE;
    32   virtual bool RecvNPN_DestroyStream(const NPReason& reason) MOZ_OVERRIDE;
    34   virtual bool RecvStreamDestroyed() MOZ_OVERRIDE;
    36   int32_t WriteReady();
    37   int32_t Write(int32_t offset, int32_t len, void* buffer);
    38   void StreamAsFile(const char* fname);
    40   void NPP_DestroyStream(NPReason reason);
    42 private:
    43   using PBrowserStreamParent::SendNPP_DestroyStream;
    45   PluginInstanceParent* mNPP;
    46   NPStream* mStream;
    47   nsCOMPtr<nsISupports> mStreamPeer;
    49   enum {
    50     ALIVE,
    51     DYING,
    52     DELETING
    53   } mState;
    54 };
    56 } // namespace plugins
    57 } // namespace mozilla
    59 #endif

mercurial