OLD | NEW |
---|---|
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 CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ | 5 #ifndef CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ |
6 #define CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ | 6 #define CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "url/origin.h" | 9 #include "url/origin.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 enum class WebTreeScopeType; | 12 enum class WebTreeScopeType; |
13 enum class WebSandboxFlags; | 13 enum class WebSandboxFlags; |
14 } | 14 } |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 // This structure holds information that needs to be replicated between a | 18 // This structure holds information that needs to be replicated between a |
19 // RenderFrame and any of its associated RenderFrameProxies. | 19 // RenderFrame and any of its associated RenderFrameProxies. |
20 struct CONTENT_EXPORT FrameReplicationState { | 20 struct CONTENT_EXPORT FrameReplicationState { |
21 FrameReplicationState(); | 21 FrameReplicationState(); |
22 FrameReplicationState(blink::WebTreeScopeType scope, | 22 FrameReplicationState(blink::WebTreeScopeType scope, |
23 const std::string& name, | 23 const std::string& name, |
24 const std::string& unique_name, | |
24 blink::WebSandboxFlags sandbox_flags, | 25 blink::WebSandboxFlags sandbox_flags, |
25 bool should_enforce_strict_mixed_content_checking); | 26 bool should_enforce_strict_mixed_content_checking); |
26 ~FrameReplicationState(); | 27 ~FrameReplicationState(); |
27 | 28 |
28 // Current origin of the frame. This field is updated whenever a frame | 29 // Current origin of the frame. This field is updated whenever a frame |
29 // navigation commits. | 30 // navigation commits. |
30 // | 31 // |
31 // TODO(alexmos): For now, |origin| updates are immediately sent to all frame | 32 // TODO(alexmos): For now, |origin| updates are immediately sent to all frame |
32 // proxies when in --site-per-process mode. This isn't ideal, since Blink | 33 // proxies when in --site-per-process mode. This isn't ideal, since Blink |
33 // typically needs a proxy's origin only when performing security checks on | 34 // typically needs a proxy's origin only when performing security checks on |
(...skipping 10 matching lines...) Expand all Loading... | |
44 // | 45 // |
45 // When a parent frame updates an <iframe>'s sandbox attribute via | 46 // When a parent frame updates an <iframe>'s sandbox attribute via |
46 // JavaScript, |sandbox_flags| are updated only after the child frame commits | 47 // JavaScript, |sandbox_flags| are updated only after the child frame commits |
47 // a navigation that makes the updated flags take effect. This is also the | 48 // a navigation that makes the updated flags take effect. This is also the |
48 // point at which updates are sent to proxies (see | 49 // point at which updates are sent to proxies (see |
49 // CommitPendingSandboxFlags()). The proxies need updated flags so that they | 50 // CommitPendingSandboxFlags()). The proxies need updated flags so that they |
50 // can be inherited properly if a proxy ever becomes a parent of a local | 51 // can be inherited properly if a proxy ever becomes a parent of a local |
51 // frame. | 52 // frame. |
52 blink::WebSandboxFlags sandbox_flags; | 53 blink::WebSandboxFlags sandbox_flags; |
53 | 54 |
54 // The assigned name of the frame. This name can be empty, unlike the unique | 55 // The assigned name of the frame. |
55 // name generated internally in the DOM tree. | |
56 // | 56 // |
57 // |name| is set when a new child frame is created using the value of the | 57 // |name| is set when a new child frame is created using the value of the |
58 // <iframe> element's "name" attribute (see | 58 // <iframe> element's "name" attribute (see |
59 // RenderFrameHostImpl::OnCreateChildFrame), and it is updated dynamically | 59 // RenderFrameHostImpl::OnCreateChildFrame), and it is updated dynamically |
60 // whenever a frame sets its window.name. | 60 // whenever a frame sets its window.name. |
61 // | 61 // |
62 // |name| updates are immediately sent to all frame proxies (when in | 62 // |name| updates are immediately sent to all frame proxies (when in |
63 // --site-per-process mode), so that other frames can look up or navigate a | 63 // --site-per-process mode), so that other frames can look up or navigate a |
64 // frame using its updated name (e.g., using window.open(url, frame_name)). | 64 // frame using its updated name (e.g., using window.open(url, frame_name)). |
65 std::string name; | 65 std::string name; |
66 | 66 |
67 // Unique name of the frame. | |
alexmos
2016/02/10 00:46:46
Maybe also mention what it's for, why it's replica
Łukasz Anforowicz
2016/02/10 22:10:51
I've expanded the comment:
1) added a reference to
| |
68 std::string unique_name; | |
69 | |
67 // Whether the frame is in a document tree or a shadow tree, per the Shadow | 70 // Whether the frame is in a document tree or a shadow tree, per the Shadow |
68 // DOM spec: https://w3c.github.io/webcomponents/spec/shadow/ | 71 // DOM spec: https://w3c.github.io/webcomponents/spec/shadow/ |
69 // Note: This should really be const, as it can never change once a frame is | 72 // Note: This should really be const, as it can never change once a frame is |
70 // created. However, making it const makes it a pain to embed into IPC message | 73 // created. However, making it const makes it a pain to embed into IPC message |
71 // params: having a const member implicitly deletes the copy assignment | 74 // params: having a const member implicitly deletes the copy assignment |
72 // operator. | 75 // operator. |
73 blink::WebTreeScopeType scope; | 76 blink::WebTreeScopeType scope; |
74 | 77 |
75 // True if a frame's current document should strictly block all mixed | 78 // True if a frame's current document should strictly block all mixed |
76 // content. Updates are immediately sent to all frame proxies when | 79 // content. Updates are immediately sent to all frame proxies when |
77 // frames live in different processes. | 80 // frames live in different processes. |
78 bool should_enforce_strict_mixed_content_checking; | 81 bool should_enforce_strict_mixed_content_checking; |
79 | 82 |
80 // TODO(alexmos): Eventually, this structure can also hold other state that | 83 // TODO(alexmos): Eventually, this structure can also hold other state that |
81 // needs to be replicated, such as frame sizing info. | 84 // needs to be replicated, such as frame sizing info. |
82 }; | 85 }; |
83 | 86 |
84 } // namespace content | 87 } // namespace content |
85 | 88 |
86 #endif // CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ | 89 #endif // CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ |
OLD | NEW |