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

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

Issue 985663002: Implement ServiceWorkerRegistration related DevTools events [2/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: override 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
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_SERVICE_WORKER_VERSION_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 INSTALLING, // Install event is dispatched and being handled. 85 INSTALLING, // Install event is dispatched and being handled.
86 INSTALLED, // Install event is finished and is ready to be activated. 86 INSTALLED, // Install event is finished and is ready to be activated.
87 ACTIVATING, // Activate event is dispatched and being handled. 87 ACTIVATING, // Activate event is dispatched and being handled.
88 ACTIVATED, // Activation is finished and can run as activated. 88 ACTIVATED, // Activation is finished and can run as activated.
89 REDUNDANT, // The version is no longer running as activated, due to 89 REDUNDANT, // The version is no longer running as activated, due to
90 // unregistration or replace. 90 // unregistration or replace.
91 }; 91 };
92 92
93 class Listener { 93 class Listener {
94 public: 94 public:
95 virtual void OnWorkerStarted(ServiceWorkerVersion* version) {} 95 virtual void OnRunningStateChanged(ServiceWorkerVersion* version) {}
96 virtual void OnWorkerStopped(ServiceWorkerVersion* version) {}
97 virtual void OnVersionStateChanged(ServiceWorkerVersion* version) {} 96 virtual void OnVersionStateChanged(ServiceWorkerVersion* version) {}
98 virtual void OnErrorReported(ServiceWorkerVersion* version, 97 virtual void OnErrorReported(ServiceWorkerVersion* version,
99 const base::string16& error_message, 98 const base::string16& error_message,
100 int line_number, 99 int line_number,
101 int column_number, 100 int column_number,
102 const GURL& source_url) {} 101 const GURL& source_url) {}
103 virtual void OnReportConsoleMessage(ServiceWorkerVersion* version, 102 virtual void OnReportConsoleMessage(ServiceWorkerVersion* version,
104 int source_identifier, 103 int source_identifier,
105 int message_level, 104 int message_level,
106 const base::string16& message, 105 const base::string16& message,
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 317
319 enum PingState { NOT_PINGING, PINGING, PING_TIMED_OUT }; 318 enum PingState { NOT_PINGING, PINGING, PING_TIMED_OUT };
320 319
321 // Timeout for the worker to start. 320 // Timeout for the worker to start.
322 static const int kStartWorkerTimeoutMinutes; 321 static const int kStartWorkerTimeoutMinutes;
323 322
324 ~ServiceWorkerVersion() override; 323 ~ServiceWorkerVersion() override;
325 324
326 // EmbeddedWorkerInstance::Listener overrides: 325 // EmbeddedWorkerInstance::Listener overrides:
327 void OnScriptLoaded() override; 326 void OnScriptLoaded() override;
327 void OnStarting() override;
328 void OnStarted() override; 328 void OnStarted() override;
329 void OnStopping() override;
329 void OnStopped(EmbeddedWorkerInstance::Status old_status) override; 330 void OnStopped(EmbeddedWorkerInstance::Status old_status) override;
330 void OnReportException(const base::string16& error_message, 331 void OnReportException(const base::string16& error_message,
331 int line_number, 332 int line_number,
332 int column_number, 333 int column_number,
333 const GURL& source_url) override; 334 const GURL& source_url) override;
334 void OnReportConsoleMessage(int source_identifier, 335 void OnReportConsoleMessage(int source_identifier,
335 int message_level, 336 int message_level,
336 const base::string16& message, 337 const base::string16& message,
337 int line_number, 338 int line_number,
338 const GURL& source_url) override; 339 const GURL& source_url) override;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; 474 scoped_ptr<net::HttpResponseInfo> main_script_http_info_;
474 475
475 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; 476 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
476 477
477 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); 478 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
478 }; 479 };
479 480
480 } // namespace content 481 } // namespace content
481 482
482 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 483 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698