OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_WEBDRIVER_COMMANDS_COMMAND_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_COMMANDS_COMMAND_H_ |
6 #define CHROME_TEST_WEBDRIVER_COMMANDS_COMMAND_H_ | 6 #define CHROME_TEST_WEBDRIVER_COMMANDS_COMMAND_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 bool GetStringASCIIParameter(const std::string& key, std::string* out) const; | 69 bool GetStringASCIIParameter(const std::string& key, std::string* out) const; |
70 | 70 |
71 // Returns the command parameter with the given |key| as a boolean. Returns | 71 // Returns the command parameter with the given |key| as a boolean. Returns |
72 // false if there is no such parameter, or if it is not a boolean. | 72 // false if there is no such parameter, or if it is not a boolean. |
73 bool GetBooleanParameter(const std::string& key, bool* out) const; | 73 bool GetBooleanParameter(const std::string& key, bool* out) const; |
74 | 74 |
75 // Returns the command parameter with the given |key| as a int. Returns | 75 // Returns the command parameter with the given |key| as a int. Returns |
76 // false if there is no such parameter, or if it is not a int. | 76 // false if there is no such parameter, or if it is not a int. |
77 bool GetIntegerParameter(const std::string& key, int* out) const; | 77 bool GetIntegerParameter(const std::string& key, int* out) const; |
78 | 78 |
| 79 // Returns the command parameter with the given |key| as a Dictionary. |
| 80 // Returns false if there is no such parameter, or if it is not a Dictionary. |
| 81 bool GetDictionaryParameter(const std::string& key, |
| 82 DictionaryValue** out) const; |
| 83 |
79 private: | 84 private: |
80 const std::vector<std::string> path_segments_; | 85 const std::vector<std::string> path_segments_; |
81 const scoped_ptr<const DictionaryValue> parameters_; | 86 const scoped_ptr<const DictionaryValue> parameters_; |
82 | 87 |
83 // An autorelease pool must exist on any thread where Objective C is used, | 88 // An autorelease pool must exist on any thread where Objective C is used, |
84 // even implicitly. Otherwise the warning: | 89 // even implicitly. Otherwise the warning: |
85 // "Objects autoreleased with no pool in place." | 90 // "Objects autoreleased with no pool in place." |
86 // is printed for every object deallocted. Since every incomming command to | 91 // is printed for every object deallocted. Since every incomming command to |
87 // chrome driver is allocated a new thread, the release pool is declared here. | 92 // chrome driver is allocated a new thread, the release pool is declared here. |
88 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 93 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
89 | 94 |
90 DISALLOW_COPY_AND_ASSIGN(Command); | 95 DISALLOW_COPY_AND_ASSIGN(Command); |
91 }; | 96 }; |
92 | 97 |
93 } // namespace webdriver | 98 } // namespace webdriver |
94 | 99 |
95 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_COMMAND_H_ | 100 #endif // CHROME_TEST_WEBDRIVER_COMMANDS_COMMAND_H_ |
96 | 101 |
OLD | NEW |