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

Side by Side Diff: content/common/frame_replication_state.h

Issue 1635873003: Replicating WebFrame::uniqueName across renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dump-render-tree3
Patch Set: Rebasing... Created 4 years, 11 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 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
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.
Charlie Reis 2016/01/27 23:48:49 Why isn't this true anymore?
Łukasz Anforowicz 2016/01/28 01:21:19 AFAICT it was never true. If you look at FrameTre
Charlie Reis 2016/02/11 22:02:14 Acknowledged.
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.
68 // https://crbug.com/576969: This isn't really "unique" today.
Charlie Reis 2016/01/27 23:48:49 I don't think it makes sense to document this here
Łukasz Anforowicz 2016/01/28 01:21:19 Done.
alexmos 2016/02/10 00:46:45 I don't think that's always undesirable. For exam
Łukasz Anforowicz 2016/02/10 22:10:50 Acknowledged. Maybe just pay attention to bugs on
Charlie Reis 2016/02/11 22:02:14 Yeah, I've wondered this myself sometimes. Findin
Łukasz Anforowicz 2016/02/11 23:23:55 I thought that the bug could be marked with a labe
69 std::string unique_name;
70
67 // Whether the frame is in a document tree or a shadow tree, per the Shadow 71 // 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/ 72 // 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 73 // 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 74 // 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 75 // params: having a const member implicitly deletes the copy assignment
72 // operator. 76 // operator.
73 blink::WebTreeScopeType scope; 77 blink::WebTreeScopeType scope;
74 78
75 // True if a frame's current document should strictly block all mixed 79 // True if a frame's current document should strictly block all mixed
76 // content. Updates are immediately sent to all frame proxies when 80 // content. Updates are immediately sent to all frame proxies when
77 // frames live in different processes. 81 // frames live in different processes.
78 bool should_enforce_strict_mixed_content_checking; 82 bool should_enforce_strict_mixed_content_checking;
79 83
80 // TODO(alexmos): Eventually, this structure can also hold other state that 84 // TODO(alexmos): Eventually, this structure can also hold other state that
81 // needs to be replicated, such as frame sizing info. 85 // needs to be replicated, such as frame sizing info.
82 }; 86 };
83 87
84 } // namespace content 88 } // namespace content
85 89
86 #endif // CONTENT_COMMON_FRAME_REPLICATION_STATE_H_ 90 #endif // CONTENT_COMMON_FRAME_REPLICATION_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698