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

Unified Diff: content/browser/service_worker/service_worker_context_watcher.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 dcheng'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_watcher.cc
diff --git a/content/browser/service_worker/service_worker_context_watcher.cc b/content/browser/service_worker/service_worker_context_watcher.cc
index 0bea44dd403676cc73cb446bed8a9fcce7664c37..51d5e126c6c94e15df37cda350a441310d085eda 100644
--- a/content/browser/service_worker/service_worker_context_watcher.cc
+++ b/content/browser/service_worker/service_worker_context_watcher.cc
@@ -238,6 +238,27 @@ void ServiceWorkerContextWatcher::OnReportConsoleMessage(
message.source_url)));
}
+void ServiceWorkerContextWatcher::OnControlleeAdded(
+ int64 version_id,
+ const std::string& uuid,
+ int process_id,
+ int route_id,
+ ServiceWorkerProviderType type) {
+ ServiceWorkerVersionInfo* version = version_info_map_.get(version_id);
+ DCHECK(version);
+ version->clients[uuid] =
+ ServiceWorkerVersionInfo::ClientInfo(process_id, route_id, type);
+ SendVersionInfo(*version);
+}
+
+void ServiceWorkerContextWatcher::OnControlleeRemoved(int64 version_id,
+ const std::string& uuid) {
+ ServiceWorkerVersionInfo* version = version_info_map_.get(version_id);
+ DCHECK(version);
+ version->clients.erase(uuid);
+ SendVersionInfo(*version);
+}
+
void ServiceWorkerContextWatcher::OnRegistrationStored(int64 registration_id,
const GURL& pattern) {
SendRegistrationInfo(registration_id, pattern,

Powered by Google App Engine
This is Rietveld 408576698