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

Unified Diff: content/browser/devtools/devtools_manager.cc

Issue 2300703005: DevTools: merge devtools_http_handler into content - it is used in all the embedders anyways. (Closed)
Patch Set: for_landing! Created 4 years, 3 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
« no previous file with comments | « content/browser/devtools/devtools_manager.h ('k') | content/browser/devtools/devtools_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/devtools_manager.cc
diff --git a/content/browser/devtools/devtools_manager.cc b/content/browser/devtools/devtools_manager.cc
index d4889002d9f3f70d038c46c921f289f7647d99d6..70059c6f251b0ac8fe56d3ea1301d41a18db70ab 100644
--- a/content/browser/devtools/devtools_manager.cc
+++ b/content/browser/devtools/devtools_manager.cc
@@ -5,15 +5,41 @@
#include "content/browser/devtools/devtools_manager.h"
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "content/browser/devtools/devtools_agent_host_impl.h"
+#include "content/browser/devtools/devtools_http_handler.h"
#include "content/browser/loader/netlog_observer.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
+#include "content/public/browser/devtools_socket_factory.h"
namespace content {
// static
+void DevToolsAgentHost::StartRemoteDebuggingServer(
+ std::unique_ptr<DevToolsSocketFactory> server_socket_factory,
+ const std::string& frontend_url,
+ const base::FilePath& active_port_output_directory,
+ const base::FilePath& debug_frontend_dir,
+ const std::string& product_name,
+ const std::string& user_agent) {
+ DevToolsManager* manager = DevToolsManager::GetInstance();
+ if (!manager->delegate())
+ return;
+ manager->SetHttpHandler(base::WrapUnique(new DevToolsHttpHandler(
+ manager->delegate(), std::move(server_socket_factory), frontend_url,
+ active_port_output_directory, debug_frontend_dir, product_name,
+ user_agent)));
+}
+
+// static
+void DevToolsAgentHost::StopRemoteDebuggingServer() {
+ DevToolsManager* manager = DevToolsManager::GetInstance();
+ manager->SetHttpHandler(nullptr);
+}
+
+// static
DevToolsManager* DevToolsManager::GetInstance() {
return base::Singleton<DevToolsManager>::get();
}
@@ -49,4 +75,9 @@ void DevToolsManager::AgentHostStateChanged(
}
}
+void DevToolsManager::SetHttpHandler(
+ std::unique_ptr<DevToolsHttpHandler> http_handler) {
+ http_handler_ = std::move(http_handler);
+}
+
} // namespace content
« no previous file with comments | « content/browser/devtools/devtools_manager.h ('k') | content/browser/devtools/devtools_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698