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

Unified Diff: headless/public/headless_devtools_client.h

Issue 2812253002: Headless: Support sending and receiving of raw protocol messages (Closed)
Patch Set: Add ability to find render tree node id for devtools agent host ids Created 3 years, 8 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
Index: headless/public/headless_devtools_client.h
diff --git a/headless/public/headless_devtools_client.h b/headless/public/headless_devtools_client.h
index 573336af792ea6e3334851fbd1b648b85bf06476..ef10e5fab8613015b48bf250134ef16680ae9a6d 100644
--- a/headless/public/headless_devtools_client.h
+++ b/headless/public/headless_devtools_client.h
@@ -146,6 +146,31 @@ class HEADLESS_EXPORT HeadlessDevToolsClient {
virtual target::Domain* GetTarget() = 0;
virtual tracing::Domain* GetTracing() = 0;
+ class HEADLESS_EXPORT RawProtocolListener {
+ public:
+ RawProtocolListener() {}
+ virtual ~RawProtocolListener() {}
+
+ // Returns true if the listener handled the message.
+ virtual bool OnProtocolMessage(
+ const std::string& devtools_agent_host_id,
+ const std::string& json_message,
+ const base::DictionaryValue* parsed_message) = 0;
Sami 2017/04/19 15:24:43 nit: should |parsed_message| also be a const ref s
alex clarke (OOO till 29th) 2017/04/19 16:30:33 Done.
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RawProtocolListener);
+ };
+
+ virtual void SetRawProtocolListener(
+ RawProtocolListener* raw_protocol_listener) = 0;
+
+ // Generates an odd numbered ID.
+ virtual int GetNextRawDevToolsMessageId() = 0;
+
+ // The id within the message must be odd to prevent collisions.
+ virtual void SendRawDevToolsMessage(const std::string& json_message) = 0;
+ virtual void SendRawDevToolsMessage(const base::DictionaryValue* message) = 0;
+
// TODO(skyostil): Add notification for disconnection.
private:

Powered by Google App Engine
This is Rietveld 408576698