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

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

Issue 2735183003: PlzNavigate: stop navigations when opening a document for write (Closed)
Patch Set: Rebase Created 3 years, 9 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/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 navigation_request_->common_params().navigation_type); 396 navigation_request_->common_params().navigation_type);
397 397
398 DidStartLoading(to_different_document, was_previously_loading); 398 DidStartLoading(to_different_document, was_previously_loading);
399 } 399 }
400 400
401 void FrameTreeNode::ResetNavigationRequest(bool keep_state) { 401 void FrameTreeNode::ResetNavigationRequest(bool keep_state) {
402 CHECK(IsBrowserSideNavigationEnabled()); 402 CHECK(IsBrowserSideNavigationEnabled());
403 if (!navigation_request_) 403 if (!navigation_request_)
404 return; 404 return;
405 bool was_renderer_initiated = !navigation_request_->browser_initiated(); 405 bool was_renderer_initiated = !navigation_request_->browser_initiated();
406 int renderer_navigation_id =
407 navigation_request_->begin_params().renderer_navigation_id;
406 NavigationRequest::AssociatedSiteInstanceType site_instance_type = 408 NavigationRequest::AssociatedSiteInstanceType site_instance_type =
407 navigation_request_->associated_site_instance_type(); 409 navigation_request_->associated_site_instance_type();
408 navigation_request_.reset(); 410 navigation_request_.reset();
409 411
410 if (keep_state) 412 if (keep_state)
411 return; 413 return;
412 414
413 // The RenderFrameHostManager should clean up any speculative RenderFrameHost 415 // The RenderFrameHostManager should clean up any speculative RenderFrameHost
414 // it created for the navigation. Also register that the load stopped. 416 // it created for the navigation. Also register that the load stopped.
415 DidStopLoading(); 417 DidStopLoading();
416 render_manager_.CleanUpNavigation(); 418 render_manager_.CleanUpNavigation();
417 419
418 // When reusing the same SiteInstance, a pending WebUI may have been created 420 // When reusing the same SiteInstance, a pending WebUI may have been created
419 // on behalf of the navigation in the current RenderFrameHost. Clear it. 421 // on behalf of the navigation in the current RenderFrameHost. Clear it.
420 if (site_instance_type == 422 if (site_instance_type ==
421 NavigationRequest::AssociatedSiteInstanceType::CURRENT) { 423 NavigationRequest::AssociatedSiteInstanceType::CURRENT) {
422 current_frame_host()->ClearPendingWebUI(); 424 current_frame_host()->ClearPendingWebUI();
423 } 425 }
424 426
425 // If the navigation is renderer-initiated, the renderer should also be 427 // If the navigation is renderer-initiated, the renderer should also be
426 // informed that the navigation stopped. 428 // informed that the navigation stopped.
427 if (was_renderer_initiated) { 429 if (was_renderer_initiated) {
428 current_frame_host()->Send( 430 DCHECK(renderer_navigation_id != -1);
429 new FrameMsg_Stop(current_frame_host()->GetRoutingID())); 431 current_frame_host()->Send(new FrameMsg_DroppedNavigation(
432 current_frame_host()->GetRoutingID(), renderer_navigation_id));
430 } 433 }
431 434
432 } 435 }
433 436
434 bool FrameTreeNode::has_started_loading() const { 437 bool FrameTreeNode::has_started_loading() const {
435 return loading_progress_ != kLoadingProgressNotStarted; 438 return loading_progress_ != kLoadingProgressNotStarted;
436 } 439 }
437 440
438 void FrameTreeNode::reset_loading_progress() { 441 void FrameTreeNode::reset_loading_progress() {
439 loading_progress_ = kLoadingProgressNotStarted; 442 loading_progress_ = kLoadingProgressNotStarted;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 } 564 }
562 return parent_->child_at(i + relative_offset); 565 return parent_->child_at(i + relative_offset);
563 } 566 }
564 } 567 }
565 568
566 NOTREACHED() << "FrameTreeNode not found in its parent's children."; 569 NOTREACHED() << "FrameTreeNode not found in its parent's children.";
567 return nullptr; 570 return nullptr;
568 } 571 }
569 572
570 } // namespace content 573 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_request.cc » ('j') | content/common/navigation_params.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698