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

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

Issue 2424913003: Avoid unnecessary URL parsing for GURL comparisons in //content (Closed)
Patch Set: rebase on dependent PS Created 4 years, 2 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 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 opener_ = opener; 199 opener_ = opener;
200 200
201 if (opener_) { 201 if (opener_) {
202 if (!opener_observer_) 202 if (!opener_observer_)
203 opener_observer_ = base::MakeUnique<OpenerDestroyedObserver>(this); 203 opener_observer_ = base::MakeUnique<OpenerDestroyedObserver>(this);
204 opener_->AddObserver(opener_observer_.get()); 204 opener_->AddObserver(opener_observer_.get());
205 } 205 }
206 } 206 }
207 207
208 void FrameTreeNode::SetCurrentURL(const GURL& url) { 208 void FrameTreeNode::SetCurrentURL(const GURL& url) {
209 if (!has_committed_real_load_ && url != GURL(url::kAboutBlankURL)) 209 if (!has_committed_real_load_ && url != url::kAboutBlankURL)
210 has_committed_real_load_ = true; 210 has_committed_real_load_ = true;
211 current_frame_host()->set_last_committed_url(url); 211 current_frame_host()->set_last_committed_url(url);
212 blame_context_.TakeSnapshot(); 212 blame_context_.TakeSnapshot();
213 } 213 }
214 214
215 void FrameTreeNode::SetCurrentOrigin( 215 void FrameTreeNode::SetCurrentOrigin(
216 const url::Origin& origin, 216 const url::Origin& origin,
217 bool is_potentially_trustworthy_unique_origin) { 217 bool is_potentially_trustworthy_unique_origin) {
218 if (!origin.IsSameOriginWith(replication_state_.origin) || 218 if (!origin.IsSameOriginWith(replication_state_.origin) ||
219 replication_state_.has_potentially_trustworthy_unique_origin != 219 replication_state_.has_potentially_trustworthy_unique_origin !=
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } 505 }
506 return parent_->child_at(i + relative_offset); 506 return parent_->child_at(i + relative_offset);
507 } 507 }
508 } 508 }
509 509
510 NOTREACHED() << "FrameTreeNode not found in its parent's children."; 510 NOTREACHED() << "FrameTreeNode not found in its parent's children.";
511 return nullptr; 511 return nullptr;
512 } 512 }
513 513
514 } // namespace content 514 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/navigation_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698