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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 return handled; | 1118 return handled; |
1119 } | 1119 } |
1120 | 1120 |
1121 void RenderFrameImpl::OnNavigate( | 1121 void RenderFrameImpl::OnNavigate( |
1122 const CommonNavigationParams& common_params, | 1122 const CommonNavigationParams& common_params, |
1123 const StartNavigationParams& start_params, | 1123 const StartNavigationParams& start_params, |
1124 const RequestNavigationParams& request_params) { | 1124 const RequestNavigationParams& request_params) { |
1125 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); | 1125 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); |
1126 // Can be NULL in tests. | 1126 // Can be NULL in tests. |
1127 if (render_thread_impl) | 1127 if (render_thread_impl) |
1128 render_thread_impl->GetRendererScheduler()->OnPageLoadStarted(); | 1128 render_thread_impl->GetRendererScheduler()->OnNavigationStarted(); |
1129 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch( | 1129 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch( |
1130 switches::kEnableBrowserSideNavigation)); | 1130 switches::kEnableBrowserSideNavigation)); |
1131 TRACE_EVENT2("navigation", "RenderFrameImpl::OnNavigate", "id", routing_id_, | 1131 TRACE_EVENT2("navigation", "RenderFrameImpl::OnNavigate", "id", routing_id_, |
1132 "url", common_params.url.possibly_invalid_spec()); | 1132 "url", common_params.url.possibly_invalid_spec()); |
1133 NavigateInternal(common_params, start_params, request_params, | 1133 NavigateInternal(common_params, start_params, request_params, |
1134 scoped_ptr<StreamOverrideParameters>()); | 1134 scoped_ptr<StreamOverrideParameters>()); |
1135 } | 1135 } |
1136 | 1136 |
1137 void RenderFrameImpl::NavigateToSwappedOutURL() { | 1137 void RenderFrameImpl::NavigateToSwappedOutURL() { |
1138 // We use loadRequest instead of loadHTMLString because the former commits | 1138 // We use loadRequest instead of loadHTMLString because the former commits |
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2771 RenderFrameObserver, observers_, | 2771 RenderFrameObserver, observers_, |
2772 DidCommitProvisionalLoad(is_new_navigation, | 2772 DidCommitProvisionalLoad(is_new_navigation, |
2773 navigation_state->WasWithinSamePage())); | 2773 navigation_state->WasWithinSamePage())); |
2774 | 2774 |
2775 if (!frame->parent()) { // Only for top frames. | 2775 if (!frame->parent()) { // Only for top frames. |
2776 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); | 2776 RenderThreadImpl* render_thread_impl = RenderThreadImpl::current(); |
2777 if (render_thread_impl) { // Can be NULL in tests. | 2777 if (render_thread_impl) { // Can be NULL in tests. |
2778 render_thread_impl->histogram_customizer()-> | 2778 render_thread_impl->histogram_customizer()-> |
2779 RenderViewNavigatedToHost(GURL(GetLoadingUrl()).host(), | 2779 RenderViewNavigatedToHost(GURL(GetLoadingUrl()).host(), |
2780 RenderView::GetRenderViewCount()); | 2780 RenderView::GetRenderViewCount()); |
2781 render_thread_impl->GetRendererScheduler()->OnPageLoadStarted(); | 2781 render_thread_impl->GetRendererScheduler()->OnNavigationStarted(); |
2782 } | 2782 } |
2783 } | 2783 } |
2784 | 2784 |
2785 // Remember that we've already processed this request, so we don't update | 2785 // Remember that we've already processed this request, so we don't update |
2786 // the session history again. We do this regardless of whether this is | 2786 // the session history again. We do this regardless of whether this is |
2787 // a session history navigation, because if we attempted a session history | 2787 // a session history navigation, because if we attempted a session history |
2788 // navigation without valid HistoryItem state, WebCore will think it is a | 2788 // navigation without valid HistoryItem state, WebCore will think it is a |
2789 // new navigation. | 2789 // new navigation. |
2790 navigation_state->set_request_committed(true); | 2790 navigation_state->set_request_committed(true); |
2791 | 2791 |
(...skipping 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5102 mojo::ServiceProviderPtr service_provider; | 5102 mojo::ServiceProviderPtr service_provider; |
5103 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 5103 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
5104 request->url = mojo::String::From(url); | 5104 request->url = mojo::String::From(url); |
5105 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), | 5105 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), |
5106 nullptr, nullptr, | 5106 nullptr, nullptr, |
5107 base::Bind(&OnGotContentHandlerID)); | 5107 base::Bind(&OnGotContentHandlerID)); |
5108 return service_provider.Pass(); | 5108 return service_provider.Pass(); |
5109 } | 5109 } |
5110 | 5110 |
5111 } // namespace content | 5111 } // namespace content |
OLD | NEW |