/work/obj-fuzz/dist/include/mozilla/dom/nsIContentParent.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
5 | | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef mozilla_dom_nsIContentParent_h |
8 | | #define mozilla_dom_nsIContentParent_h |
9 | | |
10 | | #include "mozilla/Attributes.h" |
11 | | #include "mozilla/dom/ipc/IdType.h" |
12 | | #include "mozilla/ipc/ProtocolUtils.h" |
13 | | #include "mozilla/ipc/PChildToParentStreamParent.h" |
14 | | #include "mozilla/ipc/PParentToChildStreamParent.h" |
15 | | |
16 | | #include "nsFrameMessageManager.h" |
17 | | #include "nsISupports.h" |
18 | | #include "mozilla/dom/CPOWManagerGetter.h" |
19 | | |
20 | | #define NS_ICONTENTPARENT_IID \ |
21 | | { 0xeeec9ebf, 0x8ecf, 0x4e38, \ |
22 | | { 0x81, 0xda, 0xb7, 0x34, 0x13, 0x7e, 0xac, 0xf3 } } |
23 | | |
24 | | namespace IPC { |
25 | | class Principal; |
26 | | } // namespace IPC |
27 | | |
28 | | namespace mozilla { |
29 | | |
30 | | namespace jsipc { |
31 | | class PJavaScriptParent; |
32 | | class CpowEntry; |
33 | | } // namespace jsipc |
34 | | |
35 | | namespace ipc { |
36 | | class PFileDescriptorSetParent; |
37 | | class PChildToParentStreamParent; |
38 | | class PParentToChildStreamParent; |
39 | | class PIPCBlobInputStreamParent; |
40 | | } |
41 | | |
42 | | namespace dom { |
43 | | |
44 | | class Blob; |
45 | | class BlobConstructorParams; |
46 | | class BlobImpl; |
47 | | class ProcessMessageManager; |
48 | | class ContentParent; |
49 | | class ContentBridgeParent; |
50 | | class IPCTabContext; |
51 | | class PBrowserParent; |
52 | | |
53 | | class nsIContentParent : public nsISupports |
54 | | , public mozilla::dom::ipc::MessageManagerCallback |
55 | | , public CPOWManagerGetter |
56 | | , public mozilla::ipc::IShmemAllocator |
57 | | { |
58 | | public: |
59 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTPARENT_IID) |
60 | | |
61 | | nsIContentParent(); |
62 | | |
63 | | virtual ContentParentId ChildID() const = 0; |
64 | | virtual bool IsForBrowser() const = 0; |
65 | | virtual bool IsForJSPlugin() const = 0; |
66 | | |
67 | | virtual mozilla::ipc::PIPCBlobInputStreamParent* |
68 | | SendPIPCBlobInputStreamConstructor(mozilla::ipc::PIPCBlobInputStreamParent* aActor, |
69 | | const nsID& aID, |
70 | | const uint64_t& aSize) = 0; |
71 | | |
72 | | MOZ_MUST_USE virtual PBrowserParent* |
73 | | SendPBrowserConstructor(PBrowserParent* actor, |
74 | | const TabId& aTabId, |
75 | | const TabId& aSameTabGroupAs, |
76 | | const IPCTabContext& context, |
77 | | const uint32_t& chromeFlags, |
78 | | const ContentParentId& aCpId, |
79 | | const bool& aIsForBrowser) = 0; |
80 | | |
81 | | virtual mozilla::ipc::PFileDescriptorSetParent* |
82 | | SendPFileDescriptorSetConstructor(const mozilla::ipc::FileDescriptor&) = 0; |
83 | | |
84 | 0 | virtual bool IsContentParent() const { return false; } |
85 | | |
86 | | ContentParent* AsContentParent(); |
87 | | |
88 | 0 | virtual bool IsContentBridgeParent() const { return false; } |
89 | | |
90 | | ContentBridgeParent* AsContentBridgeParent(); |
91 | | |
92 | | mozilla::dom::ProcessMessageManager* GetMessageManager() const { return mMessageManager; } |
93 | | |
94 | | virtual bool SendActivate(PBrowserParent* aTab) = 0; |
95 | | |
96 | | virtual bool SendDeactivate(PBrowserParent* aTab) = 0; |
97 | | |
98 | | virtual int32_t Pid() const = 0; |
99 | | |
100 | | virtual mozilla::ipc::PParentToChildStreamParent* |
101 | | SendPParentToChildStreamConstructor(mozilla::ipc::PParentToChildStreamParent*) = 0; |
102 | | |
103 | | protected: // methods |
104 | | bool CanOpenBrowser(const IPCTabContext& aContext); |
105 | | |
106 | | protected: // IPDL methods |
107 | | virtual mozilla::jsipc::PJavaScriptParent* AllocPJavaScriptParent(); |
108 | | virtual bool DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*); |
109 | | |
110 | | virtual PBrowserParent* AllocPBrowserParent(const TabId& aTabId, |
111 | | const TabId& aSameTabGroupsAs, |
112 | | const IPCTabContext& aContext, |
113 | | const uint32_t& aChromeFlags, |
114 | | const ContentParentId& aCpId, |
115 | | const bool& aIsForBrowser); |
116 | | virtual bool DeallocPBrowserParent(PBrowserParent* frame); |
117 | | |
118 | | virtual mozilla::ipc::IPCResult |
119 | | RecvPBrowserConstructor(PBrowserParent* actor, |
120 | | const TabId& tabId, |
121 | | const TabId& sameTabGroupAs, |
122 | | const IPCTabContext& context, |
123 | | const uint32_t& chromeFlags, |
124 | | const ContentParentId& cpId, |
125 | | const bool& isForBrowser); |
126 | | |
127 | | virtual mozilla::ipc::PIPCBlobInputStreamParent* |
128 | | AllocPIPCBlobInputStreamParent(const nsID& aID, const uint64_t& aSize); |
129 | | |
130 | | virtual bool |
131 | | DeallocPIPCBlobInputStreamParent(mozilla::ipc::PIPCBlobInputStreamParent* aActor); |
132 | | |
133 | | virtual mozilla::ipc::PFileDescriptorSetParent* |
134 | | AllocPFileDescriptorSetParent(const mozilla::ipc::FileDescriptor& aFD); |
135 | | |
136 | | virtual bool |
137 | | DeallocPFileDescriptorSetParent(mozilla::ipc::PFileDescriptorSetParent* aActor); |
138 | | |
139 | | virtual mozilla::ipc::PChildToParentStreamParent* AllocPChildToParentStreamParent(); |
140 | | |
141 | | virtual bool |
142 | | DeallocPChildToParentStreamParent(mozilla::ipc::PChildToParentStreamParent* aActor); |
143 | | |
144 | | virtual mozilla::ipc::PParentToChildStreamParent* AllocPParentToChildStreamParent(); |
145 | | |
146 | | virtual bool |
147 | | DeallocPParentToChildStreamParent(mozilla::ipc::PParentToChildStreamParent* aActor); |
148 | | |
149 | | virtual mozilla::ipc::IPCResult RecvSyncMessage(const nsString& aMsg, |
150 | | const ClonedMessageData& aData, |
151 | | InfallibleTArray<jsipc::CpowEntry>&& aCpows, |
152 | | const IPC::Principal& aPrincipal, |
153 | | nsTArray<ipc::StructuredCloneData>* aRetvals); |
154 | | virtual mozilla::ipc::IPCResult RecvRpcMessage(const nsString& aMsg, |
155 | | const ClonedMessageData& aData, |
156 | | InfallibleTArray<jsipc::CpowEntry>&& aCpows, |
157 | | const IPC::Principal& aPrincipal, |
158 | | nsTArray<ipc::StructuredCloneData>* aRetvals); |
159 | | virtual mozilla::ipc::IPCResult RecvAsyncMessage(const nsString& aMsg, |
160 | | InfallibleTArray<jsipc::CpowEntry>&& aCpows, |
161 | | const IPC::Principal& aPrincipal, |
162 | | const ClonedMessageData& aData); |
163 | | |
164 | | protected: // members |
165 | | RefPtr<mozilla::dom::ProcessMessageManager> mMessageManager; |
166 | | }; |
167 | | |
168 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentParent, NS_ICONTENTPARENT_IID) |
169 | | |
170 | | } // namespace dom |
171 | | } // namespace mozilla |
172 | | |
173 | | #endif /* mozilla_dom_nsIContentParent_h */ |