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 4309b0a18de01ea68a51504c15185edcbfc67ac2..69b992f7e536386799185f2db9a6a5520449b022 100644 |
--- a/content/browser/service_worker/service_worker_context_watcher.cc |
+++ b/content/browser/service_worker/service_worker_context_watcher.cc |
@@ -165,20 +165,17 @@ void ServiceWorkerContextWatcher::OnNewLiveRegistration(int64_t registration_id, |
ServiceWorkerRegistrationInfo::IS_NOT_DELETED); |
} |
-void ServiceWorkerContextWatcher::OnNewLiveVersion(int64_t version_id, |
- int64_t registration_id, |
- const GURL& script_url) { |
+void ServiceWorkerContextWatcher::OnNewLiveVersion( |
+ const ServiceWorkerVersionInfo& version_info) { |
+ int64_t version_id = version_info.version_id; |
if (ServiceWorkerVersionInfo* version = version_info_map_.get(version_id)) { |
- DCHECK_EQ(version->registration_id, registration_id); |
- DCHECK_EQ(version->script_url, script_url); |
+ DCHECK_EQ(version->registration_id, version_info.registration_id); |
+ DCHECK_EQ(version->script_url, version_info.script_url); |
return; |
} |
std::unique_ptr<ServiceWorkerVersionInfo> version( |
- new ServiceWorkerVersionInfo()); |
- version->version_id = version_id; |
- version->registration_id = registration_id; |
- version->script_url = script_url; |
+ new ServiceWorkerVersionInfo(version_info)); |
SendVersionInfo(*version); |
if (!IsStoppedAndRedundant(*version)) |
version_info_map_.set(version_id, std::move(version)); |
@@ -210,6 +207,23 @@ void ServiceWorkerContextWatcher::OnVersionStateChanged( |
version_info_map_.erase(version_id); |
} |
+void ServiceWorkerContextWatcher::OnVersionRoutingIdsChanged( |
horo
2016/09/26 01:30:05
OnVersionDevToolsRoutingIdChanged
dgozman
2016/09/26 15:49:12
Done.
|
+ int64_t version_id, |
+ int process_id, |
+ int devtools_agent_route_id) { |
+ ServiceWorkerVersionInfo* version = version_info_map_.get(version_id); |
+ DCHECK(version); |
+ if (version->process_id == process_id && |
+ version->devtools_agent_route_id == devtools_agent_route_id) { |
+ return; |
+ } |
+ version->process_id = process_id; |
+ version->devtools_agent_route_id = devtools_agent_route_id; |
+ SendVersionInfo(*version); |
+ if (IsStoppedAndRedundant(*version)) |
+ version_info_map_.erase(version_id); |
+} |
+ |
void ServiceWorkerContextWatcher::OnMainScriptHttpResponseInfoSet( |
int64_t version_id, |
base::Time script_response_time, |