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

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

Issue 1149383004: [3/5 chromium] Shows the clients which are controlled by ServiceWorker in DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated nhiroki's comment Created 5 years, 6 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 d2d69342ac5f146df8f3405c6d9fe475bc100de2..9700fd0d30f3b5913dffe75bb982f493585d1873 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -24,6 +24,7 @@
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/browser/service_worker/service_worker_storage.h"
#include "content/public/browser/browser_thread.h"
+#include "ipc/ipc_message.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
#include "storage/browser/quota/quota_manager_proxy.h"
@@ -554,6 +555,28 @@ void ServiceWorkerContextCore::OnReportConsoleMessage(
source_identifier, message_level, message, line_number, source_url));
}
+void ServiceWorkerContextCore::OnControlleeAdded(
+ ServiceWorkerVersion* version,
+ ServiceWorkerProviderHost* provider_host) {
+ if (!observer_list_.get())
+ return;
+ observer_list_->Notify(FROM_HERE,
+ &ServiceWorkerContextObserver::OnControlleeAdded,
+ version->version_id(), provider_host->client_uuid(),
+ provider_host->process_id(), provider_host->route_id(),
+ provider_host->provider_type());
+}
+
+void ServiceWorkerContextCore::OnControlleeRemoved(
+ ServiceWorkerVersion* version,
+ ServiceWorkerProviderHost* provider_host) {
+ if (!observer_list_.get())
+ return;
+ observer_list_->Notify(FROM_HERE,
+ &ServiceWorkerContextObserver::OnControlleeRemoved,
+ version->version_id(), provider_host->client_uuid());
+}
+
ServiceWorkerProcessManager* ServiceWorkerContextCore::process_manager() {
return wrapper_->process_manager();
}

Powered by Google App Engine
This is Rietveld 408576698