| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/service_worker/service_worker_context_watcher.h" | 5 #include "content/browser/service_worker/service_worker_context_watcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
| 9 #include "content/browser/service_worker/service_worker_context_observer.h" | 9 #include "content/browser/service_worker/service_worker_context_observer.h" |
| 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 version->version_id = version_id; | 168 version->version_id = version_id; |
| 169 version->registration_id = registration_id; | 169 version->registration_id = registration_id; |
| 170 version->script_url = script_url; | 170 version->script_url = script_url; |
| 171 SendVersionInfo(*version); | 171 SendVersionInfo(*version); |
| 172 if (!IsStoppedAndRedundant(*version)) | 172 if (!IsStoppedAndRedundant(*version)) |
| 173 version_info_map_.set(version_id, version.Pass()); | 173 version_info_map_.set(version_id, version.Pass()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void ServiceWorkerContextWatcher::OnRunningStateChanged( | 176 void ServiceWorkerContextWatcher::OnRunningStateChanged( |
| 177 int64 version_id, | 177 int64 version_id, |
| 178 content::ServiceWorkerVersion::RunningStatus running_status) { | 178 content::ServiceWorkerVersion::RunningStatus running_status, |
| 179 int process_id, |
| 180 int thread_id, |
| 181 int devtools_agent_route_id) { |
| 179 ServiceWorkerVersionInfo* version = version_info_map_.get(version_id); | 182 ServiceWorkerVersionInfo* version = version_info_map_.get(version_id); |
| 180 DCHECK(version); | 183 DCHECK(version); |
| 181 if (version->running_status == running_status) | 184 if (version->running_status == running_status) |
| 182 return; | 185 return; |
| 183 version->running_status = running_status; | 186 version->running_status = running_status; |
| 187 version->process_id = process_id; |
| 188 version->thread_id = thread_id; |
| 189 version->devtools_agent_route_id = devtools_agent_route_id; |
| 184 SendVersionInfo(*version); | 190 SendVersionInfo(*version); |
| 185 if (IsStoppedAndRedundant(*version)) | 191 if (IsStoppedAndRedundant(*version)) |
| 186 version_info_map_.erase(version_id); | 192 version_info_map_.erase(version_id); |
| 187 } | 193 } |
| 188 | 194 |
| 189 void ServiceWorkerContextWatcher::OnVersionStateChanged( | 195 void ServiceWorkerContextWatcher::OnVersionStateChanged( |
| 190 int64 version_id, | 196 int64 version_id, |
| 191 content::ServiceWorkerVersion::Status status) { | 197 content::ServiceWorkerVersion::Status status) { |
| 192 ServiceWorkerVersionInfo* version = version_info_map_.get(version_id); | 198 ServiceWorkerVersionInfo* version = version_info_map_.get(version_id); |
| 193 DCHECK(version); | 199 DCHECK(version); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 ServiceWorkerRegistrationInfo::IS_NOT_DELETED); | 251 ServiceWorkerRegistrationInfo::IS_NOT_DELETED); |
| 246 } | 252 } |
| 247 | 253 |
| 248 void ServiceWorkerContextWatcher::OnRegistrationDeleted(int64 registration_id, | 254 void ServiceWorkerContextWatcher::OnRegistrationDeleted(int64 registration_id, |
| 249 const GURL& pattern) { | 255 const GURL& pattern) { |
| 250 SendRegistrationInfo(registration_id, pattern, | 256 SendRegistrationInfo(registration_id, pattern, |
| 251 ServiceWorkerRegistrationInfo::IS_DELETED); | 257 ServiceWorkerRegistrationInfo::IS_DELETED); |
| 252 } | 258 } |
| 253 | 259 |
| 254 } // namespace content | 260 } // namespace content |
| OLD | NEW |