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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_CLIENT_H_ 5 #ifndef HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_CLIENT_H_
6 #define HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_CLIENT_H_ 6 #define HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_CLIENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 virtual network::Domain* GetNetwork() = 0; 139 virtual network::Domain* GetNetwork() = 0;
140 virtual page::Domain* GetPage() = 0; 140 virtual page::Domain* GetPage() = 0;
141 virtual profiler::Domain* GetProfiler() = 0; 141 virtual profiler::Domain* GetProfiler() = 0;
142 virtual rendering::Domain* GetRendering() = 0; 142 virtual rendering::Domain* GetRendering() = 0;
143 virtual runtime::Domain* GetRuntime() = 0; 143 virtual runtime::Domain* GetRuntime() = 0;
144 virtual security::Domain* GetSecurity() = 0; 144 virtual security::Domain* GetSecurity() = 0;
145 virtual service_worker::Domain* GetServiceWorker() = 0; 145 virtual service_worker::Domain* GetServiceWorker() = 0;
146 virtual target::Domain* GetTarget() = 0; 146 virtual target::Domain* GetTarget() = 0;
147 virtual tracing::Domain* GetTracing() = 0; 147 virtual tracing::Domain* GetTracing() = 0;
148 148
149 class HEADLESS_EXPORT RawProtocolListener {
150 public:
151 RawProtocolListener() {}
152 virtual ~RawProtocolListener() {}
153
154 // Returns true if the listener handled the message.
155 virtual bool OnProtocolMessage(
156 const std::string& devtools_agent_host_id,
157 const std::string& json_message,
158 const base::DictionaryValue& parsed_message) = 0;
159
160 private:
161 DISALLOW_COPY_AND_ASSIGN(RawProtocolListener);
162 };
163
164 virtual void SetRawProtocolListener(
165 RawProtocolListener* raw_protocol_listener) = 0;
166
167 // Generates an odd numbered ID.
168 virtual int GetNextRawDevToolsMessageId() = 0;
169
170 // The id within the message must be odd to prevent collisions.
171 virtual void SendRawDevToolsMessage(const std::string& json_message) = 0;
172 virtual void SendRawDevToolsMessage(const base::DictionaryValue& message) = 0;
173
149 // TODO(skyostil): Add notification for disconnection. 174 // TODO(skyostil): Add notification for disconnection.
150 175
151 private: 176 private:
152 friend class HeadlessDevToolsClientImpl; 177 friend class HeadlessDevToolsClientImpl;
153 178
154 HeadlessDevToolsClient() {} 179 HeadlessDevToolsClient() {}
155 180
156 DISALLOW_COPY_AND_ASSIGN(HeadlessDevToolsClient); 181 DISALLOW_COPY_AND_ASSIGN(HeadlessDevToolsClient);
157 }; 182 };
158 183
159 } // namespace headless 184 } // namespace headless
160 185
161 #endif // HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_CLIENT_H_ 186 #endif // HEADLESS_PUBLIC_HEADLESS_DEVTOOLS_CLIENT_H_
OLDNEW
« 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