OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_ | 5 #ifndef CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_ |
6 #define CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_ | 6 #define CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 }; | 281 }; |
282 | 282 |
283 // Uses an automation proxy that communicates over a named socket. | 283 // Uses an automation proxy that communicates over a named socket. |
284 // This is used if you want to connect an AutomationProxy | 284 // This is used if you want to connect an AutomationProxy |
285 // to a browser process that is already running. | 285 // to a browser process that is already running. |
286 // The channel id of the proxy is a constant specified by kInterfacePath. | 286 // The channel id of the proxy is a constant specified by kInterfacePath. |
287 class NamedProxyLauncher : public ProxyLauncher { | 287 class NamedProxyLauncher : public ProxyLauncher { |
288 public: | 288 public: |
289 // If launch_browser is true, launches Chrome with named interface enabled. | 289 // If launch_browser is true, launches Chrome with named interface enabled. |
290 // Otherwise, there should be an existing instance the proxy can connect to. | 290 // Otherwise, there should be an existing instance the proxy can connect to. |
291 // wait_for_server_channel should be set to false only if it is guaranteed | |
292 // Chrome's server channel is already listening for connections. | |
291 NamedProxyLauncher(const std::string& channel_id, | 293 NamedProxyLauncher(const std::string& channel_id, |
292 bool launch_browser, | 294 bool launch_browser, |
295 bool wait_for_server_channel, | |
Paweł Hajdan Jr.
2011/07/29 20:48:38
3 bool parameters next to each other are a recipe
kkania
2011/07/29 22:44:19
Changed to struct.
We know the channel is ready b
| |
293 bool disconnect_on_failure); | 296 bool disconnect_on_failure); |
294 | 297 |
295 virtual AutomationProxy* CreateAutomationProxy( | 298 virtual AutomationProxy* CreateAutomationProxy( |
296 int execution_timeout) OVERRIDE; | 299 int execution_timeout) OVERRIDE; |
297 virtual bool InitializeConnection( | 300 virtual bool InitializeConnection( |
298 const LaunchState& state, | 301 const LaunchState& state, |
299 bool wait_for_initial_loads) OVERRIDE WARN_UNUSED_RESULT; | 302 bool wait_for_initial_loads) OVERRIDE WARN_UNUSED_RESULT; |
300 virtual void TerminateConnection() OVERRIDE; | 303 virtual void TerminateConnection() OVERRIDE; |
301 virtual std::string PrefixedChannelID() const OVERRIDE; | 304 virtual std::string PrefixedChannelID() const OVERRIDE; |
302 | 305 |
303 protected: | 306 protected: |
304 std::string channel_id_; // Channel id of automation proxy. | 307 std::string channel_id_; // Channel id of automation proxy. |
305 bool launch_browser_; // True if we should launch the browser too. | 308 bool launch_browser_; // True if we should launch the browser too. |
306 bool disconnect_on_failure_; // True if we disconnect on IPC channel failure. | 309 bool wait_for_server_channel_; // True if we should wait for server channel. |
310 bool disconnect_on_failure_; // True if we disconnect on channel failure. | |
307 | 311 |
308 private: | 312 private: |
309 DISALLOW_COPY_AND_ASSIGN(NamedProxyLauncher); | 313 DISALLOW_COPY_AND_ASSIGN(NamedProxyLauncher); |
310 }; | 314 }; |
311 | 315 |
312 // Uses an automation proxy that communicates over an anonymous socket. | 316 // Uses an automation proxy that communicates over an anonymous socket. |
313 class AnonymousProxyLauncher : public ProxyLauncher { | 317 class AnonymousProxyLauncher : public ProxyLauncher { |
314 public: | 318 public: |
315 explicit AnonymousProxyLauncher(bool disconnect_on_failure); | 319 explicit AnonymousProxyLauncher(bool disconnect_on_failure); |
316 virtual AutomationProxy* CreateAutomationProxy( | 320 virtual AutomationProxy* CreateAutomationProxy( |
317 int execution_timeout) OVERRIDE; | 321 int execution_timeout) OVERRIDE; |
318 virtual bool InitializeConnection( | 322 virtual bool InitializeConnection( |
319 const LaunchState& state, | 323 const LaunchState& state, |
320 bool wait_for_initial_loads) OVERRIDE WARN_UNUSED_RESULT; | 324 bool wait_for_initial_loads) OVERRIDE WARN_UNUSED_RESULT; |
321 virtual void TerminateConnection() OVERRIDE; | 325 virtual void TerminateConnection() OVERRIDE; |
322 virtual std::string PrefixedChannelID() const OVERRIDE; | 326 virtual std::string PrefixedChannelID() const OVERRIDE; |
323 | 327 |
324 protected: | 328 protected: |
325 std::string channel_id_; // Channel id of automation proxy. | 329 std::string channel_id_; // Channel id of automation proxy. |
326 bool disconnect_on_failure_; // True if we disconnect on IPC channel failure. | 330 bool disconnect_on_failure_; // True if we disconnect on IPC channel failure. |
327 | 331 |
328 private: | 332 private: |
329 DISALLOW_COPY_AND_ASSIGN(AnonymousProxyLauncher); | 333 DISALLOW_COPY_AND_ASSIGN(AnonymousProxyLauncher); |
330 }; | 334 }; |
331 | 335 |
332 #endif // CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_ | 336 #endif // CHROME_TEST_AUTOMATION_PROXY_LAUNCHER_H_ |
OLD | NEW |