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

Unified Diff: headless/public/headless_devtools_client.h

Issue 2812253002: Headless: Support sending and receiving of raw protocol messages (Closed)
Patch Set: Fix tests 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
« no previous file with comments | « headless/lib/headless_devtools_client_browsertest.cc ('k') | headless/public/headless_web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7e7d97982c5c02bda5a925cf7be8a455384f90e9 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;
+
+ 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:
« no previous file with comments | « headless/lib/headless_devtools_client_browsertest.cc ('k') | headless/public/headless_web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698