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

Unified Diff: content/browser/devtools/protocol/devtools_protocol_client.h

Issue 1437993003: Revert of [DevTools] Filter any messages from previous sessions in DevToolsAgentHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: content/browser/devtools/protocol/devtools_protocol_client.h
diff --git a/content/browser/devtools/protocol/devtools_protocol_client.h b/content/browser/devtools/protocol/devtools_protocol_client.h
index 780bc74aa7c32276816a260a66b0ebc292deb060..9297187f21c1778752372a2881912ab4c1bbe380 100644
--- a/content/browser/devtools/protocol/devtools_protocol_client.h
+++ b/content/browser/devtools/protocol/devtools_protocol_client.h
@@ -10,22 +10,16 @@
namespace content {
-struct DevToolsCommandId {
- static const int kNoId;
-
- DevToolsCommandId(int call_id, int session_id)
- : call_id(call_id), session_id(session_id) {}
-
- int call_id;
- int session_id;
-};
-
-class DevToolsProtocolDelegate;
+using DevToolsCommandId = int;
+class DevToolsProtocolHandler;
class DevToolsProtocolDispatcher;
-class DevToolsProtocolHandler;
class DevToolsProtocolClient {
public:
+ typedef base::Callback<void(const std::string& message)>
+ RawMessageCallback;
+ static const DevToolsCommandId kNoId;
+
struct Response {
public:
static Response FallThrough();
@@ -52,13 +46,12 @@
bool SendError(DevToolsCommandId command_id,
const Response& response);
- // Sends notification to client, the caller is presumed to properly
+ // Sends message to client, the caller is presumed to properly
// format the message. Do not use unless you must.
- void SendRawNotification(const std::string& message);
+ void SendRawMessage(const std::string& message);
- void SendMessage(int session_id, const base::DictionaryValue& message);
-
- explicit DevToolsProtocolClient(DevToolsProtocolDelegate* notifier);
+ explicit DevToolsProtocolClient(
+ const RawMessageCallback& raw_message_callback);
virtual ~DevToolsProtocolClient();
protected:
@@ -70,7 +63,9 @@
private:
friend class DevToolsProtocolDispatcher;
- DevToolsProtocolDelegate* notifier_;
+ void SendMessage(const base::DictionaryValue& message);
+
+ RawMessageCallback raw_message_callback_;
DISALLOW_COPY_AND_ASSIGN(DevToolsProtocolClient);
};
« no previous file with comments | « content/browser/devtools/forwarding_agent_host.cc ('k') | content/browser/devtools/protocol/devtools_protocol_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698