dom/ipc/PCOMContentPermissionRequestChild.h

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     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