| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_UI_DEVTOOLS_DEVTOOLS_SERVER_H_ | 5 #ifndef COMPONENTS_UI_DEVTOOLS_DEVTOOLS_SERVER_H_ |
| 6 #define COMPONENTS_UI_DEVTOOLS_DEVTOOLS_SERVER_H_ | 6 #define COMPONENTS_UI_DEVTOOLS_DEVTOOLS_SERVER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
| 13 #include "components/ui_devtools/DOM.h" | 13 #include "components/ui_devtools/DOM.h" |
| 14 #include "components/ui_devtools/Forward.h" | 14 #include "components/ui_devtools/Forward.h" |
| 15 #include "components/ui_devtools/Protocol.h" | 15 #include "components/ui_devtools/Protocol.h" |
| 16 #include "components/ui_devtools/devtools_client.h" | 16 #include "components/ui_devtools/devtools_client.h" |
| 17 #include "components/ui_devtools/devtools_export.h" |
| 17 #include "components/ui_devtools/string_util.h" | 18 #include "components/ui_devtools/string_util.h" |
| 18 #include "net/server/http_server.h" | 19 #include "net/server/http_server.h" |
| 19 | 20 |
| 20 namespace ui { | 21 namespace ui { |
| 21 namespace devtools { | 22 namespace devtools { |
| 22 | 23 |
| 23 class UiDevToolsServer : public net::HttpServer::Delegate { | 24 class UI_DEVTOOLS_EXPORT UiDevToolsServer |
| 25 : public NON_EXPORTED_BASE(net::HttpServer::Delegate) { |
| 24 public: | 26 public: |
| 25 ~UiDevToolsServer() override; | 27 ~UiDevToolsServer() override; |
| 26 | 28 |
| 27 // Returns an empty unique_ptr if ui devtools flag isn't enabled or if a | 29 // Returns an empty unique_ptr if ui devtools flag isn't enabled or if a |
| 28 // server instance has already been created. | 30 // server instance has already been created. |
| 29 static std::unique_ptr<UiDevToolsServer> Create( | 31 static std::unique_ptr<UiDevToolsServer> Create( |
| 30 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner); | 32 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner); |
| 31 | 33 |
| 32 // Returns a list of attached UiDevToolsClient name + URL | 34 // Returns a list of attached UiDevToolsClient name + URL |
| 33 using NameUrlPair = std::pair<std::string, std::string>; | 35 using NameUrlPair = std::pair<std::string, std::string>; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // The server (owned by ash for now) | 67 // The server (owned by ash for now) |
| 66 static UiDevToolsServer* devtools_server_; | 68 static UiDevToolsServer* devtools_server_; |
| 67 | 69 |
| 68 DISALLOW_COPY_AND_ASSIGN(UiDevToolsServer); | 70 DISALLOW_COPY_AND_ASSIGN(UiDevToolsServer); |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 } // namespace devtools | 73 } // namespace devtools |
| 72 } // namespace ui | 74 } // namespace ui |
| 73 | 75 |
| 74 #endif // COMPONENTS_UI_DEVTOOLS_DEVTOOLS_SERVER_H_ | 76 #endif // COMPONENTS_UI_DEVTOOLS_DEVTOOLS_SERVER_H_ |
| OLD | NEW |