| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 static int s_attached_count_; | 84 static int s_attached_count_; |
| 85 static int s_force_creation_count_; | 85 static int s_force_creation_count_; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 class DevToolsMessageChunkProcessor { | 88 class DevToolsMessageChunkProcessor { |
| 89 public: | 89 public: |
| 90 using SendMessageCallback = base::Callback<void(int, const std::string&)>; | 90 using SendMessageCallback = base::Callback<void(int, const std::string&)>; |
| 91 explicit DevToolsMessageChunkProcessor(const SendMessageCallback& callback); | 91 explicit DevToolsMessageChunkProcessor(const SendMessageCallback& callback); |
| 92 ~DevToolsMessageChunkProcessor(); | 92 ~DevToolsMessageChunkProcessor(); |
| 93 | 93 |
| 94 std::string state_cookie() const { return state_cookie_; } | 94 const std::string& state_cookie() const { return state_cookie_; } |
| 95 void set_state_cookie(const std::string& cookie) { state_cookie_ = cookie; } | 95 void set_state_cookie(const std::string& cookie) { state_cookie_ = cookie; } |
| 96 int last_call_id() const { return last_call_id_; } | 96 int last_call_id() const { return last_call_id_; } |
| 97 bool ProcessChunkedMessageFromAgent(const DevToolsMessageChunk& chunk); | 97 bool ProcessChunkedMessageFromAgent(const DevToolsMessageChunk& chunk); |
| 98 void Reset(); | 98 void Reset(); |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 SendMessageCallback callback_; | 101 SendMessageCallback callback_; |
| 102 std::string message_buffer_; | 102 std::string message_buffer_; |
| 103 uint32_t message_buffer_size_; | 103 uint32_t message_buffer_size_; |
| 104 std::string state_cookie_; | 104 std::string state_cookie_; |
| 105 int last_call_id_; | 105 int last_call_id_; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 } // namespace content | 108 } // namespace content |
| 109 | 109 |
| 110 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ | 110 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ |
| OLD | NEW |