Chromium Code Reviews| 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: |