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

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

Issue 1408363004: [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 9297187f21c1778752372a2881912ab4c1bbe380..25a7e2dc723ea73bbd673b7935ba9b2510e81242 100644
--- a/content/browser/devtools/protocol/devtools_protocol_client.h
+++ b/content/browser/devtools/protocol/devtools_protocol_client.h
@@ -10,16 +10,20 @@
namespace content {
-using DevToolsCommandId = int;
-class DevToolsProtocolHandler;
+struct DevToolsCommandId {
+ static const int kNoId;
+ DevToolsCommandId(int call_id, int session_id)
+ : call_id(call_id), session_id(session_id) {}
+ DevToolsCommandId() : call_id(kNoId), session_id(kNoId) {}
dgozman 2015/11/07 02:28:40 Remove this constructor.
kozy 2015/11/07 03:02:35 Done.
+ int call_id;
+ int session_id;
+};
+class DevToolsProtocolDelegate;
dgozman 2015/11/07 02:28:40 nit: empty line before this please
kozy 2015/11/07 03:02:35 Done.
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();
@@ -48,10 +52,9 @@ class DevToolsProtocolClient {
// Sends message to client, the caller is presumed to properly
// format the message. Do not use unless you must.
- void SendRawMessage(const std::string& message);
+ void SendRawMessage(int session_id, const std::string& message);
dgozman 2015/11/07 02:28:40 Rename to SendRawNotification and remove session_i
kozy 2015/11/07 03:02:35 Done.
- explicit DevToolsProtocolClient(
- const RawMessageCallback& raw_message_callback);
+ explicit DevToolsProtocolClient(DevToolsProtocolDelegate* notifier);
virtual ~DevToolsProtocolClient();
protected:
@@ -63,9 +66,9 @@ class DevToolsProtocolClient {
private:
friend class DevToolsProtocolDispatcher;
- void SendMessage(const base::DictionaryValue& message);
+ void SendMessage(int session_id, const base::DictionaryValue& message);
- RawMessageCallback raw_message_callback_;
+ DevToolsProtocolDelegate* notifier_;
DISALLOW_COPY_AND_ASSIGN(DevToolsProtocolClient);
};

Powered by Google App Engine
This is Rietveld 408576698