Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameOwner.h

Issue 2564633002: Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: Comments from esprehn. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 25 matching lines...) Expand all
36 // On load failure, a frame can ask its owner to render fallback content 36 // On load failure, a frame can ask its owner to render fallback content
37 // which replaces the frame contents. 37 // which replaces the frame contents.
38 virtual bool canRenderFallbackContent() const = 0; 38 virtual bool canRenderFallbackContent() const = 0;
39 virtual void renderFallbackContent() = 0; 39 virtual void renderFallbackContent() = 0;
40 40
41 virtual ScrollbarMode scrollingMode() const = 0; 41 virtual ScrollbarMode scrollingMode() const = 0;
42 virtual int marginWidth() const = 0; 42 virtual int marginWidth() const = 0;
43 virtual int marginHeight() const = 0; 43 virtual int marginHeight() const = 0;
44 virtual bool allowFullscreen() const = 0; 44 virtual bool allowFullscreen() const = 0;
45 virtual bool allowPaymentRequest() const = 0; 45 virtual bool allowPaymentRequest() const = 0;
46 virtual bool isDisplayNone() const = 0;
46 virtual AtomicString csp() const = 0; 47 virtual AtomicString csp() const = 0;
47 virtual const WebVector<WebPermissionType>& delegatedPermissions() const = 0; 48 virtual const WebVector<WebPermissionType>& delegatedPermissions() const = 0;
48 }; 49 };
49 50
50 class CORE_EXPORT DummyFrameOwner 51 class CORE_EXPORT DummyFrameOwner
51 : public GarbageCollectedFinalized<DummyFrameOwner>, 52 : public GarbageCollectedFinalized<DummyFrameOwner>,
52 public FrameOwner { 53 public FrameOwner {
53 USING_GARBAGE_COLLECTED_MIXIN(DummyFrameOwner); 54 USING_GARBAGE_COLLECTED_MIXIN(DummyFrameOwner);
54 55
55 public: 56 public:
56 static DummyFrameOwner* create() { return new DummyFrameOwner; } 57 static DummyFrameOwner* create() { return new DummyFrameOwner; }
57 58
58 DEFINE_INLINE_VIRTUAL_TRACE() { FrameOwner::trace(visitor); } 59 DEFINE_INLINE_VIRTUAL_TRACE() { FrameOwner::trace(visitor); }
59 60
60 // FrameOwner overrides: 61 // FrameOwner overrides:
61 void setContentFrame(Frame&) override {} 62 void setContentFrame(Frame&) override {}
62 void clearContentFrame() override {} 63 void clearContentFrame() override {}
63 SandboxFlags getSandboxFlags() const override { return SandboxNone; } 64 SandboxFlags getSandboxFlags() const override { return SandboxNone; }
64 void dispatchLoad() override {} 65 void dispatchLoad() override {}
65 bool canRenderFallbackContent() const override { return false; } 66 bool canRenderFallbackContent() const override { return false; }
66 void renderFallbackContent() override {} 67 void renderFallbackContent() override {}
67 ScrollbarMode scrollingMode() const override { return ScrollbarAuto; } 68 ScrollbarMode scrollingMode() const override { return ScrollbarAuto; }
68 int marginWidth() const override { return -1; } 69 int marginWidth() const override { return -1; }
69 int marginHeight() const override { return -1; } 70 int marginHeight() const override { return -1; }
70 bool allowFullscreen() const override { return false; } 71 bool allowFullscreen() const override { return false; }
71 bool allowPaymentRequest() const override { return false; } 72 bool allowPaymentRequest() const override { return false; }
73 bool isDisplayNone() const override { return false; }
72 AtomicString csp() const override { return nullAtom; } 74 AtomicString csp() const override { return nullAtom; }
73 const WebVector<WebPermissionType>& delegatedPermissions() const override { 75 const WebVector<WebPermissionType>& delegatedPermissions() const override {
74 DEFINE_STATIC_LOCAL(WebVector<WebPermissionType>, permissions, ()); 76 DEFINE_STATIC_LOCAL(WebVector<WebPermissionType>, permissions, ());
75 return permissions; 77 return permissions;
76 } 78 }
77 79
78 private: 80 private:
79 // Intentionally private to prevent redundant checks when the type is 81 // Intentionally private to prevent redundant checks when the type is
80 // already DummyFrameOwner. 82 // already DummyFrameOwner.
81 bool isLocal() const override { return false; } 83 bool isLocal() const override { return false; }
82 bool isRemote() const override { return false; } 84 bool isRemote() const override { return false; }
83 }; 85 };
84 86
85 } // namespace blink 87 } // namespace blink
86 88
87 #endif // FrameOwner_h 89 #endif // FrameOwner_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698