dom/ipc/PCOMContentPermissionRequestChild.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 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef PCOMContentPermissionRequestChild_h
     6 #define PCOMContentPermissionRequestChild_h
     8 #include "mozilla/dom/PContentPermissionRequestChild.h"
     9 // Microsoft's API Name hackery sucks
    10 // XXXbz Doing this in a header is a gigantic footgun.  See
    11 // https://bugzilla.mozilla.org/show_bug.cgi?id=932421#c3 for why.
    12 #undef CreateEvent
    14 /*
    15   PContentPermissionRequestChild implementations also are
    16   XPCOM objects.  Addref() is called on their implementation
    17   before SendPContentPermissionRequestConstructor is called.
    18   When Dealloc is called, IPDLRelease() is called.
    19   Implementations of this method are expected to call
    20   Release() on themselves.  See Bug 594261 for more
    21   information.
    22  */
    23 class PCOMContentPermissionRequestChild : public mozilla::dom::PContentPermissionRequestChild {
    24 public:
    25   virtual void IPDLRelease() = 0;
    26 #ifdef DEBUG
    27   PCOMContentPermissionRequestChild() : mIPCOpen(false) {}
    28   virtual ~PCOMContentPermissionRequestChild() {
    29     // mIPCOpen is set to true in TabChild::SendPContentPermissionRequestConstructor
    30     // and set to false in TabChild::DeallocPContentPermissionRequest
    31     MOZ_ASSERT(!mIPCOpen, "Protocol must not be open when PCOMContentPermissionRequestChild is destroyed.");
    32   }
    33   bool mIPCOpen;
    34 #endif /* DEBUG */
    35 };
    37 #endif

mercurial