dom/plugins/ipc/StreamNotifyChild.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
     2 /* vim: set sw=2 ts=2 et : */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef mozilla_plugins_StreamNotifyChild_h
     8 #define mozilla_plugins_StreamNotifyChild_h
    10 #include "mozilla/plugins/PStreamNotifyChild.h"
    12 namespace mozilla {
    13 namespace plugins {
    15 class BrowserStreamChild;
    17 class StreamNotifyChild : public PStreamNotifyChild
    18 {
    19   friend class PluginInstanceChild;
    20   friend class BrowserStreamChild;
    22 public:
    23   StreamNotifyChild(const nsCString& aURL)
    24     : mURL(aURL)
    25     , mClosure(nullptr)
    26     , mBrowserStream(nullptr)
    27   { }
    29   virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
    31   void SetValid(void* aClosure) {
    32     mClosure = aClosure;
    33   }
    35   void NPP_URLNotify(NPReason reason);
    37 private:
    38   virtual bool Recv__delete__(const NPReason& reason) MOZ_OVERRIDE;
    40   bool RecvRedirectNotify(const nsCString& url, const int32_t& status) MOZ_OVERRIDE;
    42   /**
    43    * If a stream is created for this this URLNotify, we associate the objects
    44    * so that the NPP_URLNotify call is not fired before the stream data is
    45    * completely delivered. The BrowserStreamChild takes responsibility for
    46    * calling NPP_URLNotify and deleting this object.
    47    */
    48   void SetAssociatedStream(BrowserStreamChild* bs);
    50   nsCString mURL;
    51   void* mClosure;
    53   /**
    54    * If mBrowserStream is true, it is responsible for deleting this C++ object
    55    * and DeallocPStreamNotify is not, so that the delayed delivery of
    56    * NPP_URLNotify is possible.
    57    */
    58   BrowserStreamChild* mBrowserStream;
    59 };
    61 } // namespace plugins
    62 } // namespace mozilla
    64 #endif

mercurial