/work/obj-fuzz/dist/include/mozilla/dom/ContentFrameMessageManager.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 |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef mozilla_dom_ContentFrameMessageManager_h |
8 | | #define mozilla_dom_ContentFrameMessageManager_h |
9 | | |
10 | | #include "mozilla/DOMEventTargetHelper.h" |
11 | | #include "mozilla/dom/MessageManagerGlobal.h" |
12 | | #include "mozilla/dom/ResolveSystemBinding.h" |
13 | | #include "nsContentUtils.h" |
14 | | #include "xpcpublic.h" |
15 | | |
16 | | namespace mozilla { |
17 | | namespace dom { |
18 | | |
19 | | #define NS_CONTENTFRAMEMESSAGEMANAGER_IID \ |
20 | | { 0x97e192a6, 0xab7a, 0x4c8f, \ |
21 | | { 0xb7, 0xdd, 0xf7, 0xec, 0x36, 0x38, 0x71, 0xb5 } } |
22 | | |
23 | | /** |
24 | | * Base class for implementing the WebIDL ContentFrameMessageManager class. |
25 | | */ |
26 | | class ContentFrameMessageManager : public DOMEventTargetHelper, |
27 | | public MessageManagerGlobal |
28 | | { |
29 | | public: |
30 | | using DOMEventTargetHelper::AddRef; |
31 | | using DOMEventTargetHelper::Release; |
32 | | |
33 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_CONTENTFRAMEMESSAGEMANAGER_IID) |
34 | | |
35 | | virtual already_AddRefed<nsPIDOMWindowOuter> GetContent(ErrorResult& aError) = 0; |
36 | | virtual already_AddRefed<nsIDocShell> GetDocShell(ErrorResult& aError) = 0; |
37 | | virtual already_AddRefed<nsIEventTarget> GetTabEventTarget() = 0; |
38 | | virtual uint64_t ChromeOuterWindowID() = 0; |
39 | | |
40 | | nsFrameMessageManager* GetMessageManager() |
41 | 0 | { |
42 | 0 | return mMessageManager; |
43 | 0 | } |
44 | | void DisconnectMessageManager() |
45 | 0 | { |
46 | 0 | mMessageManager->Disconnect(); |
47 | 0 | mMessageManager = nullptr; |
48 | 0 | } |
49 | | |
50 | | JSObject* GetOrCreateWrapper(); |
51 | | |
52 | | protected: |
53 | | explicit ContentFrameMessageManager(nsFrameMessageManager* aMessageManager) |
54 | | : DOMEventTargetHelper(xpc::NativeGlobal(xpc::PrivilegedJunkScope())) |
55 | | , MessageManagerGlobal(aMessageManager) |
56 | 0 | {} |
57 | | }; |
58 | | |
59 | | NS_DEFINE_STATIC_IID_ACCESSOR(ContentFrameMessageManager, NS_CONTENTFRAMEMESSAGEMANAGER_IID) |
60 | | |
61 | | } // namespace dom |
62 | | } // namespace mozilla |
63 | | |
64 | | #endif // mozilla_dom_ContentFrameMessageManager_h |