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

Unified Diff: content/browser/loader/navigation_url_loader_impl.cc

Issue 1257553002: [Proof-of-concept] PlzNavigate and Service Worker Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass navigation_provider_id Created 5 years, 5 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/loader/navigation_url_loader_impl.cc
diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc
index 9d7db596e4ae4988ef78a47c31708d1f312178df..f0890209ca2208b187976fd0ba1e4e2c008cac75 100644
--- a/content/browser/loader/navigation_url_loader_impl.cc
+++ b/content/browser/loader/navigation_url_loader_impl.cc
@@ -11,6 +11,7 @@
#include "content/browser/loader/navigation_url_loader_impl_core.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/stream_handle.h"
namespace content {
@@ -24,7 +25,11 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl(
weak_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- core_ = new NavigationURLLoaderImplCore(weak_factory_.GetWeakPtr());
+ StoragePartition* partition = BrowserContext::GetStoragePartitionForSite(
+ browser_context, request_info->common_params.url);
+ DCHECK(partition);
+ core_ = new NavigationURLLoaderImplCore(weak_factory_.GetWeakPtr(),
+ partition->GetServiceWorkerContext());
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&NavigationURLLoaderImplCore::Start, base::Unretained(core_),
@@ -58,10 +63,11 @@ void NavigationURLLoaderImpl::NotifyRequestRedirected(
void NavigationURLLoaderImpl::NotifyResponseStarted(
const scoped_refptr<ResourceResponse>& response,
- scoped_ptr<StreamHandle> body) {
+ scoped_ptr<StreamHandle> body,
+ int navigation_provider_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- delegate_->OnResponseStarted(response, body.Pass());
+ delegate_->OnResponseStarted(response, body.Pass(), navigation_provider_id);
}
void NavigationURLLoaderImpl::NotifyRequestFailed(bool in_cache,

Powered by Google App Engine
This is Rietveld 408576698