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

Side by Side Diff: content/browser/service_worker/embedded_worker_instance.h

Issue 1908313003: Shows the error message while fetching the SW script in the DevTools console. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated falken's comment Created 4 years, 8 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 | « no previous file | content/browser/service_worker/embedded_worker_instance.cc » ('j') | 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/callback_forward.h" 14 #include "base/callback_forward.h"
15 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
19 #include "base/memory/weak_ptr.h" 19 #include "base/memory/weak_ptr.h"
20 #include "base/observer_list.h" 20 #include "base/observer_list.h"
21 #include "base/strings/string16.h" 21 #include "base/strings/string16.h"
22 #include "base/time/time.h" 22 #include "base/time/time.h"
23 #include "content/browser/service_worker/service_worker_metrics.h" 23 #include "content/browser/service_worker/service_worker_metrics.h"
24 #include "content/common/content_export.h" 24 #include "content/common/content_export.h"
25 #include "content/common/service_worker/service_worker_status_code.h" 25 #include "content/common/service_worker/service_worker_status_code.h"
26 #include "content/public/common/console_message_level.h"
26 #include "url/gurl.h" 27 #include "url/gurl.h"
27 28
28 // Windows headers will redefine SendMessage. 29 // Windows headers will redefine SendMessage.
29 #ifdef SendMessage 30 #ifdef SendMessage
30 #undef SendMessage 31 #undef SendMessage
31 #endif 32 #endif
32 33
33 struct EmbeddedWorkerMsg_StartWorker_Params; 34 struct EmbeddedWorkerMsg_StartWorker_Params;
34 35
35 namespace IPC { 36 namespace IPC {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // Called when the worker is installed. 174 // Called when the worker is installed.
174 void OnWorkerVersionInstalled(); 175 void OnWorkerVersionInstalled();
175 176
176 // Called when the worker is doomed. 177 // Called when the worker is doomed.
177 void OnWorkerVersionDoomed(); 178 void OnWorkerVersionDoomed();
178 179
179 // Called when the net::URLRequestJob to load the service worker script 180 // Called when the net::URLRequestJob to load the service worker script
180 // created. Not called for import scripts. 181 // created. Not called for import scripts.
181 void OnURLJobCreatedForMainScript(); 182 void OnURLJobCreatedForMainScript();
182 183
184 // Add message to the devtools console.
185 void AddMessageToConsole(ConsoleMessageLevel level,
186 const std::string& message);
187
183 static std::string StatusToString(Status status); 188 static std::string StatusToString(Status status);
184 static std::string StartingPhaseToString(StartingPhase phase); 189 static std::string StartingPhaseToString(StartingPhase phase);
185 190
186 void Detach(); 191 void Detach();
187 192
188 base::WeakPtr<EmbeddedWorkerInstance> AsWeakPtr(); 193 base::WeakPtr<EmbeddedWorkerInstance> AsWeakPtr();
189 194
190 private: 195 private:
191 typedef base::ObserverList<Listener> ListenerList; 196 typedef base::ObserverList<Listener> ListenerList;
192 class DevToolsProxy; 197 class DevToolsProxy;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 base::TimeTicks step_time_; 313 base::TimeTicks step_time_;
309 314
310 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; 315 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_;
311 316
312 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); 317 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance);
313 }; 318 };
314 319
315 } // namespace content 320 } // namespace content
316 321
317 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ 322 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/embedded_worker_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698