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: |