OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |