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

Side by Side Diff: third_party/WebKit/public/platform/WebFeaturePolicy.h

Issue 2727803004: Replace string by enum in WebParsedFeaturePolicyDeclaration#feature (Closed)
Patch Set: Codereview: nit -- add comments to introduce features Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 WebFeaturePolicy_h 5 #ifndef WebFeaturePolicy_h
6 #define WebFeaturePolicy_h 6 #define WebFeaturePolicy_h
7 7
8 #include "WebCommon.h" 8 #include "WebCommon.h"
9 #include "WebSecurityOrigin.h" 9 #include "WebSecurityOrigin.h"
10 #include "WebString.h" 10 #include "WebString.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 Usermedia, 43 Usermedia,
44 // Controls access to navigator.vibrate method. 44 // Controls access to navigator.vibrate method.
45 Vibrate, 45 Vibrate,
46 // Controls access to RTCPeerConnection interface. 46 // Controls access to RTCPeerConnection interface.
47 WebRTC, 47 WebRTC,
48 LAST_FEATURE = WebRTC 48 LAST_FEATURE = WebRTC
49 }; 49 };
50 50
51 struct BLINK_PLATFORM_EXPORT WebParsedFeaturePolicyDeclaration { 51 struct BLINK_PLATFORM_EXPORT WebParsedFeaturePolicyDeclaration {
52 WebParsedFeaturePolicyDeclaration() : matchesAllOrigins(false) {} 52 WebParsedFeaturePolicyDeclaration() : matchesAllOrigins(false) {}
53 WebString featureName; 53 WebFeaturePolicyFeature feature;
54 bool matchesAllOrigins; 54 bool matchesAllOrigins;
55 WebVector<WebSecurityOrigin> origins; 55 WebVector<WebSecurityOrigin> origins;
56 }; 56 };
57 57
58 // Used in Blink code to represent parsed headers. Used for IPC between renderer 58 // Used in Blink code to represent parsed headers. Used for IPC between renderer
59 // and browser. 59 // and browser.
60 using WebParsedFeaturePolicy = WebVector<WebParsedFeaturePolicyDeclaration>; 60 using WebParsedFeaturePolicy = WebVector<WebParsedFeaturePolicyDeclaration>;
61 61
62 // Composed full policy for a document. Stored in SecurityContext for each 62 // Composed full policy for a document. Stored in SecurityContext for each
63 // document. This is essentially an opaque handle to an object in the embedder. 63 // document. This is essentially an opaque handle to an object in the embedder.
64 class BLINK_PLATFORM_EXPORT WebFeaturePolicy { 64 class BLINK_PLATFORM_EXPORT WebFeaturePolicy {
65 public: 65 public:
66 virtual ~WebFeaturePolicy() {} 66 virtual ~WebFeaturePolicy() {}
67 67
68 // Returns whether or not the given feature is enabled for the origin of the 68 // Returns whether or not the given feature is enabled for the origin of the
69 // document that owns the policy. 69 // document that owns the policy.
70 virtual bool IsFeatureEnabled(blink::WebFeaturePolicyFeature) const = 0; 70 virtual bool IsFeatureEnabled(blink::WebFeaturePolicyFeature) const = 0;
71 }; 71 };
72 72
73 } // namespace blink 73 } // namespace blink
74 74
75 #endif // WebFeaturePolicy_h 75 #endif // WebFeaturePolicy_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698