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

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

Issue 2584513003: PlzNavigate: identify same-page browser-initiated navigation. (Closed)
Patch Set: Fix 2 WebContentsImplTest by assigning a document_sequence_number. Created 3 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 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 356
357 // There's no need to reset the state: there's still an ongoing load, and the 357 // There's no need to reset the state: there's still an ongoing load, and the
358 // RenderFrameHostManager will take care of updates to the speculative 358 // RenderFrameHostManager will take care of updates to the speculative
359 // RenderFrameHost in DidCreateNavigationRequest below. 359 // RenderFrameHost in DidCreateNavigationRequest below.
360 if (was_previously_loading) 360 if (was_previously_loading)
361 ResetNavigationRequest(true); 361 ResetNavigationRequest(true);
362 362
363 navigation_request_ = std::move(navigation_request); 363 navigation_request_ = std::move(navigation_request);
364 render_manager()->DidCreateNavigationRequest(navigation_request_.get()); 364 render_manager()->DidCreateNavigationRequest(navigation_request_.get());
365 365
366 // TODO(fdegans): Check if this is a same-document navigation and set the 366 bool is_same_document =
367 // proper argument. 367 navigation_request_->request_params().is_same_document_fragment_change ||
368 DidStartLoading(true, was_previously_loading); 368 navigation_request_->request_params().is_same_document_history_load;
369
370 DidStartLoading(!is_same_document, was_previously_loading);
369 } 371 }
370 372
371 void FrameTreeNode::ResetNavigationRequest(bool keep_state) { 373 void FrameTreeNode::ResetNavigationRequest(bool keep_state) {
372 CHECK(IsBrowserSideNavigationEnabled()); 374 CHECK(IsBrowserSideNavigationEnabled());
373 if (!navigation_request_) 375 if (!navigation_request_)
374 return; 376 return;
375 bool was_renderer_initiated = !navigation_request_->browser_initiated(); 377 bool was_renderer_initiated = !navigation_request_->browser_initiated();
376 NavigationRequest::AssociatedSiteInstanceType site_instance_type = 378 NavigationRequest::AssociatedSiteInstanceType site_instance_type =
377 navigation_request_->associated_site_instance_type(); 379 navigation_request_->associated_site_instance_type();
378 navigation_request_.reset(); 380 navigation_request_.reset();
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 } 523 }
522 return parent_->child_at(i + relative_offset); 524 return parent_->child_at(i + relative_offset);
523 } 525 }
524 } 526 }
525 527
526 NOTREACHED() << "FrameTreeNode not found in its parent's children."; 528 NOTREACHED() << "FrameTreeNode not found in its parent's children.";
527 return nullptr; 529 return nullptr;
528 } 530 }
529 531
530 } // namespace content 532 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698