OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // SetArgs(), set_request_id(), and the other setters before calling this | 75 // SetArgs(), set_request_id(), and the other setters before calling this |
76 // method. Derived classes should be ready to return GetResult() and | 76 // method. Derived classes should be ready to return GetResult() and |
77 // GetError() before returning from this function. | 77 // GetError() before returning from this function. |
78 // Note that once Run() returns, dispatcher() can be NULL, so be sure to | 78 // Note that once Run() returns, dispatcher() can be NULL, so be sure to |
79 // NULL-check. | 79 // NULL-check. |
80 virtual void Run(); | 80 virtual void Run(); |
81 | 81 |
82 // Returns a quota limit heuristic suitable for this function. | 82 // Returns a quota limit heuristic suitable for this function. |
83 // No quota limiting by default. | 83 // No quota limiting by default. |
84 virtual void GetQuotaLimitHeuristics( | 84 virtual void GetQuotaLimitHeuristics( |
85 std::list<QuotaLimitHeuristic*>* heuristics) const {} | 85 QuotaLimitHeuristics* heuristics) const {} |
86 | 86 |
87 // Called when the quota limit has been exceeded. The default implementation | 87 // Called when the quota limit has been exceeded. The default implementation |
88 // returns an error. | 88 // returns an error. |
89 virtual void OnQuotaExceeded(); | 89 virtual void OnQuotaExceeded(); |
90 | 90 |
91 // Specifies the raw arguments to the function, as a JSON value. | 91 // Specifies the raw arguments to the function, as a JSON value. |
92 virtual void SetArgs(const base::ListValue* args); | 92 virtual void SetArgs(const base::ListValue* args); |
93 | 93 |
94 // Retrieves the results of the function as a JSON-encoded string (may | 94 // Retrieves the results of the function as a JSON-encoded string (may |
95 // be empty). | 95 // be empty). |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 public: | 381 public: |
382 SyncIOThreadExtensionFunction(); | 382 SyncIOThreadExtensionFunction(); |
383 | 383 |
384 virtual void Run() OVERRIDE; | 384 virtual void Run() OVERRIDE; |
385 | 385 |
386 protected: | 386 protected: |
387 virtual ~SyncIOThreadExtensionFunction(); | 387 virtual ~SyncIOThreadExtensionFunction(); |
388 }; | 388 }; |
389 | 389 |
390 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 390 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
OLD | NEW |