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_TEST_UTILS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 | 12 |
| 13 class AsyncExtensionFunction; |
13 class Browser; | 14 class Browser; |
14 class Extension; | 15 class Extension; |
15 class UIThreadExtensionFunction; | 16 class UIThreadExtensionFunction; |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class Value; | 19 class Value; |
19 class DictionaryValue; | 20 class DictionaryValue; |
20 class ListValue; | 21 class ListValue; |
21 } | 22 } |
22 | 23 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // close to what the bindings would actually send. | 78 // close to what the bindings would actually send. |
78 // | 79 // |
79 // TODO(aa): I'm concerned that this style won't scale to all the bits and bobs | 80 // TODO(aa): I'm concerned that this style won't scale to all the bits and bobs |
80 // we're going to need to frob for all the different extension functions. But we | 81 // we're going to need to frob for all the different extension functions. But we |
81 // can refactor when we see what is needed. | 82 // can refactor when we see what is needed. |
82 void RunFunction(UIThreadExtensionFunction* function, | 83 void RunFunction(UIThreadExtensionFunction* function, |
83 const std::string& args, | 84 const std::string& args, |
84 Browser* browser, | 85 Browser* browser, |
85 RunFunctionFlags flags); | 86 RunFunctionFlags flags); |
86 | 87 |
| 88 // Similar to RunFunction, but doesn't return until |function| calls |
| 89 // SendResponse. Returns the value |function| passed to SendResponse. |
| 90 bool RunAsyncFunction(AsyncExtensionFunction* function, |
| 91 const std::string& args, |
| 92 Browser* browser, |
| 93 RunFunctionFlags flags); |
| 94 |
87 } // namespace extension_function_test_utils | 95 } // namespace extension_function_test_utils |
88 | 96 |
89 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ | 97 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_TEST_UTILS_H_ |
OLD | NEW |