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

Unified Diff: content/public/browser/devtools_agent_host.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 side-by-side diff with in-line comments
Download patch
Index: content/public/browser/devtools_agent_host.h
diff --git a/content/public/browser/devtools_agent_host.h b/content/public/browser/devtools_agent_host.h
index c4246508fb1b594bf7548c906147f0d8f4cdc07f..097684b276560b9a72d97420bfafbfcd112bee7c 100644
--- a/content/public/browser/devtools_agent_host.h
+++ b/content/public/browser/devtools_agent_host.h
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "content/common/content_export.h"
#include "content/public/browser/devtools_agent_host_client.h"
+#include "url/gurl.h"
namespace content {
@@ -23,6 +24,20 @@ class WebContents;
class CONTENT_EXPORT DevToolsAgentHost
: public base::RefCounted<DevToolsAgentHost> {
public:
+ enum Type {
+ // Agent host associated with WebContents.
+ AGENT_HOST_WEB_CONTENTS,
dgozman 2014/08/22 08:38:28 I'd say this should be TYPE_WEB_CONTENTS.
vkuzkokov 2014/08/22 11:01:48 Done.
+
+ // Agent host associated with shared worker.
+ AGENT_HOST_SHARED_WORKER,
+
+ // Agent host associated with service worker.
+ AGENT_HOST_SERVICE_WORKER,
+
+ // Agent host associated with DevToolsExternalAgentProxyDelegate.
+ AGENT_HOST_EXTERNAL,
+ };
+
// Returns DevToolsAgentHost with a given |id| or NULL of it does not exist.
static scoped_refptr<DevToolsAgentHost> GetForId(const std::string& id);
@@ -48,8 +63,10 @@ class CONTENT_EXPORT DevToolsAgentHost
static bool IsDebuggerAttached(WebContents* web_contents);
- // Returns a list of all existing WebContents that can be debugged.
- static std::vector<WebContents*> GetInspectableWebContents();
+ typedef std::vector<scoped_refptr<DevToolsAgentHost> > List;
+
+ // Returns all possible DevToolsAgentHosts.
+ static List GetOrCreateAll();
// Client attaches to this agent host to start debugging it.
virtual void AttachClient(DevToolsAgentHostClient* client) = 0;
@@ -82,6 +99,21 @@ class CONTENT_EXPORT DevToolsAgentHost
// Returns true if DevToolsAgentHost is for worker.
virtual bool IsWorker() const = 0;
+ // Returns agent host type.
+ virtual Type GetType() = 0;
+
+ // Returns agent host title.
+ virtual std::string GetTitle() = 0;
+
+ // Returns url associated with agent host.
+ virtual GURL GetURL() = 0;
+
+ // Activates agent host. Returns false if the operation failed.
+ virtual bool Activate() = 0;
+
+ // Closes agent host. Returns false if the operation failed.
+ virtual bool Close() = 0;
+
// Terminates all debugging sessions and detaches all clients.
static void DetachAllClients();

Powered by Google App Engine
This is Rietveld 408576698