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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h" | 130 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBClient.h" |
131 #include "third_party/WebKit/public/web/WebColorSuggestion.h" | 131 #include "third_party/WebKit/public/web/WebColorSuggestion.h" |
132 #include "third_party/WebKit/public/web/WebDocument.h" | 132 #include "third_party/WebKit/public/web/WebDocument.h" |
133 #include "third_party/WebKit/public/web/WebFrameWidget.h" | 133 #include "third_party/WebKit/public/web/WebFrameWidget.h" |
134 #include "third_party/WebKit/public/web/WebGlyphCache.h" | 134 #include "third_party/WebKit/public/web/WebGlyphCache.h" |
135 #include "third_party/WebKit/public/web/WebKit.h" | 135 #include "third_party/WebKit/public/web/WebKit.h" |
136 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 136 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
137 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" | 137 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" |
138 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 138 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
139 #include "third_party/WebKit/public/web/WebPageSerializer.h" | 139 #include "third_party/WebKit/public/web/WebPageSerializer.h" |
140 #include "third_party/WebKit/public/web/WebPerformance.h" | |
140 #include "third_party/WebKit/public/web/WebPlugin.h" | 141 #include "third_party/WebKit/public/web/WebPlugin.h" |
141 #include "third_party/WebKit/public/web/WebPluginParams.h" | 142 #include "third_party/WebKit/public/web/WebPluginParams.h" |
142 #include "third_party/WebKit/public/web/WebRange.h" | 143 #include "third_party/WebKit/public/web/WebRange.h" |
143 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 144 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
144 #include "third_party/WebKit/public/web/WebScriptSource.h" | 145 #include "third_party/WebKit/public/web/WebScriptSource.h" |
145 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 146 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
146 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 147 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
147 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 148 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
148 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" | 149 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" |
149 #include "third_party/WebKit/public/web/WebSettings.h" | 150 #include "third_party/WebKit/public/web/WebSettings.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
416 MaybeTriggerAsanError(url); | 417 MaybeTriggerAsanError(url); |
417 #endif // ADDRESS_SANITIZER || SYZYASAN | 418 #endif // ADDRESS_SANITIZER || SYZYASAN |
418 } | 419 } |
419 | 420 |
420 // Returns false unless this is a top-level navigation. | 421 // Returns false unless this is a top-level navigation. |
421 bool IsTopLevelNavigation(WebFrame* frame) { | 422 bool IsTopLevelNavigation(WebFrame* frame) { |
422 return frame->parent() == NULL; | 423 return frame->parent() == NULL; |
423 } | 424 } |
424 | 425 |
425 WebURLRequest CreateURLRequestForNavigation( | 426 WebURLRequest CreateURLRequestForNavigation( |
427 const RequestNavigationParams& request_params, | |
426 const CommonNavigationParams& common_params, | 428 const CommonNavigationParams& common_params, |
427 scoped_ptr<StreamOverrideParameters> stream_override, | 429 scoped_ptr<StreamOverrideParameters> stream_override, |
428 bool is_view_source_mode_enabled) { | 430 bool is_view_source_mode_enabled) { |
429 WebURLRequest request(common_params.url); | 431 WebURLRequest request(common_params.url); |
430 if (is_view_source_mode_enabled) | 432 if (is_view_source_mode_enabled) |
431 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); | 433 request.setCachePolicy(WebURLRequest::ReturnCacheDataElseLoad); |
432 | 434 |
433 if (common_params.referrer.url.is_valid()) { | 435 if (common_params.referrer.url.is_valid()) { |
434 WebString web_referrer = WebSecurityPolicy::generateReferrerHeader( | 436 WebString web_referrer = WebSecurityPolicy::generateReferrerHeader( |
435 common_params.referrer.policy, | 437 common_params.referrer.policy, |
436 common_params.url, | 438 common_params.url, |
437 WebString::fromUTF8(common_params.referrer.url.spec())); | 439 WebString::fromUTF8(common_params.referrer.url.spec())); |
438 if (!web_referrer.isEmpty()) | 440 if (!web_referrer.isEmpty()) |
439 request.setHTTPReferrer(web_referrer, common_params.referrer.policy); | 441 request.setHTTPReferrer(web_referrer, common_params.referrer.policy); |
440 } | 442 } |
441 | 443 |
442 RequestExtraData* extra_data = new RequestExtraData(); | 444 RequestExtraData* extra_data = new RequestExtraData(); |
443 extra_data->set_stream_override(stream_override.Pass()); | 445 extra_data->set_stream_override(stream_override.Pass()); |
444 request.setExtraData(extra_data); | 446 request.setExtraData(extra_data); |
445 | 447 |
448 // The browser provides the navigation_start time to bootstrap the | |
449 // Navigation Timing information for the browser-initiated navigations. In | |
450 // case of cross-process navigations, this carries over the time of | |
451 // finishing the onbeforeunload handler of the previous page. | |
452 // TODO(csharrison) should we only do this for WebFrameLoadType::Standard? | |
453 if (!request_params.browser_navigation_start.is_null()) { | |
454 // |browser_navigation_start| is likely before this process existed, so we | |
455 // can't use InterProcessTimeTicksConverter. We need at least to ensure | |
456 // that the browser-side navigation start we set is not later than the one | |
457 // on the renderer side. | |
458 base::TimeTicks navigation_start = std::min( | |
459 request_params.browser_navigation_start, base::TimeTicks::Now()); | |
460 double navigation_start_seconds = | |
461 (navigation_start - base::TimeTicks()).InSecondsF(); | |
462 request.setBrowserNavigationStartTime(navigation_start_seconds); | |
clamy
2015/10/28 12:40:01
Instead of adding the start time to the WebURLRequ
Charlie Harrison
2015/10/28 14:45:00
Good idea! Will do that.
| |
463 } | |
464 | |
446 // Set the ui timestamp for this navigation. Currently the timestamp here is | 465 // Set the ui timestamp for this navigation. Currently the timestamp here is |
447 // only non empty when the navigation was triggered by an Android intent. The | 466 // only non empty when the navigation was triggered by an Android intent. The |
448 // timestamp is converted to a double version supported by blink. It will be | 467 // timestamp is converted to a double version supported by blink. It will be |
449 // passed back to the browser in the DidCommitProvisionalLoad and the | 468 // passed back to the browser in the DidCommitProvisionalLoad and the |
450 // DocumentLoadComplete IPCs. | 469 // DocumentLoadComplete IPCs. |
451 base::TimeDelta ui_timestamp = common_params.ui_timestamp - base::TimeTicks(); | 470 base::TimeDelta ui_timestamp = common_params.ui_timestamp - base::TimeTicks(); |
452 request.setUiStartTime(ui_timestamp.InSecondsF()); | 471 request.setUiStartTime(ui_timestamp.InSecondsF()); |
453 request.setInputPerfMetricReportPolicy( | 472 request.setInputPerfMetricReportPolicy( |
454 static_cast<WebURLRequest::InputToLoadPerfMetricReportPolicy>( | 473 static_cast<WebURLRequest::InputToLoadPerfMetricReportPolicy>( |
455 common_params.report_type)); | 474 common_params.report_type)); |
456 return request; | 475 return request; |
457 } | 476 } |
458 | 477 |
459 void UpdateFrameNavigationTiming(WebFrame* frame, | |
460 base::TimeTicks browser_navigation_start, | |
461 base::TimeTicks renderer_navigation_start) { | |
462 // The browser provides the navigation_start time to bootstrap the | |
463 // Navigation Timing information for the browser-initiated navigations. In | |
464 // case of cross-process navigations, this carries over the time of | |
465 // finishing the onbeforeunload handler of the previous page. | |
466 DCHECK(!browser_navigation_start.is_null()); | |
467 if (frame->provisionalDataSource()) { | |
468 // |browser_navigation_start| is likely before this process existed, so we | |
469 // can't use InterProcessTimeTicksConverter. We need at least to ensure | |
470 // that the browser-side navigation start we set is not later than the one | |
471 // on the renderer side. | |
472 base::TimeTicks navigation_start = std::min( | |
473 browser_navigation_start, renderer_navigation_start); | |
474 double navigation_start_seconds = | |
475 (navigation_start - base::TimeTicks()).InSecondsF(); | |
476 frame->provisionalDataSource()->setNavigationStartTime( | |
477 navigation_start_seconds); | |
478 // TODO(clamy): We need to provide additional timing values for the | |
479 // Navigation Timing API to work with browser-side navigations. | |
480 } | |
481 } | |
482 | |
483 // PlzNavigate | 478 // PlzNavigate |
484 CommonNavigationParams MakeCommonNavigationParams( | 479 CommonNavigationParams MakeCommonNavigationParams( |
485 blink::WebURLRequest* request, | 480 blink::WebURLRequest* request, |
486 bool should_replace_current_entry) { | 481 bool should_replace_current_entry) { |
487 const RequestExtraData kEmptyData; | 482 const RequestExtraData kEmptyData; |
488 const RequestExtraData* extra_data = | 483 const RequestExtraData* extra_data = |
489 static_cast<RequestExtraData*>(request->extraData()); | 484 static_cast<RequestExtraData*>(request->extraData()); |
490 if (!extra_data) | 485 if (!extra_data) |
491 extra_data = &kEmptyData; | 486 extra_data = &kEmptyData; |
492 Referrer referrer( | 487 Referrer referrer( |
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2696 WebUserGestureIndicator::isProcessingUserGesture() ? | 2691 WebUserGestureIndicator::isProcessingUserGesture() ? |
2697 NavigationGestureUser : NavigationGestureAuto); | 2692 NavigationGestureUser : NavigationGestureAuto); |
2698 } else if (ds->replacesCurrentHistoryItem()) { | 2693 } else if (ds->replacesCurrentHistoryItem()) { |
2699 // Subframe navigations that don't add session history items must be | 2694 // Subframe navigations that don't add session history items must be |
2700 // marked with AUTO_SUBFRAME. See also didFailProvisionalLoad for how we | 2695 // marked with AUTO_SUBFRAME. See also didFailProvisionalLoad for how we |
2701 // handle loading of error pages. | 2696 // handle loading of error pages. |
2702 static_cast<NavigationStateImpl*>(document_state->navigation_state()) | 2697 static_cast<NavigationStateImpl*>(document_state->navigation_state()) |
2703 ->set_transition_type(ui::PAGE_TRANSITION_AUTO_SUBFRAME); | 2698 ->set_transition_type(ui::PAGE_TRANSITION_AUTO_SUBFRAME); |
2704 } | 2699 } |
2705 | 2700 |
2701 // See if we have a better timestamp from a browser initiated navigation. | |
2702 // Otherwise use the renderer-marked timestamp. | |
2703 DCHECK(ds->getNavigationStartTime()); | |
2704 double browser_navigation_start = ds->request().browserNavigationStartTime(); | |
2705 double navigation_start = | |
2706 browser_navigation_start ? browser_navigation_start | |
2707 : ds->getNavigationStartTime(); | |
2708 | |
2706 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), | 2709 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), |
2707 DidStartProvisionalLoad(frame)); | 2710 DidStartProvisionalLoad(frame)); |
2708 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidStartProvisionalLoad()); | 2711 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidStartProvisionalLoad()); |
2709 | 2712 |
2710 Send(new FrameHostMsg_DidStartProvisionalLoadForFrame( | 2713 Send(new FrameHostMsg_DidStartProvisionalLoadForFrame( |
2711 routing_id_, ds->request().url())); | 2714 routing_id_, ds->request().url(), navigation_start)); |
2712 } | 2715 } |
2713 | 2716 |
2714 void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad( | 2717 void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad( |
2715 blink::WebLocalFrame* frame) { | 2718 blink::WebLocalFrame* frame) { |
2716 DCHECK(!frame_ || frame_ == frame); | 2719 DCHECK(!frame_ || frame_ == frame); |
2717 render_view_->history_controller()->RemoveChildrenForRedirect(this); | 2720 render_view_->history_controller()->RemoveChildrenForRedirect(this); |
2718 } | 2721 } |
2719 | 2722 |
2720 void RenderFrameImpl::didFailProvisionalLoad( | 2723 void RenderFrameImpl::didFailProvisionalLoad( |
2721 blink::WebLocalFrame* frame, | 2724 blink::WebLocalFrame* frame, |
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4305 RenderFrameImpl::PrepareRenderViewForNavigation( | 4308 RenderFrameImpl::PrepareRenderViewForNavigation( |
4306 common_params.url, request_params, &is_reload, &cache_policy); | 4309 common_params.url, request_params, &is_reload, &cache_policy); |
4307 | 4310 |
4308 GetContentClient()->SetActiveURL(common_params.url); | 4311 GetContentClient()->SetActiveURL(common_params.url); |
4309 | 4312 |
4310 pending_navigation_params_.reset(new NavigationParams( | 4313 pending_navigation_params_.reset(new NavigationParams( |
4311 common_params, StartNavigationParams(), request_params)); | 4314 common_params, StartNavigationParams(), request_params)); |
4312 | 4315 |
4313 // Inform the browser of the start of the provisional load. This is needed so | 4316 // Inform the browser of the start of the provisional load. This is needed so |
4314 // that the load is properly tracked by the WebNavigation API. | 4317 // that the load is properly tracked by the WebNavigation API. |
4318 base::TimeDelta navigation_start = | |
4319 (request_params.browser_navigation_start - base::TimeTicks()); | |
4315 Send(new FrameHostMsg_DidStartProvisionalLoadForFrame( | 4320 Send(new FrameHostMsg_DidStartProvisionalLoadForFrame( |
4316 routing_id_, common_params.url)); | 4321 routing_id_, common_params.url, navigation_start.InSecondsF())); |
clamy
2015/10/28 12:40:01
nit: in PlzNavigate, you don't really care about w
| |
4317 | 4322 |
4318 // Send the provisional load failure. | 4323 // Send the provisional load failure. |
4319 blink::WebURLError error = | 4324 blink::WebURLError error = |
4320 CreateWebURLError(common_params.url, has_stale_copy_in_cache, error_code); | 4325 CreateWebURLError(common_params.url, has_stale_copy_in_cache, error_code); |
4321 WebURLRequest failed_request = CreateURLRequestForNavigation( | 4326 WebURLRequest failed_request = CreateURLRequestForNavigation( |
4322 common_params, scoped_ptr<StreamOverrideParameters>(), | 4327 request_params, common_params, scoped_ptr<StreamOverrideParameters>(), |
4323 frame_->isViewSourceModeEnabled()); | 4328 frame_->isViewSourceModeEnabled()); |
4324 SendFailedProvisionalLoad(failed_request, error, frame_); | 4329 SendFailedProvisionalLoad(failed_request, error, frame_); |
4325 | 4330 |
4326 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { | 4331 if (!ShouldDisplayErrorPageForFailedLoad(error_code, common_params.url)) { |
4327 // TODO(avi): Remove this; we shouldn't ever be dropping navigations. | 4332 // TODO(avi): Remove this; we shouldn't ever be dropping navigations. |
4328 // http://crbug.com/501960 | 4333 // http://crbug.com/501960 |
4329 Send(new FrameHostMsg_DidDropNavigation(routing_id_)); | 4334 Send(new FrameHostMsg_DidDropNavigation(routing_id_)); |
4330 return; | 4335 return; |
4331 } | 4336 } |
4332 | 4337 |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4648 } | 4653 } |
4649 | 4654 |
4650 pending_navigation_params_.reset( | 4655 pending_navigation_params_.reset( |
4651 new NavigationParams(common_params, start_params, request_params)); | 4656 new NavigationParams(common_params, start_params, request_params)); |
4652 | 4657 |
4653 // Create parameters for a standard navigation. | 4658 // Create parameters for a standard navigation. |
4654 blink::WebFrameLoadType load_type = blink::WebFrameLoadType::Standard; | 4659 blink::WebFrameLoadType load_type = blink::WebFrameLoadType::Standard; |
4655 bool should_load_request = false; | 4660 bool should_load_request = false; |
4656 WebHistoryItem item_for_history_navigation; | 4661 WebHistoryItem item_for_history_navigation; |
4657 WebURLRequest request = CreateURLRequestForNavigation( | 4662 WebURLRequest request = CreateURLRequestForNavigation( |
4658 common_params, stream_params.Pass(), frame_->isViewSourceModeEnabled()); | 4663 request_params, common_params, stream_params.Pass(), |
4664 frame_->isViewSourceModeEnabled()); | |
4659 #if defined(OS_ANDROID) | 4665 #if defined(OS_ANDROID) |
4660 request.setHasUserGesture(start_params.has_user_gesture); | 4666 request.setHasUserGesture(start_params.has_user_gesture); |
4661 #endif | 4667 #endif |
4662 | 4668 |
4663 // PlzNavigate: Make sure that Blink's loader will not try to use browser side | 4669 // PlzNavigate: Make sure that Blink's loader will not try to use browser side |
4664 // navigation for this request (since it already went to the browser). | 4670 // navigation for this request (since it already went to the browser). |
4665 if (browser_side_navigation) | 4671 if (browser_side_navigation) |
4666 request.setCheckForBrowserSideNavigation(false); | 4672 request.setCheckForBrowserSideNavigation(false); |
4667 | 4673 |
4668 // If we are reloading, then use the history state of the current frame. | 4674 // If we are reloading, then use the history state of the current frame. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4773 request.setHTTPBody(http_body); | 4779 request.setHTTPBody(http_body); |
4774 } | 4780 } |
4775 | 4781 |
4776 // A session history navigation should have been accompanied by state. | 4782 // A session history navigation should have been accompanied by state. |
4777 CHECK_EQ(request_params.page_id, -1); | 4783 CHECK_EQ(request_params.page_id, -1); |
4778 | 4784 |
4779 should_load_request = true; | 4785 should_load_request = true; |
4780 } | 4786 } |
4781 | 4787 |
4782 if (should_load_request) { | 4788 if (should_load_request) { |
4783 // Record this before starting the load. We need a lower bound of this | |
4784 // time to sanitize the navigationStart override set below. | |
4785 base::TimeTicks renderer_navigation_start = base::TimeTicks::Now(); | |
4786 | |
4787 // Perform a navigation to a data url if needed. | 4789 // Perform a navigation to a data url if needed. |
4788 if (!common_params.base_url_for_data_url.is_empty() || | 4790 if (!common_params.base_url_for_data_url.is_empty() || |
4789 (browser_side_navigation && | 4791 (browser_side_navigation && |
4790 common_params.url.SchemeIs(url::kDataScheme))) { | 4792 common_params.url.SchemeIs(url::kDataScheme))) { |
4791 LoadDataURL(common_params, frame_); | 4793 LoadDataURL(common_params, frame_); |
4792 } else { | 4794 } else { |
4793 // Load the request. | 4795 // Load the request. |
4794 frame_->toWebLocalFrame()->load(request, load_type, | 4796 frame_->toWebLocalFrame()->load(request, load_type, |
4795 item_for_history_navigation); | 4797 item_for_history_navigation); |
4796 } | 4798 } |
4799 if (load_type == blink::WebFrameLoadType::Standard && | |
4800 frame_->provisionalDataSource()) { | |
4801 frame_->provisionalDataSource()->setNavigationStartTime( | |
4802 request.browserNavigationStartTime()); | |
4803 } | |
4797 | 4804 |
4798 if (load_type == blink::WebFrameLoadType::Standard) { | |
4799 UpdateFrameNavigationTiming(frame_, | |
4800 request_params.browser_navigation_start, | |
4801 renderer_navigation_start); | |
4802 } | |
4803 } | 4805 } |
4804 | 4806 |
4805 // In case LoadRequest failed before didCreateDataSource was called. | 4807 // In case LoadRequest failed before didCreateDataSource was called. |
4806 pending_navigation_params_.reset(); | 4808 pending_navigation_params_.reset(); |
4807 } | 4809 } |
4808 | 4810 |
4809 void RenderFrameImpl::UpdateEncoding(WebFrame* frame, | 4811 void RenderFrameImpl::UpdateEncoding(WebFrame* frame, |
4810 const std::string& encoding_name) { | 4812 const std::string& encoding_name) { |
4811 // Only update main frame's encoding_name. | 4813 // Only update main frame's encoding_name. |
4812 if (!frame->parent()) | 4814 if (!frame->parent()) |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5015 GetFetchCredentialsModeForWebURLRequest(*request)); | 5017 GetFetchCredentialsModeForWebURLRequest(*request)); |
5016 DCHECK(GetFetchRedirectModeForWebURLRequest(*request) == | 5018 DCHECK(GetFetchRedirectModeForWebURLRequest(*request) == |
5017 FetchRedirectMode::MANUAL_MODE); | 5019 FetchRedirectMode::MANUAL_MODE); |
5018 DCHECK_IMPLIES(!frame_->parent(), | 5020 DCHECK_IMPLIES(!frame_->parent(), |
5019 GetRequestContextFrameTypeForWebURLRequest(*request) == | 5021 GetRequestContextFrameTypeForWebURLRequest(*request) == |
5020 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL); | 5022 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL); |
5021 DCHECK_IMPLIES(frame_->parent(), | 5023 DCHECK_IMPLIES(frame_->parent(), |
5022 GetRequestContextFrameTypeForWebURLRequest(*request) == | 5024 GetRequestContextFrameTypeForWebURLRequest(*request) == |
5023 REQUEST_CONTEXT_FRAME_TYPE_NESTED); | 5025 REQUEST_CONTEXT_FRAME_TYPE_NESTED); |
5024 | 5026 |
5027 double navigation_start_seconds = | |
5028 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); | |
5025 Send(new FrameHostMsg_BeginNavigation( | 5029 Send(new FrameHostMsg_BeginNavigation( |
5026 routing_id_, | 5030 routing_id_, |
5027 MakeCommonNavigationParams(request, should_replace_current_entry), | 5031 MakeCommonNavigationParams(request, should_replace_current_entry), |
5028 BeginNavigationParams( | 5032 BeginNavigationParams( |
5029 request->httpMethod().latin1(), GetWebURLRequestHeaders(*request), | 5033 request->httpMethod().latin1(), GetWebURLRequestHeaders(*request), |
5030 GetLoadFlagsForWebURLRequest(*request), request->hasUserGesture(), | 5034 GetLoadFlagsForWebURLRequest(*request), request->hasUserGesture(), |
5031 request->skipServiceWorker(), | 5035 request->skipServiceWorker(), |
5032 GetRequestContextTypeForWebURLRequest(*request)), | 5036 GetRequestContextTypeForWebURLRequest(*request), |
5037 navigation_start_seconds), | |
5033 GetRequestBodyForWebURLRequest(*request))); | 5038 GetRequestBodyForWebURLRequest(*request))); |
5034 } | 5039 } |
5035 | 5040 |
5036 void RenderFrameImpl::LoadDataURL(const CommonNavigationParams& params, | 5041 void RenderFrameImpl::LoadDataURL(const CommonNavigationParams& params, |
5037 WebFrame* frame) { | 5042 WebFrame* frame) { |
5038 // A loadData request with a specified base URL. | 5043 // A loadData request with a specified base URL. |
5039 std::string mime_type, charset, data; | 5044 std::string mime_type, charset, data; |
5040 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) { | 5045 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) { |
5041 const GURL base_url = params.base_url_for_data_url.is_empty() ? | 5046 const GURL base_url = params.base_url_for_data_url.is_empty() ? |
5042 params.url : params.base_url_for_data_url; | 5047 params.url : params.base_url_for_data_url; |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5290 mojo::ServiceProviderPtr service_provider; | 5295 mojo::ServiceProviderPtr service_provider; |
5291 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 5296 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
5292 request->url = mojo::String::From(url); | 5297 request->url = mojo::String::From(url); |
5293 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), | 5298 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), |
5294 nullptr, nullptr, | 5299 nullptr, nullptr, |
5295 base::Bind(&OnGotContentHandlerID)); | 5300 base::Bind(&OnGotContentHandlerID)); |
5296 return service_provider.Pass(); | 5301 return service_provider.Pass(); |
5297 } | 5302 } |
5298 | 5303 |
5299 } // namespace content | 5304 } // namespace content |
OLD | NEW |