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

Side by Side Diff: components/html_viewer/replicated_frame_state.cc

Issue 1677293002: Bye bye Mandoline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 4 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/html_viewer/replicated_frame_state.h"
6
7 #include "components/html_viewer/html_frame_properties.h"
8
9 namespace html_viewer {
10
11 ReplicatedFrameState::ReplicatedFrameState()
12 : sandbox_flags(blink::WebSandboxFlags::None),
13 tree_scope(blink::WebTreeScopeType::Document) {}
14
15 ReplicatedFrameState::~ReplicatedFrameState() {}
16
17 void SetReplicatedFrameStateFromClientProperties(
18 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties,
19 ReplicatedFrameState* state) {
20 state->name = FrameNameFromClientProperty(
21 GetValueFromClientProperties(kPropertyFrameName, properties));
22 state->origin = FrameOriginFromClientProperty(
23 GetValueFromClientProperties(kPropertyFrameOrigin, properties));
24 if (!FrameSandboxFlagsFromClientProperty(
25 GetValueFromClientProperties(kPropertyFrameSandboxFlags, properties),
26 &(state->sandbox_flags))) {
27 state->sandbox_flags = blink::WebSandboxFlags::None;
28 }
29 if (!FrameTreeScopeFromClientProperty(
30 GetValueFromClientProperties(kPropertyFrameTreeScope, properties),
31 &(state->tree_scope))) {
32 state->tree_scope = blink::WebTreeScopeType::Document;
33 }
34 }
35
36 void ClientPropertiesFromReplicatedFrameState(
37 const ReplicatedFrameState& state,
38 mojo::Map<mojo::String, mojo::Array<uint8_t>>* properties) {
39 AddToClientPropertiesIfValid(
40 kPropertyFrameName, FrameNameToClientProperty(state.name), properties);
41 AddToClientPropertiesIfValid(kPropertyFrameTreeScope,
42 FrameTreeScopeToClientProperty(state.tree_scope),
43 properties);
44 AddToClientPropertiesIfValid(
45 kPropertyFrameSandboxFlags,
46 FrameSandboxFlagsToClientProperty(state.sandbox_flags), properties);
47 }
48
49 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/html_viewer/replicated_frame_state.h ('k') | components/html_viewer/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698