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

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

Issue 2584513003: PlzNavigate: identify same-page browser-initiated navigation. (Closed)
Patch Set: Allow renderer-initiated reloads. 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 to_different_document = !FrameMsg_Navigate_Type::IsSameDocument(
367 // proper argument. 367 navigation_request_->common_params().navigation_type);
368 DidStartLoading(true, was_previously_loading); 368
369 DidStartLoading(to_different_document, was_previously_loading);
369 } 370 }
370 371
371 void FrameTreeNode::ResetNavigationRequest(bool keep_state) { 372 void FrameTreeNode::ResetNavigationRequest(bool keep_state) {
372 CHECK(IsBrowserSideNavigationEnabled()); 373 CHECK(IsBrowserSideNavigationEnabled());
373 if (!navigation_request_) 374 if (!navigation_request_)
374 return; 375 return;
375 bool was_renderer_initiated = !navigation_request_->browser_initiated(); 376 bool was_renderer_initiated = !navigation_request_->browser_initiated();
376 NavigationRequest::AssociatedSiteInstanceType site_instance_type = 377 NavigationRequest::AssociatedSiteInstanceType site_instance_type =
377 navigation_request_->associated_site_instance_type(); 378 navigation_request_->associated_site_instance_type();
378 navigation_request_.reset(); 379 navigation_request_.reset();
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 } 522 }
522 return parent_->child_at(i + relative_offset); 523 return parent_->child_at(i + relative_offset);
523 } 524 }
524 } 525 }
525 526
526 NOTREACHED() << "FrameTreeNode not found in its parent's children."; 527 NOTREACHED() << "FrameTreeNode not found in its parent's children.";
527 return nullptr; 528 return nullptr;
528 } 529 }
529 530
530 } // namespace content 531 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698