Index: extensions/renderer/api_binding_types.h |
diff --git a/extensions/renderer/api_binding_types.h b/extensions/renderer/api_binding_types.h |
index c9edc46941601bfb7af86bcee9c3dc3123978b4b..9665ab157628e336dee2858bee72ad0cfdee9796 100644 |
--- a/extensions/renderer/api_binding_types.h |
+++ b/extensions/renderer/api_binding_types.h |
@@ -21,6 +21,19 @@ using RunJSFunction = base::Callback<void(v8::Local<v8::Function>, |
int argc, |
v8::Local<v8::Value>[])>; |
+// A callback to execute the given v8::Function synchronously and return the |
+// result. Note that script can be suspended, so you need to be certain that |
+// it is not before expected a synchronous result. We use a Global instead of a |
+// Local because certain implementations need to create a persistent handle in |
+// order to prevent immediate destruction of the locals. |
+// TODO(devlin): if we could, using Local here with an EscapableHandleScope |
+// would be preferable. |
+using RunJSFunctionSync = |
+ base::Callback<v8::Global<v8::Value>(v8::Local<v8::Function>, |
+ v8::Local<v8::Context>, |
+ int argc, |
+ v8::Local<v8::Value>[])>; |
+ |
} // namespace binding |
} // namespace extensions |