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

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

Issue 2697713003: Initial Implementation of Iframe Attribute for Feature Policy (Part 2) (Closed)
Patch Set: Initial Impl Created 3 years, 10 months 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"
11 #include "platform/scroll/ScrollTypes.h" 11 #include "platform/scroll/ScrollTypes.h"
12 #include "public/platform/WebFeaturePolicy.h"
12 #include "public/platform/WebVector.h" 13 #include "public/platform/WebVector.h"
13 #include "public/platform/modules/permissions/permission.mojom-blink.h" 14 #include "public/platform/modules/permissions/permission.mojom-blink.h"
14 15
15 namespace blink { 16 namespace blink {
16 17
17 class Frame; 18 class Frame;
18 19
19 // Oilpan: all FrameOwner instances are GCed objects. FrameOwner additionally 20 // Oilpan: all FrameOwner instances are GCed objects. FrameOwner additionally
20 // derives from GarbageCollectedMixin so that Member<FrameOwner> references can 21 // derives from GarbageCollectedMixin so that Member<FrameOwner> references can
21 // be kept (e.g., Frame::m_owner.) 22 // be kept (e.g., Frame::m_owner.)
(...skipping 22 matching lines...) Expand all
44 // https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-conta iner 45 // https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-conta iner
45 virtual AtomicString browsingContextContainerName() const = 0; 46 virtual AtomicString browsingContextContainerName() const = 0;
46 virtual ScrollbarMode scrollingMode() const = 0; 47 virtual ScrollbarMode scrollingMode() const = 0;
47 virtual int marginWidth() const = 0; 48 virtual int marginWidth() const = 0;
48 virtual int marginHeight() const = 0; 49 virtual int marginHeight() const = 0;
49 virtual bool allowFullscreen() const = 0; 50 virtual bool allowFullscreen() const = 0;
50 virtual bool allowPaymentRequest() const = 0; 51 virtual bool allowPaymentRequest() const = 0;
51 virtual AtomicString csp() const = 0; 52 virtual AtomicString csp() const = 0;
52 virtual const WebVector<mojom::blink::PermissionName>& delegatedPermissions() 53 virtual const WebVector<mojom::blink::PermissionName>& delegatedPermissions()
53 const = 0; 54 const = 0;
55 virtual const WebVector<WebFeaturePolicyFeature>& allowedFeatureNames()
iclelland 2017/02/16 15:26:33 I feel like we should rename this to allowedFeatur
lunalu1 2017/02/16 20:16:15 Done.
56 const = 0;
iclelland 2017/02/16 15:26:33 I'm curious why this is a pure virtual method, whe
lunalu1 2017/02/16 20:16:15 We can use a default definition here, that just me
iclelland 2017/02/16 20:33:40 I'm just wondering whether the pattern is there fo
iclelland 2017/02/16 20:49:27 I suppose this might be for memory savings -- if t
lunalu1 2017/02/16 21:33:46 According to Google Style Guide (https://google.gi
54 }; 57 };
55 58
56 // TODO(dcheng): This class is an internal implementation detail of provisional 59 // TODO(dcheng): This class is an internal implementation detail of provisional
57 // frames. Move this into WebLocalFrameImpl.cpp and remove existing dependencies 60 // frames. Move this into WebLocalFrameImpl.cpp and remove existing dependencies
58 // on it. 61 // on it.
59 class CORE_EXPORT DummyFrameOwner 62 class CORE_EXPORT DummyFrameOwner
60 : public GarbageCollectedFinalized<DummyFrameOwner>, 63 : public GarbageCollectedFinalized<DummyFrameOwner>,
61 public FrameOwner { 64 public FrameOwner {
62 USING_GARBAGE_COLLECTED_MIXIN(DummyFrameOwner); 65 USING_GARBAGE_COLLECTED_MIXIN(DummyFrameOwner);
63 66
(...skipping 18 matching lines...) Expand all
82 int marginHeight() const override { return -1; } 85 int marginHeight() const override { return -1; }
83 bool allowFullscreen() const override { return false; } 86 bool allowFullscreen() const override { return false; }
84 bool allowPaymentRequest() const override { return false; } 87 bool allowPaymentRequest() const override { return false; }
85 AtomicString csp() const override { return nullAtom; } 88 AtomicString csp() const override { return nullAtom; }
86 const WebVector<mojom::blink::PermissionName>& delegatedPermissions() 89 const WebVector<mojom::blink::PermissionName>& delegatedPermissions()
87 const override { 90 const override {
88 DEFINE_STATIC_LOCAL(WebVector<mojom::blink::PermissionName>, permissions, 91 DEFINE_STATIC_LOCAL(WebVector<mojom::blink::PermissionName>, permissions,
89 ()); 92 ());
90 return permissions; 93 return permissions;
91 } 94 }
95 const WebVector<WebFeaturePolicyFeature>& allowedFeatureNames()
96 const override {
97 DEFINE_STATIC_LOCAL(WebVector<WebFeaturePolicyFeature>, features, ());
98 return features;
99 }
92 100
93 private: 101 private:
94 // Intentionally private to prevent redundant checks when the type is 102 // Intentionally private to prevent redundant checks when the type is
95 // already DummyFrameOwner. 103 // already DummyFrameOwner.
96 bool isLocal() const override { return false; } 104 bool isLocal() const override { return false; }
97 bool isRemote() const override { return false; } 105 bool isRemote() const override { return false; }
98 }; 106 };
99 107
100 } // namespace blink 108 } // namespace blink
101 109
102 #endif // FrameOwner_h 110 #endif // FrameOwner_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698