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

Unified Diff: content/browser/devtools/devtools_session.h

Issue 2933243002: [DevTools] Make DevToolsSession own it's DevToolsMessageChunkProcessor (Closed)
Patch Set: addressed comments Created 3 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/devtools/devtools_agent_host_impl.h ('k') | content/browser/devtools/devtools_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
};
« no previous file with comments | « content/browser/devtools/devtools_agent_host_impl.h ('k') | content/browser/devtools/devtools_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698