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: content/browser/frame_host/frame_tree_node.cc

Issue 1489253002: Plumb document's strict mixed content checking for RemoteFrames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/frame_host/frame_tree_node.h" 5 #include "content/browser/frame_host/frame_tree_node.h"
6 6
7 #include <queue> 7 #include <queue>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/profiler/scoped_tracker.h" 10 #include "base/profiler/scoped_tracker.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 render_manager_(this, 83 render_manager_(this,
84 render_frame_delegate, 84 render_frame_delegate,
85 render_view_delegate, 85 render_view_delegate,
86 render_widget_delegate, 86 render_widget_delegate,
87 manager_delegate), 87 manager_delegate),
88 frame_tree_node_id_(next_frame_tree_node_id_++), 88 frame_tree_node_id_(next_frame_tree_node_id_++),
89 parent_(NULL), 89 parent_(NULL),
90 opener_(nullptr), 90 opener_(nullptr),
91 opener_observer_(nullptr), 91 opener_observer_(nullptr),
92 has_committed_real_load_(false), 92 has_committed_real_load_(false),
93 replication_state_(scope, name, sandbox_flags), 93 replication_state_(
94 scope,
95 name,
96 sandbox_flags,
97 false /* should enforce strict mixed content checking */),
94 // Effective sandbox flags also need to be set, since initial sandbox 98 // Effective sandbox flags also need to be set, since initial sandbox
95 // flags should apply to the initial empty document in the frame. 99 // flags should apply to the initial empty document in the frame.
96 effective_sandbox_flags_(sandbox_flags), 100 effective_sandbox_flags_(sandbox_flags),
97 frame_owner_properties_(frame_owner_properties), 101 frame_owner_properties_(frame_owner_properties),
98 loading_progress_(kLoadingProgressNotStarted) { 102 loading_progress_(kLoadingProgressNotStarted) {
99 std::pair<FrameTreeNodeIDMap::iterator, bool> result = 103 std::pair<FrameTreeNodeIDMap::iterator, bool> result =
100 g_frame_tree_node_id_map.Get().insert( 104 g_frame_tree_node_id_map.Get().insert(
101 std::make_pair(frame_tree_node_id_, this)); 105 std::make_pair(frame_tree_node_id_, this));
102 CHECK(result.second); 106 CHECK(result.second);
103 } 107 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 render_manager_.OnDidUpdateOrigin(origin); 201 render_manager_.OnDidUpdateOrigin(origin);
198 replication_state_.origin = origin; 202 replication_state_.origin = origin;
199 } 203 }
200 204
201 void FrameTreeNode::SetFrameName(const std::string& name) { 205 void FrameTreeNode::SetFrameName(const std::string& name) {
202 if (name != replication_state_.name) 206 if (name != replication_state_.name)
203 render_manager_.OnDidUpdateName(name); 207 render_manager_.OnDidUpdateName(name);
204 replication_state_.name = name; 208 replication_state_.name = name;
205 } 209 }
206 210
211 void FrameTreeNode::SetShouldEnforceStrictMixedContentChecking(
212 bool should_enforce) {
213 if (should_enforce !=
214 replication_state_.should_enforce_strict_mixed_content_checking) {
215 render_manager_.OnDidUpdateShouldEnforceStrictMixedContentChecking(
216 should_enforce);
217 }
218 replication_state_.should_enforce_strict_mixed_content_checking =
alexmos 2015/12/03 20:43:26 What's the lifetime of this flag in Blink? Does i
estark 2015/12/04 00:19:31 Ah, yes, it should be reset on navigation. I've no
alexmos 2015/12/04 23:41:11 Yes, that seems fine. Well, to make sure I unders
estark 2015/12/07 20:39:33 Ah, no, you're right, there's probably no guarante
alexmos 2015/12/08 01:06:36 Yes, I agree that we should send the update from B
219 should_enforce;
220 }
221
207 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { 222 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const {
208 if (!other || !other->child_count()) 223 if (!other || !other->child_count())
209 return false; 224 return false;
210 225
211 for (FrameTreeNode* node = parent(); node; node = node->parent()) { 226 for (FrameTreeNode* node = parent(); node; node = node->parent()) {
212 if (node == other) 227 if (node == other)
213 return true; 228 return true;
214 } 229 }
215 230
216 return false; 231 return false;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 render_manager_.Stop(); 395 render_manager_.Stop();
381 return true; 396 return true;
382 } 397 }
383 398
384 void FrameTreeNode::DidFocus() { 399 void FrameTreeNode::DidFocus() {
385 last_focus_time_ = base::TimeTicks::Now(); 400 last_focus_time_ = base::TimeTicks::Now();
386 FOR_EACH_OBSERVER(Observer, observers_, OnFrameTreeNodeFocused(this)); 401 FOR_EACH_OBSERVER(Observer, observers_, OnFrameTreeNodeFocused(this));
387 } 402 }
388 403
389 } // namespace content 404 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698