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

Side by Side Diff: content/browser/service_worker/service_worker_version.cc

Issue 1030103003: Report error messages to DevTools window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated falken's comment Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 } 777 }
778 778
779 void ServiceWorkerVersion::AddListener(Listener* listener) { 779 void ServiceWorkerVersion::AddListener(Listener* listener) {
780 listeners_.AddObserver(listener); 780 listeners_.AddObserver(listener);
781 } 781 }
782 782
783 void ServiceWorkerVersion::RemoveListener(Listener* listener) { 783 void ServiceWorkerVersion::RemoveListener(Listener* listener) {
784 listeners_.RemoveObserver(listener); 784 listeners_.RemoveObserver(listener);
785 } 785 }
786 786
787 void ServiceWorkerVersion::ReportError(ServiceWorkerStatusCode status,
788 const std::string& status_message) {
789 if (status_message.empty()) {
790 OnReportException(base::UTF8ToUTF16(ServiceWorkerStatusToString(status)),
791 -1, -1, GURL());
792 } else {
793 OnReportException(base::UTF8ToUTF16(status_message), -1, -1, GURL());
794 }
795 }
796
787 void ServiceWorkerVersion::Doom() { 797 void ServiceWorkerVersion::Doom() {
788 if (is_doomed_) 798 if (is_doomed_)
789 return; 799 return;
790 is_doomed_ = true; 800 is_doomed_ = true;
791 if (!HasControllee()) 801 if (!HasControllee())
792 DoomInternal(); 802 DoomInternal();
793 } 803 }
794 804
795 void ServiceWorkerVersion::SetDevToolsAttached(bool attached) { 805 void ServiceWorkerVersion::SetDevToolsAttached(bool attached) {
796 embedded_worker()->set_devtools_attached(attached); 806 embedded_worker()->set_devtools_attached(attached);
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 while (!requests_.empty()) { 1760 while (!requests_.empty()) {
1751 RequestInfo info = requests_.front(); 1761 RequestInfo info = requests_.front();
1752 info.time = ticks; 1762 info.time = ticks;
1753 new_requests.push(info); 1763 new_requests.push(info);
1754 requests_.pop(); 1764 requests_.pop();
1755 } 1765 }
1756 requests_ = new_requests; 1766 requests_ = new_requests;
1757 } 1767 }
1758 1768
1759 } // namespace content 1769 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698