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

Unified Diff: components/ui_devtools/devtools_server.h

Issue 2502863002: Add UI DevTools under chrome://inspect/#other (Closed)
Patch Set: feedback Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/webui/inspect_ui.cc ('k') | components/ui_devtools/devtools_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ui_devtools/devtools_server.h
diff --git a/components/ui_devtools/devtools_server.h b/components/ui_devtools/devtools_server.h
index b101ed1c1b8c23a786850484a2de146e36503ce2..73a8ae411d1b9bdb8ffef46bdd046c86edca96fb 100644
--- a/components/ui_devtools/devtools_server.h
+++ b/components/ui_devtools/devtools_server.h
@@ -7,25 +7,33 @@
#include <vector>
+#include "base/compiler_specific.h"
#include "base/threading/thread.h"
#include "components/ui_devtools/DOM.h"
#include "components/ui_devtools/Forward.h"
#include "components/ui_devtools/Protocol.h"
#include "components/ui_devtools/devtools_client.h"
+#include "components/ui_devtools/devtools_export.h"
#include "components/ui_devtools/string_util.h"
#include "net/server/http_server.h"
namespace ui {
namespace devtools {
-class UiDevToolsServer : public net::HttpServer::Delegate {
+class UI_DEVTOOLS_EXPORT UiDevToolsServer
+ : public NON_EXPORTED_BASE(net::HttpServer::Delegate) {
public:
~UiDevToolsServer() override;
- // Returns an empty unique_ptr if ui devtools flag isn't enabled.
+ // Returns an empty unique_ptr if ui devtools flag isn't enabled or if a
+ // server instance has already been created.
static std::unique_ptr<UiDevToolsServer> Create(
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
+ // Returns a list of attached UiDevToolsClient name + URL
+ using NameUrlPair = std::pair<std::string, std::string>;
+ static std::vector<NameUrlPair> GetClientNamesAndUrls();
+
void AttachClient(std::unique_ptr<UiDevToolsClient> client);
void SendOverWebSocket(int connection_id, const String& message);
@@ -54,6 +62,9 @@ class UiDevToolsServer : public net::HttpServer::Delegate {
std::unique_ptr<net::HttpServer> server_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ // The server (owned by ash for now)
+ static UiDevToolsServer* devtools_server_;
+
DISALLOW_COPY_AND_ASSIGN(UiDevToolsServer);
};
« no previous file with comments | « chrome/browser/ui/webui/inspect_ui.cc ('k') | components/ui_devtools/devtools_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698