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

Side by Side Diff: content/browser/devtools/service_worker_devtools_manager.h

Issue 1893313007: DevTools: Attach all Service Workers except for old redundant ones. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated pfeldman'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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_MANAGER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_MANAGER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 16 matching lines...) Expand all
27 class CONTENT_EXPORT ServiceWorkerDevToolsManager { 27 class CONTENT_EXPORT ServiceWorkerDevToolsManager {
28 public: 28 public:
29 using WorkerId = std::pair<int, int>; 29 using WorkerId = std::pair<int, int>;
30 using AgentList = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; 30 using AgentList = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>;
31 31
32 class Observer { 32 class Observer {
33 public: 33 public:
34 virtual void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) {} 34 virtual void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) {}
35 virtual void WorkerReadyForInspection( 35 virtual void WorkerReadyForInspection(
36 ServiceWorkerDevToolsAgentHost* host) {} 36 ServiceWorkerDevToolsAgentHost* host) {}
37 virtual void WorkerVersionInstalled(ServiceWorkerDevToolsAgentHost* host) {}
38 virtual void WorkerVersionDoomed(ServiceWorkerDevToolsAgentHost* host) {}
37 virtual void WorkerDestroyed(ServiceWorkerDevToolsAgentHost* host) {} 39 virtual void WorkerDestroyed(ServiceWorkerDevToolsAgentHost* host) {}
38 40
39 protected: 41 protected:
40 virtual ~Observer() {} 42 virtual ~Observer() {}
41 }; 43 };
42 44
43 class ServiceWorkerIdentifier { 45 class ServiceWorkerIdentifier {
44 public: 46 public:
45 ServiceWorkerIdentifier( 47 ServiceWorkerIdentifier(
46 const ServiceWorkerContextCore* context, 48 const ServiceWorkerContextCore* context,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>* result); 80 std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>* result);
79 void AddAllAgentHostsForBrowserContext( 81 void AddAllAgentHostsForBrowserContext(
80 BrowserContext* browser_context, 82 BrowserContext* browser_context,
81 std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>* result); 83 std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>* result);
82 84
83 // Returns true when the worker must be paused on start because a DevTool 85 // Returns true when the worker must be paused on start because a DevTool
84 // window for the same former ServiceWorkerIdentifier is still opened or 86 // window for the same former ServiceWorkerIdentifier is still opened or
85 // debug-on-start is enabled in chrome://serviceworker-internals. 87 // debug-on-start is enabled in chrome://serviceworker-internals.
86 bool WorkerCreated(int worker_process_id, 88 bool WorkerCreated(int worker_process_id,
87 int worker_route_id, 89 int worker_route_id,
88 const ServiceWorkerIdentifier& service_worker_id); 90 const ServiceWorkerIdentifier& service_worker_id,
91 bool is_installed_version);
89 void WorkerReadyForInspection(int worker_process_id, int worker_route_id); 92 void WorkerReadyForInspection(int worker_process_id, int worker_route_id);
93 void WorkerVersionInstalled(int worker_process_id, int worker_route_id);
94 void WorkerVersionDoomed(int worker_process_id, int worker_route_id);
90 void WorkerStopIgnored(int worker_process_id, int worker_route_id); 95 void WorkerStopIgnored(int worker_process_id, int worker_route_id);
91 void WorkerDestroyed(int worker_process_id, int worker_route_id); 96 void WorkerDestroyed(int worker_process_id, int worker_route_id);
92 void RemoveInspectedWorkerData(WorkerId id); 97 void RemoveInspectedWorkerData(WorkerId id);
93 98
94 void AddObserver(Observer* observer); 99 void AddObserver(Observer* observer);
95 void RemoveObserver(Observer* observer); 100 void RemoveObserver(Observer* observer);
96 101
97 void set_debug_service_worker_on_start(bool debug_on_start); 102 void set_debug_service_worker_on_start(bool debug_on_start);
98 bool debug_service_worker_on_start() const { 103 bool debug_service_worker_on_start() const {
99 return debug_service_worker_on_start_; 104 return debug_service_worker_on_start_;
(...skipping 17 matching lines...) Expand all
117 base::ObserverList<Observer> observer_list_; 122 base::ObserverList<Observer> observer_list_;
118 AgentHostMap workers_; 123 AgentHostMap workers_;
119 bool debug_service_worker_on_start_; 124 bool debug_service_worker_on_start_;
120 125
121 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsManager); 126 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsManager);
122 }; 127 };
123 128
124 } // namespace content 129 } // namespace content
125 130
126 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_MANAGER_H_ 131 #endif // CONTENT_BROWSER_DEVTOOLS_SERVICE_WORKER_DEVTOOLS_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698