OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROMEDRIVER_COMMAND_EXECUTOR_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_H_ |
6 #define CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
13 #include "chrome/test/chromedriver/status.h" | 13 #include "chrome/test/chromedriver/status.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class DictionaryValue; | 16 class DictionaryValue; |
17 class Value; | 17 class Value; |
18 } | 18 } |
19 | 19 |
20 // Executes WebDriver commands. | 20 // Executes WebDriver commands. |
21 class CommandExecutor { | 21 class CommandExecutor { |
22 public: | 22 public: |
23 virtual ~CommandExecutor() {} | 23 virtual ~CommandExecutor() {} |
24 | 24 |
| 25 virtual void Init() = 0; |
| 26 |
25 // Executes a command synchronously. This function must be thread safe. | 27 // Executes a command synchronously. This function must be thread safe. |
26 virtual void ExecuteCommand(const std::string& name, | 28 virtual void ExecuteCommand(const std::string& name, |
27 const base::DictionaryValue& params, | 29 const base::DictionaryValue& params, |
28 const std::string& session_id, | 30 const std::string& session_id, |
29 StatusCode* status_code, | 31 StatusCode* status_code, |
30 scoped_ptr<base::Value>* value, | 32 scoped_ptr<base::Value>* value, |
31 std::string* out_session_id) = 0; | 33 std::string* out_session_id) = 0; |
32 }; | 34 }; |
33 | 35 |
34 #endif // CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_H_ | 36 #endif // CHROME_TEST_CHROMEDRIVER_COMMAND_EXECUTOR_H_ |
OLD | NEW |