Index: content/public/browser/devtools_http_handler_delegate.h |
diff --git a/content/public/browser/devtools_http_handler_delegate.h b/content/public/browser/devtools_http_handler_delegate.h |
index 3e1d6412820eb17923b1b366d2b8eb33d1b42c1c..544d9f4af8c57ee4df1710395dca699d914fdd14 100644 |
--- a/content/public/browser/devtools_http_handler_delegate.h |
+++ b/content/public/browser/devtools_http_handler_delegate.h |
@@ -9,23 +9,21 @@ |
#include <vector> |
#include "base/files/file_path.h" |
+#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
+#include "content/public/browser/devtools_agent_host.h" |
+#include "content/public/browser/devtools_target.h" |
#include "net/socket/stream_listen_socket.h" |
class GURL; |
namespace content { |
-class RenderViewHost; |
- |
-class DevToolsHttpHandlerDelegate { |
+class DevToolsHttpHandlerDelegate |
+ : public base::RefCountedThreadSafe<DevToolsHttpHandlerDelegate> { |
pfeldman
2013/10/01 14:10:24
Could we keep it raw?
Vladislav Kaznacheev
2013/10/01 15:00:16
Done.
|
public: |
- enum TargetType { |
- kTargetTypeTab = 0, |
- kTargetTypeOther, |
- }; |
- |
- virtual ~DevToolsHttpHandlerDelegate() {} |
+ typedef std::vector<scoped_refptr<DevToolsTarget> > TargetList; |
+ typedef base::Callback<void(const TargetList&)> TargetCallback; |
// Should return discovery page HTML that should list available tabs |
// and provide attach links. |
@@ -41,20 +39,22 @@ class DevToolsHttpHandlerDelegate { |
// thumbnail. |
virtual std::string GetPageThumbnailData(const GURL& url) = 0; |
- // Creates new inspectable target and returns its render view host. |
- virtual RenderViewHost* CreateNewTarget() = 0; |
- |
- // Returns the type of the target. |
- virtual TargetType GetTargetType(RenderViewHost*) = 0; |
+ // Creates new inspectable target. |
+ virtual scoped_refptr<DevToolsTarget> CreateNewTarget() = 0; |
- // Provides the delegate with an ability to supply a description for views. |
- virtual std::string GetViewDescription(content::RenderViewHost*) = 0; |
+ // Requests the list of all inspectable targets. |
+ virtual void EnumerateTargets(TargetCallback callback) = 0; |
// Creates named socket for reversed tethering implementation (used with |
// remote debugging, primarily for mobile). |
virtual scoped_ptr<net::StreamListenSocket> CreateSocketForTethering( |
net::StreamListenSocket::Delegate* delegate, |
std::string* name) = 0; |
+ |
+ protected: |
+ friend class base::RefCountedThreadSafe<DevToolsHttpHandlerDelegate>; |
+ |
+ virtual ~DevToolsHttpHandlerDelegate() {} |
}; |
} // namespace content |