OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 extensions::QuotaLimitHeuristics* heuristics) const {} | 193 extensions::QuotaLimitHeuristics* heuristics) const {} |
194 | 194 |
195 // Called when the quota limit has been exceeded. The default implementation | 195 // Called when the quota limit has been exceeded. The default implementation |
196 // returns an error. | 196 // returns an error. |
197 virtual void OnQuotaExceeded(const std::string& violation_error); | 197 virtual void OnQuotaExceeded(const std::string& violation_error); |
198 | 198 |
199 // Specifies the raw arguments to the function, as a JSON value. | 199 // Specifies the raw arguments to the function, as a JSON value. |
200 virtual void SetArgs(const base::ListValue* args); | 200 virtual void SetArgs(const base::ListValue* args); |
201 | 201 |
202 // Sets a single Value as the results of the function. | 202 // Sets a single Value as the results of the function. |
| 203 void SetResult(scoped_ptr<base::Value> result); |
| 204 // As above, but deprecated. TODO(estade): remove. |
203 void SetResult(base::Value* result); | 205 void SetResult(base::Value* result); |
204 | 206 |
205 // Sets multiple Values as the results of the function. | 207 // Sets multiple Values as the results of the function. |
206 void SetResultList(scoped_ptr<base::ListValue> results); | 208 void SetResultList(scoped_ptr<base::ListValue> results); |
207 | 209 |
208 // Retrieves the results of the function as a ListValue. | 210 // Retrieves the results of the function as a ListValue. |
209 const base::ListValue* GetResultList() const; | 211 const base::ListValue* GetResultList() const; |
210 | 212 |
211 // Retrieves any error string from the function. | 213 // Retrieves any error string from the function. |
212 virtual std::string GetError() const; | 214 virtual std::string GetError() const; |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 static bool ValidationFailure(SyncIOThreadExtensionFunction* function); | 662 static bool ValidationFailure(SyncIOThreadExtensionFunction* function); |
661 | 663 |
662 private: | 664 private: |
663 // If you're hitting a compile error here due to "final" - great! You're | 665 // If you're hitting a compile error here due to "final" - great! You're |
664 // doing the right thing, you just need to extend IOThreadExtensionFunction | 666 // doing the right thing, you just need to extend IOThreadExtensionFunction |
665 // instead of SyncIOExtensionFunction. | 667 // instead of SyncIOExtensionFunction. |
666 ResponseAction Run() final; | 668 ResponseAction Run() final; |
667 }; | 669 }; |
668 | 670 |
669 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ | 671 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ |
OLD | NEW |