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; | 15 class Frame; |
16 | 16 |
17 // Oilpan: all FrameOwner instances are GCed objects. FrameOwner additionally | 17 // Oilpan: all FrameOwner instances are GCed objects. FrameOwner additionally |
18 // derives from GarbageCollectedMixin so that Member<FrameOwner> references can | 18 // derives from GarbageCollectedMixin so that Member<FrameOwner> references can |
19 // be kept (e.g., Frame::m_owner.) | 19 // be kept (e.g., Frame::m_owner.) |
20 class CORE_EXPORT FrameOwner : public WillBeGarbageCollectedMixin { | 20 class CORE_EXPORT FrameOwner : public WillBeGarbageCollectedMixin { |
21 public: | 21 public: |
22 virtual ~FrameOwner() { } | 22 virtual ~FrameOwner() { } |
23 DEFINE_INLINE_VIRTUAL_TRACE() { } | 23 DEFINE_INLINE_VIRTUAL_TRACE() { } |
24 | 24 |
25 virtual bool isLocal() const = 0; | 25 virtual bool isLocal() const = 0; |
26 virtual bool isRemote() const = 0; | |
dcheng
2016/03/16 21:15:04
I went through and audited all existing calls (tha
| |
26 | 27 |
27 virtual void setContentFrame(Frame&) = 0; | 28 virtual void setContentFrame(Frame&) = 0; |
28 virtual void clearContentFrame() = 0; | 29 virtual void clearContentFrame() = 0; |
29 | 30 |
30 virtual SandboxFlags getSandboxFlags() const = 0; | 31 virtual SandboxFlags getSandboxFlags() const = 0; |
31 virtual void dispatchLoad() = 0; | 32 virtual void dispatchLoad() = 0; |
32 | 33 |
33 // On load failure, a frame can ask its owner to render fallback content | 34 // On load failure, a frame can ask its owner to render fallback content |
34 // which replaces the frame contents. | 35 // which replaces the frame contents. |
35 virtual void renderFallbackContent() = 0; | 36 virtual void renderFallbackContent() = 0; |
36 | 37 |
37 virtual ScrollbarMode scrollingMode() const = 0; | 38 virtual ScrollbarMode scrollingMode() const = 0; |
38 virtual int marginWidth() const = 0; | 39 virtual int marginWidth() const = 0; |
39 virtual int marginHeight() const = 0; | 40 virtual int marginHeight() const = 0; |
40 }; | 41 }; |
41 | 42 |
42 class CORE_EXPORT DummyFrameOwner : public NoBaseWillBeGarbageCollectedFinalized <DummyFrameOwner>, public FrameOwner { | 43 class CORE_EXPORT DummyFrameOwner : public NoBaseWillBeGarbageCollectedFinalized <DummyFrameOwner>, public FrameOwner { |
43 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DummyFrameOwner); | 44 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DummyFrameOwner); |
44 public: | 45 public: |
45 static PassOwnPtrWillBeRawPtr<DummyFrameOwner> create() | 46 static PassOwnPtrWillBeRawPtr<DummyFrameOwner> create() |
46 { | 47 { |
47 return adoptPtrWillBeNoop(new DummyFrameOwner); | 48 return adoptPtrWillBeNoop(new DummyFrameOwner); |
48 } | 49 } |
49 | 50 |
50 DEFINE_INLINE_VIRTUAL_TRACE() { FrameOwner::trace(visitor); } | 51 DEFINE_INLINE_VIRTUAL_TRACE() { FrameOwner::trace(visitor); } |
51 | 52 |
52 // FrameOwner overrides: | 53 // FrameOwner overrides: |
53 bool isLocal() const override { return false; } | 54 bool isLocal() const override { return false; } |
55 bool isRemote() const override { return false; } | |
54 void setContentFrame(Frame&) override { } | 56 void setContentFrame(Frame&) override { } |
55 void clearContentFrame() override { } | 57 void clearContentFrame() override { } |
56 SandboxFlags getSandboxFlags() const override { return SandboxNone; } | 58 SandboxFlags getSandboxFlags() const override { return SandboxNone; } |
57 void dispatchLoad() override { } | 59 void dispatchLoad() override { } |
58 void renderFallbackContent() override { } | 60 void renderFallbackContent() override { } |
59 ScrollbarMode scrollingMode() const override { return ScrollbarAuto; } | 61 ScrollbarMode scrollingMode() const override { return ScrollbarAuto; } |
60 int marginWidth() const override { return -1; } | 62 int marginWidth() const override { return -1; } |
61 int marginHeight() const override { return -1; } | 63 int marginHeight() const override { return -1; } |
62 }; | 64 }; |
63 | 65 |
64 } // namespace blink | 66 } // namespace blink |
65 | 67 |
66 #endif // FrameOwner_h | 68 #endif // FrameOwner_h |
OLD | NEW |