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

Side by Side Diff: headless/lib/browser/headless_devtools_client_impl.h

Issue 2531313002: Expose the full API for attaching devtools clients: (Closed)
Patch Set: Created 4 years 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_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_
6 #define HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ 6 #define HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 std::unique_ptr<base::Value> params, 108 std::unique_ptr<base::Value> params,
109 base::Callback<void()> callback) override; 109 base::Callback<void()> callback) override;
110 void SendMessage(const char* method, 110 void SendMessage(const char* method,
111 base::Callback<void(const base::Value&)> callback) override; 111 base::Callback<void(const base::Value&)> callback) override;
112 void SendMessage(const char* method, 112 void SendMessage(const char* method,
113 base::Callback<void()> callback) override; 113 base::Callback<void()> callback) override;
114 void RegisterEventHandler( 114 void RegisterEventHandler(
115 const char* method, 115 const char* method,
116 base::Callback<void(const base::Value&)> callback) override; 116 base::Callback<void(const base::Value&)> callback) override;
117 117
118 void AttachToHost(content::DevToolsAgentHost* agent_host); 118 bool AttachToHost(content::DevToolsAgentHost* agent_host);
119 void ForceAttachToHost(content::DevToolsAgentHost* agent_host);
119 void DetachFromHost(content::DevToolsAgentHost* agent_host); 120 void DetachFromHost(content::DevToolsAgentHost* agent_host);
120 121
121 private: 122 private:
122 // Contains a callback with or without a result parameter depending on the 123 // Contains a callback with or without a result parameter depending on the
123 // message type. 124 // message type.
124 struct Callback { 125 struct Callback {
125 Callback(); 126 Callback();
126 Callback(Callback&& other); 127 Callback(Callback&& other);
127 explicit Callback(base::Callback<void()> callback); 128 explicit Callback(base::Callback<void()> callback);
128 explicit Callback(base::Callback<void(const base::Value&)> callback); 129 explicit Callback(base::Callback<void(const base::Value&)> callback);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 tracing::ExperimentalDomain tracing_domain_; 198 tracing::ExperimentalDomain tracing_domain_;
198 scoped_refptr<base::SingleThreadTaskRunner> browser_main_thread_; 199 scoped_refptr<base::SingleThreadTaskRunner> browser_main_thread_;
199 base::WeakPtrFactory<HeadlessDevToolsClientImpl> weak_ptr_factory_; 200 base::WeakPtrFactory<HeadlessDevToolsClientImpl> weak_ptr_factory_;
200 201
201 DISALLOW_COPY_AND_ASSIGN(HeadlessDevToolsClientImpl); 202 DISALLOW_COPY_AND_ASSIGN(HeadlessDevToolsClientImpl);
202 }; 203 };
203 204
204 } // namespace headless 205 } // namespace headless
205 206
206 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ 207 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698