| 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 2704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2715 blink::WebHistoryCommitType commit_type) { | 2715 blink::WebHistoryCommitType commit_type) { |
| 2716 TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad", | 2716 TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad", |
| 2717 "id", routing_id_, | 2717 "id", routing_id_, |
| 2718 "url", GetLoadingUrl().possibly_invalid_spec()); | 2718 "url", GetLoadingUrl().possibly_invalid_spec()); |
| 2719 DCHECK(!frame_ || frame_ == frame); | 2719 DCHECK(!frame_ || frame_ == frame); |
| 2720 DocumentState* document_state = | 2720 DocumentState* document_state = |
| 2721 DocumentState::FromDataSource(frame->dataSource()); | 2721 DocumentState::FromDataSource(frame->dataSource()); |
| 2722 NavigationStateImpl* navigation_state = | 2722 NavigationStateImpl* navigation_state = |
| 2723 static_cast<NavigationStateImpl*>(document_state->navigation_state()); | 2723 static_cast<NavigationStateImpl*>(document_state->navigation_state()); |
| 2724 | 2724 |
| 2725 // We may see a "commit" for the initial blank page (e.g., when opening a |
| 2726 // popup with no URL). This should not count as a navigation. (Note that |
| 2727 // subsequent about:blank navigations marked as WebStandardCommit do count as |
| 2728 // new navigations and remain in history.) |
| 2729 if (render_view_->history_list_length_ == 0 && |
| 2730 !frame->parent() && |
| 2731 commit_type != blink::WebStandardCommit && |
| 2732 navigation_state->request_params().nav_entry_id == 0 && |
| 2733 GetLoadingUrl() == GURL(url::kAboutBlankURL)) |
| 2734 return; |
| 2735 |
| 2725 if (proxy_routing_id_ != MSG_ROUTING_NONE) { | 2736 if (proxy_routing_id_ != MSG_ROUTING_NONE) { |
| 2726 RenderFrameProxy* proxy = | 2737 RenderFrameProxy* proxy = |
| 2727 RenderFrameProxy::FromRoutingID(proxy_routing_id_); | 2738 RenderFrameProxy::FromRoutingID(proxy_routing_id_); |
| 2728 CHECK(proxy); | 2739 CHECK(proxy); |
| 2729 proxy->web_frame()->swap(frame_); | 2740 proxy->web_frame()->swap(frame_); |
| 2730 proxy_routing_id_ = MSG_ROUTING_NONE; | 2741 proxy_routing_id_ = MSG_ROUTING_NONE; |
| 2731 | 2742 |
| 2732 // If this is the main frame going from a remote frame to a local frame, | 2743 // If this is the main frame going from a remote frame to a local frame, |
| 2733 // it needs to set RenderViewImpl's pointer for the main frame to itself | 2744 // it needs to set RenderViewImpl's pointer for the main frame to itself |
| 2734 // and ensure RenderWidget is no longer in swapped out mode. | 2745 // and ensure RenderWidget is no longer in swapped out mode. |
| (...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4605 if (!browser_side_navigation) { | 4616 if (!browser_side_navigation) { |
| 4606 const GURL override_url = | 4617 const GURL override_url = |
| 4607 (common_params.navigation_type == | 4618 (common_params.navigation_type == |
| 4608 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL) | 4619 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL) |
| 4609 ? common_params.url | 4620 ? common_params.url |
| 4610 : GURL(); | 4621 : GURL(); |
| 4611 request = frame_->requestForReload(load_type, override_url); | 4622 request = frame_->requestForReload(load_type, override_url); |
| 4612 } | 4623 } |
| 4613 should_load_request = true; | 4624 should_load_request = true; |
| 4614 } else if (is_history_navigation) { | 4625 } else if (is_history_navigation) { |
| 4615 // We must know the page ID of the page we are navigating back to. | |
| 4616 DCHECK_NE(request_params.page_id, -1); | |
| 4617 // We must know the nav entry ID of the page we are navigating back to, | 4626 // We must know the nav entry ID of the page we are navigating back to, |
| 4618 // which should be the case because history navigations are routed via the | 4627 // which should be the case because history navigations are routed via the |
| 4619 // browser. | 4628 // browser. |
| 4620 DCHECK_NE(0, request_params.nav_entry_id); | 4629 DCHECK_NE(0, request_params.nav_entry_id); |
| 4621 scoped_ptr<HistoryEntry> entry = | 4630 scoped_ptr<HistoryEntry> entry = |
| 4622 PageStateToHistoryEntry(request_params.page_state); | 4631 PageStateToHistoryEntry(request_params.page_state); |
| 4623 if (entry) { | 4632 if (entry) { |
| 4624 // Ensure we didn't save the swapped out URL in UpdateState, since the | 4633 // Ensure we didn't save the swapped out URL in UpdateState, since the |
| 4625 // browser should never be telling us to navigate to swappedout://. | 4634 // browser should never be telling us to navigate to swappedout://. |
| 4626 CHECK(entry->root().urlString() != WebString::fromUTF8(kSwappedOutURL)); | 4635 CHECK(entry->root().urlString() != WebString::fromUTF8(kSwappedOutURL)); |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5196 mojo::ServiceProviderPtr service_provider(21); | 5205 mojo::ServiceProviderPtr service_provider(21); |
| 5197 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 5206 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
| 5198 request->url = mojo::String::From(url); | 5207 request->url = mojo::String::From(url); |
| 5199 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), | 5208 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), |
| 5200 nullptr, nullptr, | 5209 nullptr, nullptr, |
| 5201 base::Bind(&OnGotContentHandlerID)); | 5210 base::Bind(&OnGotContentHandlerID)); |
| 5202 return service_provider.Pass(); | 5211 return service_provider.Pass(); |
| 5203 } | 5212 } |
| 5204 | 5213 |
| 5205 } // namespace content | 5214 } // namespace content |
| OLD | NEW |