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

Unified Diff: content/renderer/service_worker/service_worker_context_client.cc

Issue 1344783002: ServiceWorker: Carve out methods of ServiceWorkerProviderContext to delegate classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add class comments more Created 5 years, 2 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
« no previous file with comments | « content/renderer/service_worker/service_worker_context_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/service_worker/service_worker_context_client.cc
diff --git a/content/renderer/service_worker/service_worker_context_client.cc b/content/renderer/service_worker/service_worker_context_client.cc
index ee2f3afbf333618b4c85bfefb1f77496d797eaa5..34e173120d9bc1764b2e20bd7f65afb723a89e61 100644
--- a/content/renderer/service_worker/service_worker_context_client.cc
+++ b/content/renderer/service_worker/service_worker_context_client.cc
@@ -360,8 +360,8 @@ void ServiceWorkerContextClient::workerContextStarted(
ServiceWorkerRegistrationObjectInfo registration_info;
ServiceWorkerVersionAttributes version_attrs;
- provider_context_->GetRegistrationInfoAndVersionAttributes(&registration_info,
- &version_attrs);
+ provider_context_->GetAssociatedRegistration(&registration_info,
+ &version_attrs);
DCHECK_NE(registration_info.registration_id,
kInvalidServiceWorkerRegistrationId);
@@ -372,7 +372,7 @@ void ServiceWorkerContextClient::workerContextStarted(
context_->service_registry.ServiceRegistry::AddService(base::Bind(
&BackgroundSyncClientImpl::Create, registration_info.registration_id));
- SetRegistrationInServiceWorkerGlobalScope();
+ SetRegistrationInServiceWorkerGlobalScope(registration_info, version_attrs);
Send(new EmbeddedWorkerHostMsg_WorkerThreadStarted(
embedded_worker_id_, WorkerThread::GetCurrentId(),
@@ -671,17 +671,10 @@ void ServiceWorkerContextClient::SendWorkerStarted() {
Send(new EmbeddedWorkerHostMsg_WorkerStarted(embedded_worker_id_));
}
-void ServiceWorkerContextClient::SetRegistrationInServiceWorkerGlobalScope() {
+void ServiceWorkerContextClient::SetRegistrationInServiceWorkerGlobalScope(
+ const ServiceWorkerRegistrationObjectInfo& info,
+ const ServiceWorkerVersionAttributes& attrs) {
DCHECK(worker_task_runner_->RunsTasksOnCurrentThread());
- DCHECK(provider_context_);
-
- ServiceWorkerRegistrationObjectInfo info;
- ServiceWorkerVersionAttributes attrs;
- bool found =
- provider_context_->GetRegistrationInfoAndVersionAttributes(&info, &attrs);
- if (!found)
- return; // Cannot be associated with a registration in some tests.
-
ServiceWorkerDispatcher* dispatcher =
ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance(
sender_.get(), main_thread_task_runner_.get());
« no previous file with comments | « content/renderer/service_worker/service_worker_context_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698