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

Unified Diff: content/child/service_worker/service_worker_dispatcher.cc

Issue 854543002: ServiceWorker: Rename ScriptClientMap to ProviderClientMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/child/service_worker/service_worker_dispatcher.cc
diff --git a/content/child/service_worker/service_worker_dispatcher.cc b/content/child/service_worker/service_worker_dispatcher.cc
index d95e5b94d4612c216f1f5ab95c22e2a540710b0e..2c6fd0b7f782cf12d87caa2e252c09605963b002 100644
--- a/content/child/service_worker/service_worker_dispatcher.cc
+++ b/content/child/service_worker/service_worker_dispatcher.cc
@@ -185,18 +185,18 @@ void ServiceWorkerDispatcher::RemoveProviderContext(
worker_to_provider_.erase(provider_context->controller_handle_id());
}
-void ServiceWorkerDispatcher::AddScriptClient(
+void ServiceWorkerDispatcher::AddProviderClient(
int provider_id,
blink::WebServiceWorkerProviderClient* client) {
DCHECK(client);
- DCHECK(!ContainsKey(script_clients_, provider_id));
- script_clients_[provider_id] = client;
+ DCHECK(!ContainsKey(provider_clients_, provider_id));
+ provider_clients_[provider_id] = client;
}
-void ServiceWorkerDispatcher::RemoveScriptClient(int provider_id) {
+void ServiceWorkerDispatcher::RemoveProviderClient(int provider_id) {
// This could be possibly called multiple times to ensure termination.
- if (ContainsKey(script_clients_, provider_id))
- script_clients_.erase(provider_id);
+ if (ContainsKey(provider_clients_, provider_id))
+ provider_clients_.erase(provider_id);
}
ServiceWorkerDispatcher*
@@ -590,8 +590,8 @@ void ServiceWorkerDispatcher::SetReadyRegistration(
return;
}
- ScriptClientMap::iterator client = script_clients_.find(provider_id);
- if (client == script_clients_.end())
+ ProviderClientMap::iterator client = provider_clients_.find(provider_id);
+ if (client == provider_clients_.end())
return;
ServiceWorkerRegistrationObjectInfo info =
@@ -629,8 +629,8 @@ void ServiceWorkerDispatcher::OnSetControllerServiceWorker(
provider->second->OnSetControllerServiceWorker(info);
}
- ScriptClientMap::iterator found = script_clients_.find(provider_id);
- if (found != script_clients_.end()) {
+ ProviderClientMap::iterator found = provider_clients_.find(provider_id);
+ if (found != provider_clients_.end()) {
// Populate the .controller field with the new worker object.
found->second->setController(GetServiceWorker(info, false),
should_notify_controllerchange);
@@ -650,8 +650,8 @@ void ServiceWorkerDispatcher::OnPostMessage(
"ServiceWorkerDispatcher::OnPostMessage",
"Thread ID", thread_id);
- ScriptClientMap::iterator found = script_clients_.find(provider_id);
- if (found == script_clients_.end()) {
+ ProviderClientMap::iterator found = provider_clients_.find(provider_id);
+ if (found == provider_clients_.end()) {
// For now we do no queueing for messages sent to nonexistent / unattached
// client.
return;
@@ -675,10 +675,10 @@ void ServiceWorkerDispatcher::OnGetClientInfo(int thread_id,
int request_id,
int provider_id) {
blink::WebServiceWorkerClientInfo info;
- ScriptClientMap::iterator found = script_clients_.find(provider_id);
+ ProviderClientMap::iterator found = provider_clients_.find(provider_id);
// TODO(ksakamoto): Could we track these values in the browser side? Except
// for |isFocused|, it would be pretty easy.
- if (found != script_clients_.end() && found->second->getClientInfo(&info)) {
+ if (found != provider_clients_.end() && found->second->getClientInfo(&info)) {
ServiceWorkerClientInfo result;
result.client_id = info.clientID;
result.page_visibility_state = info.pageVisibilityState;

Powered by Google App Engine
This is Rietveld 408576698