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

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: changed to push model 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 friend class ServiceWorkerVersionBrowserTest; 312 friend class ServiceWorkerVersionBrowserTest;
314 313
315 typedef ServiceWorkerVersion self; 314 typedef ServiceWorkerVersion self;
316 typedef std::map<ServiceWorkerProviderHost*, int> ControlleeMap; 315 typedef std::map<ServiceWorkerProviderHost*, int> ControlleeMap;
317 typedef IDMap<ServiceWorkerProviderHost> ControlleeByIDMap; 316 typedef IDMap<ServiceWorkerProviderHost> ControlleeByIDMap;
318 317
319 ~ServiceWorkerVersion() override; 318 ~ServiceWorkerVersion() override;
320 319
321 // EmbeddedWorkerInstance::Listener overrides: 320 // EmbeddedWorkerInstance::Listener overrides:
322 void OnScriptLoaded() override; 321 void OnScriptLoaded() override;
322 void OnStarting() override;
323 void OnStarted() override; 323 void OnStarted() override;
324 void OnStopping() override;
324 void OnStopped(EmbeddedWorkerInstance::Status old_status) override; 325 void OnStopped(EmbeddedWorkerInstance::Status old_status) override;
325 void OnReportException(const base::string16& error_message, 326 void OnReportException(const base::string16& error_message,
326 int line_number, 327 int line_number,
327 int column_number, 328 int column_number,
328 const GURL& source_url) override; 329 const GURL& source_url) override;
329 void OnReportConsoleMessage(int source_identifier, 330 void OnReportConsoleMessage(int source_identifier,
330 int message_level, 331 int message_level,
331 const base::string16& message, 332 const base::string16& message,
332 int line_number, 333 int line_number,
333 const GURL& source_url) override; 334 const GURL& source_url) override;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; 477 scoped_ptr<net::HttpResponseInfo> main_script_http_info_;
477 478
478 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; 479 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;
479 480
480 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); 481 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion);
481 }; 482 };
482 483
483 } // namespace content 484 } // namespace content
484 485
485 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 486 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698