|
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/. */ |
|
4 |
|
5 #ifndef PCOMContentPermissionRequestChild_h |
|
6 #define PCOMContentPermissionRequestChild_h |
|
7 |
|
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 |
|
13 |
|
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 }; |
|
36 |
|
37 #endif |