/work/obj-fuzz/dist/include/mozilla/dom/XULFrameElement.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 XULFrameElement_h__ |
8 | | #define XULFrameElement_h__ |
9 | | |
10 | | #include "mozilla/Attributes.h" |
11 | | #include "mozilla/ErrorResult.h" |
12 | | #include "js/TypeDecls.h" |
13 | | #include "nsCycleCollectionParticipant.h" |
14 | | #include "nsWrapperCache.h" |
15 | | #include "nsString.h" |
16 | | #include "nsXULElement.h" |
17 | | |
18 | | class nsIWebNavigation; |
19 | | class nsFrameLoader; |
20 | | |
21 | | namespace mozilla { |
22 | | namespace dom { |
23 | | |
24 | | class XULFrameElement final : public nsXULElement, |
25 | | public nsIFrameLoaderOwner |
26 | | { |
27 | | public: |
28 | | explicit XULFrameElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) |
29 | | : nsXULElement(std::move(aNodeInfo)) |
30 | | { |
31 | | } |
32 | | |
33 | | NS_DECL_ISUPPORTS_INHERITED |
34 | | NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULFrameElement, nsXULElement) |
35 | | |
36 | | // XULFrameElement.webidl |
37 | | nsIDocShell* GetDocShell(); |
38 | | already_AddRefed<nsIWebNavigation> GetWebNavigation(); |
39 | | already_AddRefed<nsPIDOMWindowOuter> GetContentWindow(); |
40 | | nsIDocument* GetContentDocument(); |
41 | | |
42 | | // nsIFrameLoaderOwner / MozFrameLoaderOwner |
43 | | NS_IMETHOD_(already_AddRefed<nsFrameLoader>) GetFrameLoader() override |
44 | 0 | { |
45 | 0 | return do_AddRef(mFrameLoader); |
46 | 0 | } |
47 | | |
48 | | NS_IMETHOD_(void) InternalSetFrameLoader(nsFrameLoader* aFrameLoader) override |
49 | | { |
50 | | mFrameLoader = aFrameLoader; |
51 | | } |
52 | | |
53 | | void PresetOpenerWindow(mozIDOMWindowProxy* aWindow, ErrorResult& aRv) |
54 | 0 | { |
55 | 0 | mOpener = do_QueryInterface(aWindow); |
56 | 0 | } |
57 | | |
58 | | void SwapFrameLoaders(mozilla::dom::HTMLIFrameElement& aOtherLoaderOwner, |
59 | | mozilla::ErrorResult& rv); |
60 | | void SwapFrameLoaders(XULFrameElement& aOtherLoaderOwner, |
61 | | mozilla::ErrorResult& rv); |
62 | | void SwapFrameLoaders(nsIFrameLoaderOwner* aOtherLoaderOwner, |
63 | | mozilla::ErrorResult& rv); |
64 | | |
65 | | // nsIContent |
66 | | virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, |
67 | | nsIContent* aBindingParent) override; |
68 | | virtual void UnbindFromTree(bool aDeep, bool aNullParent) override; |
69 | | virtual void DestroyContent() override; |
70 | | |
71 | | |
72 | | virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsAtom* aName, |
73 | | const nsAttrValue* aValue, |
74 | | const nsAttrValue* aOldValue, |
75 | | nsIPrincipal* aSubjectPrincipal, |
76 | | bool aNotify) override; |
77 | | |
78 | | protected: |
79 | | virtual ~XULFrameElement() |
80 | | { |
81 | | } |
82 | | |
83 | | RefPtr<nsFrameLoader> mFrameLoader; |
84 | | nsCOMPtr<nsPIDOMWindowOuter> mOpener; |
85 | | |
86 | | JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override; |
87 | | |
88 | | void LoadSrc(); |
89 | | }; |
90 | | |
91 | | } // namespace dom |
92 | | } // namespace mozilla |
93 | | |
94 | | #endif // XULFrameElement_h |