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

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 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_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..d4ba0a34daf693fa1e8cc0426af972e80dd5597b 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"
@@ -491,7 +492,7 @@ void ServiceWorkerContextCore::TransferProviderHostIn(
void ServiceWorkerContextCore::OnRunningStateChanged(
ServiceWorkerVersion* version) {
- if (!observer_list_.get())
+ if (!observer_list_)
return;
observer_list_->Notify(FROM_HERE,
&ServiceWorkerContextObserver::OnRunningStateChanged,
@@ -500,7 +501,7 @@ void ServiceWorkerContextCore::OnRunningStateChanged(
void ServiceWorkerContextCore::OnVersionStateChanged(
ServiceWorkerVersion* version) {
- if (!observer_list_.get())
+ if (!observer_list_)
return;
observer_list_->Notify(FROM_HERE,
&ServiceWorkerContextObserver::OnVersionStateChanged,
@@ -509,7 +510,7 @@ void ServiceWorkerContextCore::OnVersionStateChanged(
void ServiceWorkerContextCore::OnMainScriptHttpResponseInfoSet(
ServiceWorkerVersion* version) {
- if (!observer_list_.get())
+ if (!observer_list_)
return;
const net::HttpResponseInfo* info = version->GetMainScriptHttpResponseInfo();
DCHECK(info);
@@ -527,7 +528,7 @@ void ServiceWorkerContextCore::OnErrorReported(
int line_number,
int column_number,
const GURL& source_url) {
- if (!observer_list_.get())
+ if (!observer_list_)
return;
observer_list_->Notify(
FROM_HERE, &ServiceWorkerContextObserver::OnErrorReported,
@@ -544,7 +545,7 @@ void ServiceWorkerContextCore::OnReportConsoleMessage(
const base::string16& message,
int line_number,
const GURL& source_url) {
- if (!observer_list_.get())
+ if (!observer_list_)
return;
observer_list_->Notify(
FROM_HERE, &ServiceWorkerContextObserver::OnReportConsoleMessage,
@@ -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_)
+ 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_)
+ 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