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

Side by Side Diff: content/renderer/frame_owner_properties.cc

Issue 2697713003: Initial Implementation of Iframe Attribute for Feature Policy (Part 2) (Closed)
Patch Set: Update rebase 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
« no previous file with comments | « content/common/frame_owner_properties.cc ('k') | content/test/data/allowed_frames.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "content/renderer/frame_owner_properties.h" 5 #include "content/renderer/frame_owner_properties.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "third_party/WebKit/public/platform/WebFeaturePolicy.h"
10 #include "third_party/WebKit/public/platform/modules/permissions/permission.mojo m.h" 11 #include "third_party/WebKit/public/platform/modules/permissions/permission.mojo m.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 FrameOwnerProperties ConvertWebFrameOwnerPropertiesToFrameOwnerProperties( 15 FrameOwnerProperties ConvertWebFrameOwnerPropertiesToFrameOwnerProperties(
15 const blink::WebFrameOwnerProperties& web_frame_owner_properties) { 16 const blink::WebFrameOwnerProperties& web_frame_owner_properties) {
16 FrameOwnerProperties result; 17 FrameOwnerProperties result;
17 18
18 result.name = web_frame_owner_properties.name.utf8(); 19 result.name = web_frame_owner_properties.name.utf8();
19 result.scrolling_mode = web_frame_owner_properties.scrollingMode; 20 result.scrolling_mode = web_frame_owner_properties.scrollingMode;
20 result.margin_width = web_frame_owner_properties.marginWidth; 21 result.margin_width = web_frame_owner_properties.marginWidth;
21 result.margin_height = web_frame_owner_properties.marginHeight; 22 result.margin_height = web_frame_owner_properties.marginHeight;
22 result.allow_fullscreen = web_frame_owner_properties.allowFullscreen; 23 result.allow_fullscreen = web_frame_owner_properties.allowFullscreen;
23 result.allow_payment_request = web_frame_owner_properties.allowPaymentRequest; 24 result.allow_payment_request = web_frame_owner_properties.allowPaymentRequest;
24 result.required_csp = web_frame_owner_properties.requiredCsp.utf8(); 25 result.required_csp = web_frame_owner_properties.requiredCsp.utf8();
25 std::copy(web_frame_owner_properties.delegatedPermissions.begin(), 26 std::copy(web_frame_owner_properties.delegatedPermissions.begin(),
26 web_frame_owner_properties.delegatedPermissions.end(), 27 web_frame_owner_properties.delegatedPermissions.end(),
27 std::back_inserter(result.delegated_permissions)); 28 std::back_inserter(result.delegated_permissions));
29 std::copy(web_frame_owner_properties.allowedFeatures.begin(),
30 web_frame_owner_properties.allowedFeatures.end(),
31 std::back_inserter(result.allowed_features));
28 32
29 return result; 33 return result;
30 } 34 }
31 35
32 blink::WebFrameOwnerProperties 36 blink::WebFrameOwnerProperties
33 ConvertFrameOwnerPropertiesToWebFrameOwnerProperties( 37 ConvertFrameOwnerPropertiesToWebFrameOwnerProperties(
34 const FrameOwnerProperties& frame_owner_properties) { 38 const FrameOwnerProperties& frame_owner_properties) {
35 blink::WebFrameOwnerProperties result; 39 blink::WebFrameOwnerProperties result;
36 40
37 result.name = blink::WebString::fromUTF8(frame_owner_properties.name); 41 result.name = blink::WebString::fromUTF8(frame_owner_properties.name);
38 result.scrollingMode = frame_owner_properties.scrolling_mode; 42 result.scrollingMode = frame_owner_properties.scrolling_mode;
39 result.marginWidth = frame_owner_properties.margin_width; 43 result.marginWidth = frame_owner_properties.margin_width;
40 result.marginHeight = frame_owner_properties.margin_height; 44 result.marginHeight = frame_owner_properties.margin_height;
41 result.allowFullscreen = frame_owner_properties.allow_fullscreen; 45 result.allowFullscreen = frame_owner_properties.allow_fullscreen;
42 result.allowPaymentRequest = frame_owner_properties.allow_payment_request; 46 result.allowPaymentRequest = frame_owner_properties.allow_payment_request;
43 result.requiredCsp = 47 result.requiredCsp =
44 blink::WebString::fromUTF8(frame_owner_properties.required_csp); 48 blink::WebString::fromUTF8(frame_owner_properties.required_csp);
45 result.delegatedPermissions = blink::WebVector<blink::mojom::PermissionName>( 49 result.delegatedPermissions = blink::WebVector<blink::mojom::PermissionName>(
46 frame_owner_properties.delegated_permissions); 50 frame_owner_properties.delegated_permissions);
51 result.allowedFeatures = blink::WebVector<blink::WebFeaturePolicyFeature>(
52 frame_owner_properties.allowed_features);
47 53
48 return result; 54 return result;
49 } 55 }
50 56
51 } // namespace content 57 } // namespace content
OLDNEW
« no previous file with comments | « content/common/frame_owner_properties.cc ('k') | content/test/data/allowed_frames.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698