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

Side by Side Diff: content/browser/frame_host/frame_tree_node.cc

Issue 1098763003: Send origin updates to frame proxies when a frame navigates to new origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Charlie's nits Created 5 years, 8 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 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void FrameTreeNode::ResetForNewProcess() { 128 void FrameTreeNode::ResetForNewProcess() {
129 current_url_ = GURL(); 129 current_url_ = GURL();
130 130
131 // The children may not have been cleared if a cross-process navigation 131 // The children may not have been cleared if a cross-process navigation
132 // commits before the old process cleans everything up. Make sure the child 132 // commits before the old process cleans everything up. Make sure the child
133 // nodes get deleted before swapping to a new process. 133 // nodes get deleted before swapping to a new process.
134 ScopedVector<FrameTreeNode> old_children = children_.Pass(); 134 ScopedVector<FrameTreeNode> old_children = children_.Pass();
135 old_children.clear(); // May notify observers. 135 old_children.clear(); // May notify observers.
136 } 136 }
137 137
138 void FrameTreeNode::SetCurrentOrigin(const url::Origin& origin) {
139 if (!origin.IsSameAs(replication_state_.origin))
140 render_manager_.OnDidUpdateOrigin(origin);
141 replication_state_.origin = origin;
142 }
143
138 void FrameTreeNode::SetFrameName(const std::string& name) { 144 void FrameTreeNode::SetFrameName(const std::string& name) {
145 if (name != replication_state_.name)
146 render_manager_.OnDidUpdateName(name);
139 replication_state_.name = name; 147 replication_state_.name = name;
140
141 // Notify this frame's proxies about the updated name.
142 render_manager_.OnDidUpdateName(name);
143 } 148 }
144 149
145 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { 150 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const {
146 if (!other || !other->child_count()) 151 if (!other || !other->child_count())
147 return false; 152 return false;
148 153
149 for (FrameTreeNode* node = parent(); node; node = node->parent()) { 154 for (FrameTreeNode* node = parent(); node; node = node->parent()) {
150 if (node == other) 155 if (node == other)
151 return true; 156 return true;
152 } 157 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 FROM_HERE_WITH_EXPLICIT_FUNCTION( 262 FROM_HERE_WITH_EXPLICIT_FUNCTION(
258 "465796 FrameTreeNode::DidStopLoading::End")); 263 "465796 FrameTreeNode::DidStopLoading::End"));
259 } 264 }
260 265
261 void FrameTreeNode::DidChangeLoadProgress(double load_progress) { 266 void FrameTreeNode::DidChangeLoadProgress(double load_progress) {
262 loading_progress_ = load_progress; 267 loading_progress_ = load_progress;
263 frame_tree_->UpdateLoadProgress(); 268 frame_tree_->UpdateLoadProgress();
264 } 269 }
265 270
266 } // namespace content 271 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698