Chromium Code Reviews| 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 762 } | 762 } |
| 763 | 763 |
| 764 void ServiceWorkerVersion::AddListener(Listener* listener) { | 764 void ServiceWorkerVersion::AddListener(Listener* listener) { |
| 765 listeners_.AddObserver(listener); | 765 listeners_.AddObserver(listener); |
| 766 } | 766 } |
| 767 | 767 |
| 768 void ServiceWorkerVersion::RemoveListener(Listener* listener) { | 768 void ServiceWorkerVersion::RemoveListener(Listener* listener) { |
| 769 listeners_.RemoveObserver(listener); | 769 listeners_.RemoveObserver(listener); |
| 770 } | 770 } |
| 771 | 771 |
| 772 void ServiceWorkerVersion::ReportRegistrationFailure( | |
| 773 ServiceWorkerStatusCode status, | |
| 774 const std::string& status_message) { | |
| 775 std::string message(ServiceWorkerStatusToString(status)); | |
| 776 OnReportException(base::UTF8ToUTF16(message + ". " + status_message), -1, -1, | |
|
falken
2015/03/26 03:56:29
The status_message is supposed to be the message t
horo
2015/03/26 06:10:28
Done.
| |
| 777 GURL()); | |
| 778 } | |
| 779 | |
| 772 void ServiceWorkerVersion::Doom() { | 780 void ServiceWorkerVersion::Doom() { |
| 773 if (is_doomed_) | 781 if (is_doomed_) |
| 774 return; | 782 return; |
| 775 is_doomed_ = true; | 783 is_doomed_ = true; |
| 776 if (!HasControllee()) | 784 if (!HasControllee()) |
| 777 DoomInternal(); | 785 DoomInternal(); |
| 778 } | 786 } |
| 779 | 787 |
| 780 void ServiceWorkerVersion::SetDevToolsAttached(bool attached) { | 788 void ServiceWorkerVersion::SetDevToolsAttached(bool attached) { |
| 781 embedded_worker()->set_devtools_attached(attached); | 789 embedded_worker()->set_devtools_attached(attached); |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1667 int request_id) { | 1675 int request_id) { |
| 1668 callbacks->Remove(request_id); | 1676 callbacks->Remove(request_id); |
| 1669 if (is_doomed_) { | 1677 if (is_doomed_) { |
| 1670 // The stop should be already scheduled, but try to stop immediately, in | 1678 // The stop should be already scheduled, but try to stop immediately, in |
| 1671 // order to release worker resources soon. | 1679 // order to release worker resources soon. |
| 1672 StopWorkerIfIdle(); | 1680 StopWorkerIfIdle(); |
| 1673 } | 1681 } |
| 1674 } | 1682 } |
| 1675 | 1683 |
| 1676 } // namespace content | 1684 } // namespace content |
| OLD | NEW |