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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1315023004: PlzNavigate: Add parameters to navigation structures for ServiceWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test following https://codereview.chromium.org/1320023005 Created 5 years, 3 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/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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 // CommitNavigation IPC, and then back to the browser again in the 508 // CommitNavigation IPC, and then back to the browser again in the
509 // DidCommitProvisionalLoad and the DocumentLoadComplete IPCs. 509 // DidCommitProvisionalLoad and the DocumentLoadComplete IPCs.
510 base::TimeTicks ui_timestamp = 510 base::TimeTicks ui_timestamp =
511 base::TimeTicks() + base::TimeDelta::FromSecondsD(request->uiStartTime()); 511 base::TimeTicks() + base::TimeDelta::FromSecondsD(request->uiStartTime());
512 FrameMsg_UILoadMetricsReportType::Value report_type = 512 FrameMsg_UILoadMetricsReportType::Value report_type =
513 static_cast<FrameMsg_UILoadMetricsReportType::Value>( 513 static_cast<FrameMsg_UILoadMetricsReportType::Value>(
514 request->inputPerfMetricReportPolicy()); 514 request->inputPerfMetricReportPolicy());
515 return CommonNavigationParams( 515 return CommonNavigationParams(
516 request->url(), referrer, extra_data->transition_type(), 516 request->url(), referrer, extra_data->transition_type(),
517 FrameMsg_Navigate_Type::NORMAL, true, should_replace_current_entry, 517 FrameMsg_Navigate_Type::NORMAL, true, should_replace_current_entry,
518 ui_timestamp, report_type, GURL(), GURL()); 518 ui_timestamp, report_type, GURL(), GURL(),
519 extra_data->service_worker_provider_id());
519 } 520 }
520 521
521 #if !defined(OS_ANDROID) || defined(ENABLE_MEDIA_PIPELINE_ON_ANDROID) 522 #if !defined(OS_ANDROID) || defined(ENABLE_MEDIA_PIPELINE_ON_ANDROID)
522 media::Context3D GetSharedMainThreadContext3D() { 523 media::Context3D GetSharedMainThreadContext3D() {
523 cc::ContextProvider* provider = 524 cc::ContextProvider* provider =
524 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 525 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
525 if (!provider) 526 if (!provider)
526 return media::Context3D(); 527 return media::Context3D();
527 return media::Context3D(provider->ContextGL(), provider->GrContext()); 528 return media::Context3D(provider->ContextGL(), provider->GrContext());
528 } 529 }
(...skipping 4313 matching lines...) Expand 10 before | Expand all | Expand 10 after
4842 WebDataSource* provisional_data_source = frame_->provisionalDataSource(); 4843 WebDataSource* provisional_data_source = frame_->provisionalDataSource();
4843 WebDataSource* current_data_source = frame_->dataSource(); 4844 WebDataSource* current_data_source = frame_->dataSource();
4844 WebDataSource* data_source = 4845 WebDataSource* data_source =
4845 provisional_data_source ? provisional_data_source : current_data_source; 4846 provisional_data_source ? provisional_data_source : current_data_source;
4846 4847
4847 // The current entry can only be replaced if there already is an entry in the 4848 // The current entry can only be replaced if there already is an entry in the
4848 // history list. 4849 // history list.
4849 if (data_source && render_view_->history_list_length_ > 0) { 4850 if (data_source && render_view_->history_list_length_ > 0) {
4850 should_replace_current_entry = data_source->replacesCurrentHistoryItem(); 4851 should_replace_current_entry = data_source->replacesCurrentHistoryItem();
4851 } 4852 }
4853
4854 DCHECK_EQ(FETCH_REQUEST_MODE_SAME_ORIGIN,
4855 GetFetchRequestModeForWebURLRequest(*request));
4856 DCHECK_EQ(FETCH_CREDENTIALS_MODE_INCLUDE,
4857 GetFetchCredentialsModeForWebURLRequest(*request));
4858 DCHECK(GetFetchRedirectModeForWebURLRequest(*request) ==
4859 FetchRedirectMode::MANUAL_MODE);
4860 DCHECK_IMPLIES(!frame_->parent(),
4861 GetRequestContextFrameTypeForWebURLRequest(*request) ==
4862 REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL);
4863 DCHECK_IMPLIES(frame_->parent(),
4864 GetRequestContextFrameTypeForWebURLRequest(*request) ==
4865 REQUEST_CONTEXT_FRAME_TYPE_NESTED);
4866
4852 Send(new FrameHostMsg_BeginNavigation( 4867 Send(new FrameHostMsg_BeginNavigation(
4853 routing_id_, 4868 routing_id_,
4854 MakeCommonNavigationParams(request, should_replace_current_entry), 4869 MakeCommonNavigationParams(request, should_replace_current_entry),
4855 BeginNavigationParams( 4870 BeginNavigationParams(
4856 request->httpMethod().latin1(), GetWebURLRequestHeaders(*request), 4871 request->httpMethod().latin1(),
4857 GetLoadFlagsForWebURLRequest(*request), request->hasUserGesture()), 4872 GetWebURLRequestHeaders(*request),
4873 GetLoadFlagsForWebURLRequest(*request),
4874 request->hasUserGesture(),
4875 request->skipServiceWorker(),
4876 GetRequestContextTypeForWebURLRequest(*request)),
4858 GetRequestBodyForWebURLRequest(*request))); 4877 GetRequestBodyForWebURLRequest(*request)));
4859 } 4878 }
4860 4879
4861 void RenderFrameImpl::LoadDataURL(const CommonNavigationParams& params, 4880 void RenderFrameImpl::LoadDataURL(const CommonNavigationParams& params,
4862 WebFrame* frame) { 4881 WebFrame* frame) {
4863 // A loadData request with a specified base URL. 4882 // A loadData request with a specified base URL.
4864 std::string mime_type, charset, data; 4883 std::string mime_type, charset, data;
4865 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) { 4884 if (net::DataURL::Parse(params.url, &mime_type, &charset, &data)) {
4866 const GURL base_url = params.base_url_for_data_url.is_empty() ? 4885 const GURL base_url = params.base_url_for_data_url.is_empty() ?
4867 params.url : params.base_url_for_data_url; 4886 params.url : params.base_url_for_data_url;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
5112 mojo::ServiceProviderPtr service_provider; 5131 mojo::ServiceProviderPtr service_provider;
5113 mojo::URLRequestPtr request(mojo::URLRequest::New()); 5132 mojo::URLRequestPtr request(mojo::URLRequest::New());
5114 request->url = mojo::String::From(url); 5133 request->url = mojo::String::From(url);
5115 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), 5134 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider),
5116 nullptr, nullptr, 5135 nullptr, nullptr,
5117 base::Bind(&OnGotContentHandlerID)); 5136 base::Bind(&OnGotContentHandlerID));
5118 return service_provider.Pass(); 5137 return service_provider.Pass();
5119 } 5138 }
5120 5139
5121 } // namespace content 5140 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698