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

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

Issue 761923004: Keep alive ServiceWorkers when devtools is attached (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comments Created 6 years 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_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 const ServiceWorkerIdentifier& service_worker_id); 75 const ServiceWorkerIdentifier& service_worker_id);
76 void WorkerReadyForInspection(int worker_process_id, int worker_route_id); 76 void WorkerReadyForInspection(int worker_process_id, int worker_route_id);
77 void WorkerDestroyed(int worker_process_id, int worker_route_id); 77 void WorkerDestroyed(int worker_process_id, int worker_route_id);
78 78
79 void set_debug_service_worker_on_start(bool debug_on_start) { 79 void set_debug_service_worker_on_start(bool debug_on_start) {
80 debug_service_worker_on_start_ = debug_on_start; 80 debug_service_worker_on_start_ = debug_on_start;
81 } 81 }
82 bool debug_service_worker_on_start() const { 82 bool debug_service_worker_on_start() const {
83 return debug_service_worker_on_start_; 83 return debug_service_worker_on_start_;
84 } 84 }
85 void set_keep_alive_service_workers(bool keep_alive_mode) {
86 keep_alive_service_workers_ = keep_alive_mode;
87 }
88 bool keep_alive_service_workers() const {
89 return keep_alive_service_workers_;
90 }
85 91
86 private: 92 private:
87 friend struct DefaultSingletonTraits<EmbeddedWorkerDevToolsManager>; 93 friend struct DefaultSingletonTraits<EmbeddedWorkerDevToolsManager>;
88 friend class EmbeddedWorkerDevToolsAgentHost; 94 friend class EmbeddedWorkerDevToolsAgentHost;
89 friend class EmbeddedWorkerDevToolsManagerTest; 95 friend class EmbeddedWorkerDevToolsManagerTest;
90 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerDevToolsManagerTest, BasicTest); 96 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerDevToolsManagerTest, BasicTest);
91 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerDevToolsManagerTest, AttachTest); 97 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerDevToolsManagerTest, AttachTest);
92 98
93 typedef std::map<WorkerId, EmbeddedWorkerDevToolsAgentHost*> AgentHostMap; 99 typedef std::map<WorkerId, EmbeddedWorkerDevToolsAgentHost*> AgentHostMap;
94 100
95 EmbeddedWorkerDevToolsManager(); 101 EmbeddedWorkerDevToolsManager();
96 virtual ~EmbeddedWorkerDevToolsManager(); 102 virtual ~EmbeddedWorkerDevToolsManager();
97 103
98 void RemoveInspectedWorkerData(WorkerId id); 104 void RemoveInspectedWorkerData(WorkerId id);
99 105
100 AgentHostMap::iterator FindExistingSharedWorkerAgentHost( 106 AgentHostMap::iterator FindExistingSharedWorkerAgentHost(
101 const SharedWorkerInstance& instance); 107 const SharedWorkerInstance& instance);
102 AgentHostMap::iterator FindExistingServiceWorkerAgentHost( 108 AgentHostMap::iterator FindExistingServiceWorkerAgentHost(
103 const ServiceWorkerIdentifier& service_worker_id); 109 const ServiceWorkerIdentifier& service_worker_id);
104 110
105 void WorkerRestarted(const WorkerId& id, const AgentHostMap::iterator& it); 111 void WorkerRestarted(const WorkerId& id, const AgentHostMap::iterator& it);
106 112
107 // Resets to its initial state as if newly created. 113 // Resets to its initial state as if newly created.
108 void ResetForTesting(); 114 void ResetForTesting();
109 115
110 AgentHostMap workers_; 116 AgentHostMap workers_;
111 117
112 bool debug_service_worker_on_start_; 118 bool debug_service_worker_on_start_;
119 bool keep_alive_service_workers_;
113 120
114 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDevToolsManager); 121 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDevToolsManager);
115 }; 122 };
116 123
117 } // namespace content 124 } // namespace content
118 125
119 #endif // CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_ 126 #endif // CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698