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

Unified Diff: content/browser/frame_host/navigation_request.cc

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index f515a696e5c12ff2909e01087258710c0f46e264..d77b17546c02ba7e9a10945443088ee126b870dc 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -11,6 +11,7 @@
#include "content/browser/frame_host/navigation_request_info.h"
#include "content/browser/frame_host/navigator.h"
#include "content/browser/loader/navigation_url_loader.h"
+#include "content/browser/service_worker/service_worker_provider_host.h"
#include "content/browser/site_instance_impl.h"
#include "content/common/resource_request_body.h"
#include "content/public/browser/navigation_controller.h"
@@ -86,17 +87,22 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
scoped_ptr<NavigationRequest> navigation_request(new NavigationRequest(
frame_tree_node,
- entry.ConstructCommonNavigationParams(dest_url, dest_referrer,
- frame_entry, navigation_type),
- BeginNavigationParams(method, headers.ToString(),
- LoadFlagFromNavigationType(navigation_type), false),
+ entry.ConstructCommonNavigationParams(
+ dest_url, dest_referrer, frame_entry, navigation_type),
+ BeginNavigationParams(method,
+ headers.ToString(),
+ LoadFlagFromNavigationType(navigation_type),
+ false, // has_user_gestures
+ false, // skip_service_worker
+ REQUEST_CONTEXT_TYPE_HYPERLINK),
entry.ConstructRequestNavigationParams(
frame_entry, navigation_start, is_same_document_history_load,
frame_tree_node->has_committed_real_load(),
controller->GetPendingEntryIndex() == -1,
controller->GetIndexOfEntry(&entry),
controller->GetLastCommittedEntryIndex(),
- controller->GetEntryCount()),
+ controller->GetEntryCount(),
+ ServiceWorkerProviderHost::GetNextNavigationProviderId()),
request_body, true, &frame_entry, &entry));
return navigation_request.Pass();
}
@@ -119,6 +125,8 @@ scoped_ptr<NavigationRequest> NavigationRequest::CreateRendererInitiated(
RequestNavigationParams request_params;
clamy 2015/10/01 12:41:27 We should switch to instantiating the RequestParam
Fabrice (no longer in Chrome) 2015/10/01 18:29:55 Done.
request_params.current_history_list_offset = current_history_list_offset;
request_params.current_history_list_length = current_history_list_length;
+ request_params.service_worker_provider_id =
+ ServiceWorkerProviderHost::GetNextNavigationProviderId();
clamy 2015/10/01 12:41:27 It seems very weird to me that we should be using
Fabrice (no longer in Chrome) 2015/10/01 18:29:55 Since it is only called here, I moved it in the an
scoped_ptr<NavigationRequest> navigation_request(
new NavigationRequest(frame_tree_node, common_params, begin_params,
request_params, body, false, nullptr, nullptr));
@@ -166,7 +174,7 @@ NavigationRequest::NavigationRequest(
bool parent_is_main_frame = !frame_tree_node->parent() ?
false : frame_tree_node->parent()->IsMainFrame();
info_.reset(new NavigationRequestInfo(
- common_params, begin_params, first_party_for_cookies,
+ common_params, begin_params, request_params, first_party_for_cookies,
frame_tree_node->IsMainFrame(), parent_is_main_frame,
frame_tree_node->frame_tree_node_id(), body));
}
@@ -213,7 +221,8 @@ bool NavigationRequest::BeginNavigation() {
void NavigationRequest::CreateNavigationHandle(NavigatorDelegate* delegate) {
navigation_handle_ = NavigationHandleImpl::Create(
- common_params_.url, frame_tree_node_->IsMainFrame(), delegate);
+ common_params_.url, frame_tree_node_->IsMainFrame(), delegate,
+ request_params_.service_worker_provider_id);
}
void NavigationRequest::TransferNavigationHandleOwnership(

Powered by Google App Engine
This is Rietveld 408576698