Index: content/browser/service_worker/service_worker_context_wrapper.cc |
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc |
index 62068edd0669953a3262fce82e283b394aa0ac8c..075877bfb84e438fbee83e7092319f62fde01636 100644 |
--- a/content/browser/service_worker/service_worker_context_wrapper.cc |
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc |
@@ -212,16 +212,13 @@ static void FinishRegistrationOnIO( |
void ServiceWorkerContextWrapper::RegisterServiceWorker( |
const GURL& pattern, |
const GURL& script_url, |
+ bool use_cache, |
const ResultCallback& continuation) { |
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
BrowserThread::PostTask( |
- BrowserThread::IO, |
- FROM_HERE, |
- base::Bind(&ServiceWorkerContextWrapper::RegisterServiceWorker, |
- this, |
- pattern, |
- script_url, |
- continuation)); |
+ BrowserThread::IO, FROM_HERE, |
+ base::Bind(&ServiceWorkerContextWrapper::RegisterServiceWorker, this, |
+ pattern, script_url, use_cache, continuation)); |
return; |
} |
if (!context_core_) { |
@@ -229,9 +226,12 @@ void ServiceWorkerContextWrapper::RegisterServiceWorker( |
base::Bind(continuation, false)); |
return; |
} |
- context()->RegisterServiceWorker( |
+ ServiceWorkerRegistrationOptions options( |
net::SimplifyUrlForRequest(pattern), |
- net::SimplifyUrlForRequest(script_url), NULL /* provider_host */, |
+ use_cache ? ServiceWorkerRegistrationOptions::UseCache::Use |
+ : ServiceWorkerRegistrationOptions::UseCache::DontUse); |
+ context()->RegisterServiceWorker( |
+ net::SimplifyUrlForRequest(script_url), options, NULL /* provider_host */, |
base::Bind(&FinishRegistrationOnIO, continuation)); |
} |