| Index: content/browser/devtools/devtools_session.h
|
| diff --git a/content/browser/devtools/devtools_session.h b/content/browser/devtools/devtools_session.h
|
| index 24909914ef6d85da6de94b6494cfd3af3dc23198..88d91d29a1b54303c12941050b610eab1e303b71 100644
|
| --- a/content/browser/devtools/devtools_session.h
|
| +++ b/content/browser/devtools/devtools_session.h
|
| @@ -5,6 +5,8 @@
|
| #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_SESSION_H_
|
| #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_SESSION_H_
|
|
|
| +#include <map>
|
| +
|
| #include "base/containers/flat_map.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/values.h"
|
| @@ -29,10 +31,19 @@ class DevToolsSession : public protocol::FrontendChannel {
|
| void SetRenderFrameHost(RenderFrameHostImpl* host);
|
| void SetFallThroughForNotFound(bool value);
|
|
|
| + struct Message {
|
| + std::string method;
|
| + std::string message;
|
| + };
|
| + using MessageByCallId = std::map<int, Message>;
|
| + MessageByCallId& waiting_messages() { return waiting_for_response_messages_; }
|
| + const std::string& state_cookie() { return chunk_processor_.state_cookie(); }
|
| +
|
| protocol::Response::Status Dispatch(
|
| const std::string& message,
|
| int* call_id,
|
| std::string* method);
|
| + bool ReceiveMessageChunk(const DevToolsMessageChunk& chunk);
|
|
|
| // Only used by DevToolsAgentHostImpl.
|
| DevToolsAgentHostClient* client() const { return client_; }
|
| @@ -53,7 +64,9 @@ class DevToolsSession : public protocol::FrontendChannel {
|
| }
|
|
|
| private:
|
| - void sendResponse(std::unique_ptr<base::DictionaryValue> response);
|
| + void SendMessageToClient(int session_id, const std::string& message);
|
| + void SendResponse(std::unique_ptr<base::DictionaryValue> response);
|
| +
|
| // protocol::FrontendChannel implementation.
|
| void sendProtocolResponse(
|
| int call_id,
|
| @@ -69,6 +82,10 @@ class DevToolsSession : public protocol::FrontendChannel {
|
| handlers_;
|
| RenderFrameHostImpl* host_;
|
| std::unique_ptr<protocol::UberDispatcher> dispatcher_;
|
| + // Chunk processor's state cookie always corresponds to a state before
|
| + // any of the waiting for response messages have been handled.
|
| + DevToolsMessageChunkProcessor chunk_processor_;
|
| + MessageByCallId waiting_for_response_messages_;
|
|
|
| base::WeakPtrFactory<DevToolsSession> weak_factory_;
|
| };
|
|
|