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

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

Issue 2727803004: Replace string by enum in WebParsedFeaturePolicyDeclaration#feature (Closed)
Patch Set: Filter out unrecognized features in parseFeaturePolicy (earlier) instead of setHeaderPolicy 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
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 WebParsedFeaturePolicyHeader = 60 using WebParsedFeaturePolicyHeader =
61 WebVector<WebParsedFeaturePolicyDeclaration>; 61 WebVector<WebParsedFeaturePolicyDeclaration>;
62 62
63 // Composed full policy for a document. Stored in SecurityContext for each 63 // Composed full policy for a document. Stored in SecurityContext for each
64 // document. This is essentially an opaque handle to an object in the embedder. 64 // document. This is essentially an opaque handle to an object in the embedder.
65 class BLINK_PLATFORM_EXPORT WebFeaturePolicy { 65 class BLINK_PLATFORM_EXPORT WebFeaturePolicy {
66 public: 66 public:
67 virtual ~WebFeaturePolicy() {} 67 virtual ~WebFeaturePolicy() {}
68 68
69 // Returns whether or not the given feature is enabled for the origin of the 69 // Returns whether or not the given feature is enabled for the origin of the
70 // document that owns the policy. 70 // document that owns the policy.
71 virtual bool IsFeatureEnabled(blink::WebFeaturePolicyFeature) const = 0; 71 virtual bool IsFeatureEnabled(blink::WebFeaturePolicyFeature) const = 0;
72 }; 72 };
73 73
74 } // namespace blink 74 } // namespace blink
75 75
76 #endif // WebFeaturePolicy_h 76 #endif // WebFeaturePolicy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698