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