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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/browser/devtools/protocol/inspector_handler.h" 5 #include "content/browser/devtools/protocol/inspector_handler.h"
6 6
7 #include "content/browser/frame_host/render_frame_host_impl.h" 7 #include "content/browser/frame_host/render_frame_host_impl.h"
8 8
9 namespace content { 9 namespace content {
10 namespace devtools { 10 namespace protocol {
11 namespace inspector {
12
13 using Response = DevToolsProtocolClient::Response;
14 11
15 InspectorHandler::InspectorHandler() 12 InspectorHandler::InspectorHandler()
16 : host_(nullptr) { 13 : host_(nullptr) {
17 } 14 }
18 15
19 InspectorHandler::~InspectorHandler() { 16 InspectorHandler::~InspectorHandler() {
20 } 17 }
21 18
22 void InspectorHandler::SetClient(std::unique_ptr<Client> client) { 19 void InspectorHandler::Wire(UberDispatcher* dispatcher) {
23 client_.swap(client); 20 frontend_.reset(new Inspector::Frontend(dispatcher->channel()));
21 Inspector::Dispatcher::wire(dispatcher, this);
24 } 22 }
25 23
26 void InspectorHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { 24 void InspectorHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
27 host_ = host; 25 host_ = host;
28 } 26 }
29 27
30 void InspectorHandler::TargetCrashed() { 28 void InspectorHandler::TargetCrashed() {
31 client_->TargetCrashed(TargetCrashedParams::Create()); 29 frontend_->TargetCrashed();
32 } 30 }
33 31
34 void InspectorHandler::TargetDetached(const std::string& reason) { 32 void InspectorHandler::TargetDetached(const std::string& reason) {
35 client_->Detached(DetachedParams::Create()->set_reason(reason)); 33 frontend_->Detached(reason);
36 } 34 }
37 35
38 Response InspectorHandler::Enable() { 36 Response InspectorHandler::Enable() {
39 if (host_ && !host_->IsRenderFrameLive()) 37 if (host_ && !host_->IsRenderFrameLive())
40 client_->TargetCrashed(TargetCrashedParams::Create()); 38 frontend_->TargetCrashed();
41 return Response::OK(); 39 return Response::OK();
42 } 40 }
43 41
44 Response InspectorHandler::Disable() { 42 Response InspectorHandler::Disable() {
45 return Response::OK(); 43 return Response::OK();
46 } 44 }
47 45
48 } // namespace inspector 46 } // namespace protocol
49 } // namespace devtools
50 } // namespace content 47 } // namespace content
OLDNEW
« 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