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

Unified Diff: content/browser/service_worker/service_worker_context_core.cc

Issue 140743012: Start EmbeddedWorker during registration - take 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update to ToT Created 6 years, 10 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/service_worker/service_worker_context_core.cc
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc
index 7a4d19b08b296e9ede25befdabc58cd1eb6a78bb..6268fdd30354980bad6606314f0463099709216e 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -23,8 +23,10 @@ ServiceWorkerContextCore::ServiceWorkerContextCore(
const base::FilePath& path,
quota::QuotaManagerProxy* quota_manager_proxy)
: storage_(new ServiceWorkerStorage(path, quota_manager_proxy)),
- job_coordinator_(new ServiceWorkerJobCoordinator(storage_.get())),
- embedded_worker_registry_(new EmbeddedWorkerRegistry(AsWeakPtr())) {}
+ embedded_worker_registry_(new EmbeddedWorkerRegistry(AsWeakPtr())),
+ job_coordinator_(
+ new ServiceWorkerJobCoordinator(storage_.get(),
+ embedded_worker_registry_)) {}
ServiceWorkerContextCore::~ServiceWorkerContextCore() {}
@@ -68,12 +70,14 @@ bool ServiceWorkerContextCore::IsEnabled() {
void ServiceWorkerContextCore::RegisterServiceWorker(
const GURL& pattern,
const GURL& script_url,
+ int source_process_id,
const RegistrationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
job_coordinator_->Register(
pattern,
script_url,
+ source_process_id,
base::Bind(&ServiceWorkerContextCore::RegistrationComplete,
AsWeakPtr(),
callback));
@@ -81,10 +85,11 @@ void ServiceWorkerContextCore::RegisterServiceWorker(
void ServiceWorkerContextCore::UnregisterServiceWorker(
const GURL& pattern,
+ int source_process_id,
const UnregistrationCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- job_coordinator_->Unregister(pattern, callback);
+ job_coordinator_->Unregister(pattern, source_process_id, callback);
}
void ServiceWorkerContextCore::RegistrationComplete(

Powered by Google App Engine
This is Rietveld 408576698