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

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

Issue 459403002: DevTools: Added service workers to remote debugging targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made DevToolsAgentHost::GetType return enum Created 6 years, 4 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_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"
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/memory/scoped_vector.h" 12 #include "base/memory/scoped_vector.h"
13 #include "base/memory/singleton.h" 13 #include "base/memory/singleton.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "content/browser/shared_worker/shared_worker_instance.h" 16 #include "content/browser/shared_worker/shared_worker_instance.h"
17 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
18 18
19 namespace content { 19 namespace content {
20 20
21 class DevToolsAgentHost;
21 class DevToolsAgentHostImpl; 22 class DevToolsAgentHostImpl;
22 class EmbeddedWorkerDevToolsAgentHost; 23 class EmbeddedWorkerDevToolsAgentHost;
23 class ServiceWorkerContextCore; 24 class ServiceWorkerContextCore;
24 25
25 // EmbeddedWorkerDevToolsManager is used instead of WorkerDevToolsManager when 26 // EmbeddedWorkerDevToolsManager is used instead of WorkerDevToolsManager when
26 // "enable-embedded-shared-worker" flag is set. 27 // "enable-embedded-shared-worker" flag is set.
27 // This class lives on UI thread. 28 // This class lives on UI thread.
28 class CONTENT_EXPORT EmbeddedWorkerDevToolsManager { 29 class CONTENT_EXPORT EmbeddedWorkerDevToolsManager {
29 public: 30 public:
30 typedef std::pair<int, int> WorkerId; 31 typedef std::pair<int, int> WorkerId;
(...skipping 21 matching lines...) Expand all
52 const int64 version_id_; 53 const int64 version_id_;
53 const GURL url_; 54 const GURL url_;
54 }; 55 };
55 56
56 // Returns the EmbeddedWorkerDevToolsManager singleton. 57 // Returns the EmbeddedWorkerDevToolsManager singleton.
57 static EmbeddedWorkerDevToolsManager* GetInstance(); 58 static EmbeddedWorkerDevToolsManager* GetInstance();
58 59
59 DevToolsAgentHostImpl* GetDevToolsAgentHostForWorker(int worker_process_id, 60 DevToolsAgentHostImpl* GetDevToolsAgentHostForWorker(int worker_process_id,
60 int worker_route_id); 61 int worker_route_id);
61 62
63 std::vector<scoped_refptr<DevToolsAgentHost> > GetOrCreateAllAgentHosts();
64
62 // Returns true when the worker must be paused on start because a DevTool 65 // Returns true when the worker must be paused on start because a DevTool
63 // window for the same former SharedWorkerInstance is still opened. 66 // window for the same former SharedWorkerInstance is still opened.
64 bool SharedWorkerCreated(int worker_process_id, 67 bool SharedWorkerCreated(int worker_process_id,
65 int worker_route_id, 68 int worker_route_id,
66 const SharedWorkerInstance& instance); 69 const SharedWorkerInstance& instance);
67 // Returns true when the worker must be paused on start because a DevTool 70 // Returns true when the worker must be paused on start because a DevTool
68 // window for the same former ServiceWorkerIdentifier is still opened or 71 // window for the same former ServiceWorkerIdentifier is still opened or
69 // debug-on-start is enabled in chrome://serviceworker-internals. 72 // debug-on-start is enabled in chrome://serviceworker-internals.
70 bool ServiceWorkerCreated(int worker_process_id, 73 bool ServiceWorkerCreated(int worker_process_id,
71 int worker_route_id, 74 int worker_route_id,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 AgentHostMap workers_; 110 AgentHostMap workers_;
108 111
109 bool debug_service_worker_on_start_; 112 bool debug_service_worker_on_start_;
110 113
111 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDevToolsManager); 114 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDevToolsManager);
112 }; 115 };
113 116
114 } // namespace content 117 } // namespace content
115 118
116 #endif // CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_ 119 #endif // CONTENT_BROWSER_DEVTOOLS_EMBEDDED_WORKER_DEVTOOLS_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698