OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_version.h" | 5 #include "content/browser/service_worker/service_worker_version.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 356 |
357 FOR_EACH_OBSERVER(Listener, listeners_, OnVersionStateChanged(this)); | 357 FOR_EACH_OBSERVER(Listener, listeners_, OnVersionStateChanged(this)); |
358 } | 358 } |
359 | 359 |
360 void ServiceWorkerVersion::RegisterStatusChangeCallback( | 360 void ServiceWorkerVersion::RegisterStatusChangeCallback( |
361 const base::Closure& callback) { | 361 const base::Closure& callback) { |
362 status_change_callbacks_.push_back(callback); | 362 status_change_callbacks_.push_back(callback); |
363 } | 363 } |
364 | 364 |
365 ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() { | 365 ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() { |
366 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 366 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
367 return ServiceWorkerVersionInfo( | 367 return ServiceWorkerVersionInfo( |
368 running_status(), status(), script_url(), registration_id(), version_id(), | 368 running_status(), status(), script_url(), registration_id(), version_id(), |
369 embedded_worker()->process_id(), embedded_worker()->thread_id(), | 369 embedded_worker()->process_id(), embedded_worker()->thread_id(), |
370 embedded_worker()->worker_devtools_agent_route_id()); | 370 embedded_worker()->worker_devtools_agent_route_id()); |
371 } | 371 } |
372 | 372 |
373 void ServiceWorkerVersion::StartWorker(const StatusCallback& callback) { | 373 void ServiceWorkerVersion::StartWorker(const StatusCallback& callback) { |
374 StartWorker(false, callback); | 374 StartWorker(false, callback); |
375 } | 375 } |
376 | 376 |
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 int request_id) { | 1621 int request_id) { |
1622 callbacks->Remove(request_id); | 1622 callbacks->Remove(request_id); |
1623 if (is_doomed_) { | 1623 if (is_doomed_) { |
1624 // The stop should be already scheduled, but try to stop immediately, in | 1624 // The stop should be already scheduled, but try to stop immediately, in |
1625 // order to release worker resources soon. | 1625 // order to release worker resources soon. |
1626 StopWorkerIfIdle(); | 1626 StopWorkerIfIdle(); |
1627 } | 1627 } |
1628 } | 1628 } |
1629 | 1629 |
1630 } // namespace content | 1630 } // namespace content |
OLD | NEW |