OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef FrameOwner_h | 5 #ifndef FrameOwner_h |
6 #define FrameOwner_h | 6 #define FrameOwner_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/dom/SandboxFlags.h" | 9 #include "core/dom/SandboxFlags.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "platform/scroll/ScrollTypes.h" | 11 #include "platform/scroll/ScrollTypes.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class Frame; | |
16 | |
15 // Oilpan: all FrameOwner instances are GCed objects. FrameOwner additionally | 17 // Oilpan: all FrameOwner instances are GCed objects. FrameOwner additionally |
16 // derives from GarbageCollectedMixin so that Member<FrameOwner> references can | 18 // derives from GarbageCollectedMixin so that Member<FrameOwner> references can |
17 // be kept (e.g., Frame::m_owner.) | 19 // be kept (e.g., Frame::m_owner.) |
18 class CORE_EXPORT FrameOwner : public WillBeGarbageCollectedMixin { | 20 class CORE_EXPORT FrameOwner : public WillBeGarbageCollectedMixin { |
19 public: | 21 public: |
20 virtual ~FrameOwner() { } | 22 virtual ~FrameOwner() { } |
21 DEFINE_INLINE_VIRTUAL_TRACE() { } | 23 DEFINE_INLINE_VIRTUAL_TRACE() { } |
22 | 24 |
23 virtual bool isLocal() const = 0; | 25 virtual bool isLocal() const = 0; |
24 | 26 |
27 virtual void setContentFrame(Frame&) = 0; | |
28 virtual void clearContentFrame() = 0; | |
29 | |
25 virtual SandboxFlags getSandboxFlags() const = 0; | 30 virtual SandboxFlags getSandboxFlags() const = 0; |
26 virtual void dispatchLoad() = 0; | 31 virtual void dispatchLoad() = 0; |
27 | 32 |
28 // On load failure, a frame can ask its owner to render fallback content | 33 // On load failure, a frame can ask its owner to render fallback content |
29 // which replaces the frame contents. | 34 // which replaces the frame contents. |
30 virtual void renderFallbackContent() = 0; | 35 virtual void renderFallbackContent() = 0; |
31 | 36 |
32 virtual ScrollbarMode scrollingMode() const = 0; | 37 virtual ScrollbarMode scrollingMode() const = 0; |
33 virtual int marginWidth() const = 0; | 38 virtual int marginWidth() const = 0; |
34 virtual int marginHeight() const = 0; | 39 virtual int marginHeight() const = 0; |
35 }; | 40 }; |
36 | 41 |
42 class CORE_EXPORT StubFrameOwner : public NoBaseWillBeGarbageCollectedFinalized< StubFrameOwner>, public FrameOwner { | |
haraken
2016/03/16 14:17:41
Is there any better name than StubFrameOwner? Dumm
dcheng
2016/03/16 16:51:41
Done.
| |
43 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StubFrameOwner); | |
44 public: | |
45 static PassOwnPtrWillBeRawPtr<StubFrameOwner> create() | |
46 { | |
47 return adoptPtrWillBeNoop(new StubFrameOwner); | |
48 } | |
49 | |
50 DEFINE_INLINE_VIRTUAL_TRACE() { FrameOwner::trace(visitor); } | |
51 | |
52 // FrameOwner overrides: | |
53 bool isLocal() const override { return false; } | |
54 void setContentFrame(Frame&) override { } | |
55 void clearContentFrame() override { } | |
56 SandboxFlags getSandboxFlags() const override { return SandboxNone; } | |
57 void dispatchLoad() override { } | |
58 void renderFallbackContent() override { } | |
59 ScrollbarMode scrollingMode() const override { return ScrollbarAuto; } | |
60 int marginWidth() const override { return -1; } | |
61 int marginHeight() const override { return -1; } | |
62 }; | |
63 | |
37 } // namespace blink | 64 } // namespace blink |
38 | 65 |
39 #endif // FrameOwner_h | 66 #endif // FrameOwner_h |
OLD | NEW |