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

Unified Diff: content/browser/devtools/protocol/inspector_handler.cc

Issue 2548263002: [DevTools] Migrate dom, emulation, inspector, network, page and schema handlers to new generator. (Closed)
Patch Set: rebased atop of roll Created 4 years 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/browser/devtools/protocol/inspector_handler.cc
diff --git a/content/browser/devtools/protocol/inspector_handler.cc b/content/browser/devtools/protocol/inspector_handler.cc
index 8777c6a8f475599f327df1b0bb722004b48052fe..b333315337a50bc573cedbc2ab37f8a37d0cffc7 100644
--- a/content/browser/devtools/protocol/inspector_handler.cc
+++ b/content/browser/devtools/protocol/inspector_handler.cc
@@ -7,10 +7,7 @@
#include "content/browser/frame_host/render_frame_host_impl.h"
namespace content {
-namespace devtools {
-namespace inspector {
-
-using Response = DevToolsProtocolClient::Response;
+namespace protocol {
InspectorHandler::InspectorHandler()
: host_(nullptr) {
@@ -19,8 +16,9 @@ InspectorHandler::InspectorHandler()
InspectorHandler::~InspectorHandler() {
}
-void InspectorHandler::SetClient(std::unique_ptr<Client> client) {
- client_.swap(client);
+void InspectorHandler::Wire(UberDispatcher* dispatcher) {
+ frontend_.reset(new Inspector::Frontend(dispatcher->channel()));
+ Inspector::Dispatcher::wire(dispatcher, this);
}
void InspectorHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
@@ -28,16 +26,16 @@ void InspectorHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
}
void InspectorHandler::TargetCrashed() {
- client_->TargetCrashed(TargetCrashedParams::Create());
+ frontend_->TargetCrashed();
}
void InspectorHandler::TargetDetached(const std::string& reason) {
- client_->Detached(DetachedParams::Create()->set_reason(reason));
+ frontend_->Detached(reason);
}
Response InspectorHandler::Enable() {
if (host_ && !host_->IsRenderFrameLive())
- client_->TargetCrashed(TargetCrashedParams::Create());
+ frontend_->TargetCrashed();
return Response::OK();
}
@@ -45,6 +43,5 @@ Response InspectorHandler::Disable() {
return Response::OK();
}
-} // namespace inspector
-} // namespace devtools
+} // namespace protocol
} // namespace content
« no previous file with comments | « content/browser/devtools/protocol/inspector_handler.h ('k') | content/browser/devtools/protocol/network_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698