| OLD | NEW |
| 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/browser_devtools_agent_host.h" | 5 #include "content/browser/devtools/browser_devtools_agent_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/browser/devtools/devtools_protocol_handler.h" | 8 #include "content/browser/devtools/devtools_protocol_handler.h" |
| 9 #include "content/browser/devtools/protocol/io_handler.h" | 9 #include "content/browser/devtools/protocol/io_handler.h" |
| 10 #include "content/browser/devtools/protocol/memory_handler.h" | 10 #include "content/browser/devtools/protocol/memory_handler.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 scoped_refptr<base::SingleThreadTaskRunner> tethering_task_runner, | 24 scoped_refptr<base::SingleThreadTaskRunner> tethering_task_runner, |
| 25 const CreateServerSocketCallback& socket_callback) | 25 const CreateServerSocketCallback& socket_callback) |
| 26 : io_handler_(new devtools::io::IOHandler(GetIOContext())), | 26 : io_handler_(new devtools::io::IOHandler(GetIOContext())), |
| 27 memory_handler_(new devtools::memory::MemoryHandler()), | 27 memory_handler_(new devtools::memory::MemoryHandler()), |
| 28 system_info_handler_(new devtools::system_info::SystemInfoHandler()), | 28 system_info_handler_(new devtools::system_info::SystemInfoHandler()), |
| 29 tethering_handler_( | 29 tethering_handler_( |
| 30 new devtools::tethering::TetheringHandler(socket_callback, | 30 new devtools::tethering::TetheringHandler(socket_callback, |
| 31 tethering_task_runner)), | 31 tethering_task_runner)), |
| 32 tracing_handler_(new devtools::tracing::TracingHandler( | 32 tracing_handler_(new devtools::tracing::TracingHandler( |
| 33 devtools::tracing::TracingHandler::Browser, GetIOContext())), | 33 devtools::tracing::TracingHandler::Browser, GetIOContext())), |
| 34 protocol_handler_(new DevToolsProtocolHandler( | 34 protocol_handler_(new DevToolsProtocolHandler(this)) { |
| 35 this, | |
| 36 base::Bind(&BrowserDevToolsAgentHost::SendMessageToClient, | |
| 37 base::Unretained(this)))) { | |
| 38 DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher(); | 35 DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher(); |
| 39 dispatcher->SetIOHandler(io_handler_.get()); | 36 dispatcher->SetIOHandler(io_handler_.get()); |
| 40 dispatcher->SetMemoryHandler(memory_handler_.get()); | 37 dispatcher->SetMemoryHandler(memory_handler_.get()); |
| 41 dispatcher->SetSystemInfoHandler(system_info_handler_.get()); | 38 dispatcher->SetSystemInfoHandler(system_info_handler_.get()); |
| 42 dispatcher->SetTetheringHandler(tethering_handler_.get()); | 39 dispatcher->SetTetheringHandler(tethering_handler_.get()); |
| 43 dispatcher->SetTracingHandler(tracing_handler_.get()); | 40 dispatcher->SetTracingHandler(tracing_handler_.get()); |
| 44 } | 41 } |
| 45 | 42 |
| 46 BrowserDevToolsAgentHost::~BrowserDevToolsAgentHost() { | 43 BrowserDevToolsAgentHost::~BrowserDevToolsAgentHost() { |
| 47 } | 44 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 67 bool BrowserDevToolsAgentHost::Activate() { | 64 bool BrowserDevToolsAgentHost::Activate() { |
| 68 return false; | 65 return false; |
| 69 } | 66 } |
| 70 | 67 |
| 71 bool BrowserDevToolsAgentHost::Close() { | 68 bool BrowserDevToolsAgentHost::Close() { |
| 72 return false; | 69 return false; |
| 73 } | 70 } |
| 74 | 71 |
| 75 bool BrowserDevToolsAgentHost::DispatchProtocolMessage( | 72 bool BrowserDevToolsAgentHost::DispatchProtocolMessage( |
| 76 const std::string& message) { | 73 const std::string& message) { |
| 77 protocol_handler_->HandleMessage(message); | 74 protocol_handler_->HandleMessage(session_id(), message); |
| 78 return true; | 75 return true; |
| 79 } | 76 } |
| 80 | 77 |
| 81 } // content | 78 } // content |
| OLD | NEW |