michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef PCOMContentPermissionRequestChild_h michael@0: #define PCOMContentPermissionRequestChild_h michael@0: michael@0: #include "mozilla/dom/PContentPermissionRequestChild.h" michael@0: // Microsoft's API Name hackery sucks michael@0: // XXXbz Doing this in a header is a gigantic footgun. See michael@0: // https://bugzilla.mozilla.org/show_bug.cgi?id=932421#c3 for why. michael@0: #undef CreateEvent michael@0: michael@0: /* michael@0: PContentPermissionRequestChild implementations also are michael@0: XPCOM objects. Addref() is called on their implementation michael@0: before SendPContentPermissionRequestConstructor is called. michael@0: When Dealloc is called, IPDLRelease() is called. michael@0: Implementations of this method are expected to call michael@0: Release() on themselves. See Bug 594261 for more michael@0: information. michael@0: */ michael@0: class PCOMContentPermissionRequestChild : public mozilla::dom::PContentPermissionRequestChild { michael@0: public: michael@0: virtual void IPDLRelease() = 0; michael@0: #ifdef DEBUG michael@0: PCOMContentPermissionRequestChild() : mIPCOpen(false) {} michael@0: virtual ~PCOMContentPermissionRequestChild() { michael@0: // mIPCOpen is set to true in TabChild::SendPContentPermissionRequestConstructor michael@0: // and set to false in TabChild::DeallocPContentPermissionRequest michael@0: MOZ_ASSERT(!mIPCOpen, "Protocol must not be open when PCOMContentPermissionRequestChild is destroyed."); michael@0: } michael@0: bool mIPCOpen; michael@0: #endif /* DEBUG */ michael@0: }; michael@0: michael@0: #endif