| 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_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // this function to |heuristics|. The ownership of the new QuotaLimitHeuristic | 111 // this function to |heuristics|. The ownership of the new QuotaLimitHeuristic |
| 112 // instances is passed to the owner of |heuristics|. | 112 // instances is passed to the owner of |heuristics|. |
| 113 // No quota limiting by default. | 113 // No quota limiting by default. |
| 114 // | 114 // |
| 115 // Only called once per lifetime of the ExtensionsQuotaService. | 115 // Only called once per lifetime of the ExtensionsQuotaService. |
| 116 virtual void GetQuotaLimitHeuristics( | 116 virtual void GetQuotaLimitHeuristics( |
| 117 QuotaLimitHeuristics* heuristics) const {} | 117 QuotaLimitHeuristics* heuristics) const {} |
| 118 | 118 |
| 119 // Called when the quota limit has been exceeded. The default implementation | 119 // Called when the quota limit has been exceeded. The default implementation |
| 120 // returns an error. | 120 // returns an error. |
| 121 virtual void OnQuotaExceeded(); | 121 virtual void OnQuotaExceeded(const std::string& violation_error); |
| 122 | 122 |
| 123 // Specifies the raw arguments to the function, as a JSON value. | 123 // Specifies the raw arguments to the function, as a JSON value. |
| 124 virtual void SetArgs(const base::ListValue* args); | 124 virtual void SetArgs(const base::ListValue* args); |
| 125 | 125 |
| 126 // Sets a single Value as the results of the function. | 126 // Sets a single Value as the results of the function. |
| 127 void SetResult(base::Value* result); | 127 void SetResult(base::Value* result); |
| 128 | 128 |
| 129 // Retrieves the results of the function as a ListValue. | 129 // Retrieves the results of the function as a ListValue. |
| 130 const base::ListValue* GetResultList(); | 130 const base::ListValue* GetResultList(); |
| 131 | 131 |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 public: | 443 public: |
| 444 SyncIOThreadExtensionFunction(); | 444 SyncIOThreadExtensionFunction(); |
| 445 | 445 |
| 446 virtual void Run() OVERRIDE; | 446 virtual void Run() OVERRIDE; |
| 447 | 447 |
| 448 protected: | 448 protected: |
| 449 virtual ~SyncIOThreadExtensionFunction(); | 449 virtual ~SyncIOThreadExtensionFunction(); |
| 450 }; | 450 }; |
| 451 | 451 |
| 452 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 452 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
| OLD | NEW |