1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/ipc/PCOMContentPermissionRequestChild.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,37 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef PCOMContentPermissionRequestChild_h 1.9 +#define PCOMContentPermissionRequestChild_h 1.10 + 1.11 +#include "mozilla/dom/PContentPermissionRequestChild.h" 1.12 +// Microsoft's API Name hackery sucks 1.13 +// XXXbz Doing this in a header is a gigantic footgun. See 1.14 +// https://bugzilla.mozilla.org/show_bug.cgi?id=932421#c3 for why. 1.15 +#undef CreateEvent 1.16 + 1.17 +/* 1.18 + PContentPermissionRequestChild implementations also are 1.19 + XPCOM objects. Addref() is called on their implementation 1.20 + before SendPContentPermissionRequestConstructor is called. 1.21 + When Dealloc is called, IPDLRelease() is called. 1.22 + Implementations of this method are expected to call 1.23 + Release() on themselves. See Bug 594261 for more 1.24 + information. 1.25 + */ 1.26 +class PCOMContentPermissionRequestChild : public mozilla::dom::PContentPermissionRequestChild { 1.27 +public: 1.28 + virtual void IPDLRelease() = 0; 1.29 +#ifdef DEBUG 1.30 + PCOMContentPermissionRequestChild() : mIPCOpen(false) {} 1.31 + virtual ~PCOMContentPermissionRequestChild() { 1.32 + // mIPCOpen is set to true in TabChild::SendPContentPermissionRequestConstructor 1.33 + // and set to false in TabChild::DeallocPContentPermissionRequest 1.34 + MOZ_ASSERT(!mIPCOpen, "Protocol must not be open when PCOMContentPermissionRequestChild is destroyed."); 1.35 + } 1.36 + bool mIPCOpen; 1.37 +#endif /* DEBUG */ 1.38 +}; 1.39 + 1.40 +#endif