| 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 #include "content/browser/devtools/protocol/forward.h" | 5 #include "content/browser/devtools/protocol/protocol.h" |
| 6 | 6 |
| 7 namespace content { | 7 namespace content { |
| 8 | 8 |
| 9 class DevToolsAgentHostImpl; | 9 class DevToolsAgentHostImpl; |
| 10 | 10 |
| 11 class DevToolsSession : public protocol::FrontendChannel { | 11 class DevToolsSession : public protocol::FrontendChannel { |
| 12 public: | 12 public: |
| 13 DevToolsSession(DevToolsAgentHostImpl* agent_host, int session_id); | 13 DevToolsSession(DevToolsAgentHostImpl* agent_host, int session_id); |
| 14 ~DevToolsSession() override; | 14 ~DevToolsSession() override; |
| 15 | 15 |
| 16 void ResetDispatcher(); | 16 void ResetDispatcher(); |
| 17 protocol::Response::Status Dispatch( |
| 18 const std::string& message, |
| 19 int* call_id, |
| 20 std::string* method); |
| 17 | 21 |
| 18 int session_id() { return session_id_; } | 22 int session_id() { return session_id_; } |
| 19 protocol::UberDispatcher* dispatcher() { return dispatcher_.get(); } | 23 protocol::UberDispatcher* dispatcher() { return dispatcher_.get(); } |
| 20 | 24 |
| 21 private: | 25 private: |
| 22 // protocol::FrontendChannel implementation. | 26 // protocol::FrontendChannel implementation. |
| 23 void sendProtocolResponse( | 27 void sendProtocolResponse( |
| 24 int call_id, | 28 int call_id, |
| 25 std::unique_ptr<protocol::Serializable> message) override; | 29 std::unique_ptr<protocol::Serializable> message) override; |
| 26 void sendProtocolNotification( | 30 void sendProtocolNotification( |
| 27 std::unique_ptr<protocol::Serializable> message) override; | 31 std::unique_ptr<protocol::Serializable> message) override; |
| 28 void flushProtocolNotifications() override; | 32 void flushProtocolNotifications() override; |
| 29 | 33 |
| 30 DevToolsAgentHostImpl* agent_host_; | 34 DevToolsAgentHostImpl* agent_host_; |
| 31 int session_id_; | 35 int session_id_; |
| 32 std::unique_ptr<protocol::UberDispatcher> dispatcher_; | 36 std::unique_ptr<protocol::UberDispatcher> dispatcher_; |
| 33 }; | 37 }; |
| 34 | 38 |
| 35 } // namespace content | 39 } // namespace content |
| OLD | NEW |