Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: gin/function_template.h

Issue 120043008: Add a simple one shot and repeating timer API for Mojo.js. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gin/arguments.h ('k') | gin/gin.gyp » ('j') | gin/runner.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/function_template.h
diff --git a/gin/function_template.h b/gin/function_template.h
index 91b3cdb0ce3a0785badd25a2780e2aba78233775..80eccc7525490689d0c96bcb70a656ddb8e46f98 100644
--- a/gin/function_template.h
+++ b/gin/function_template.h
@@ -179,7 +179,9 @@ struct Invoker<R, void, void, void, void> {
inline static void Go(
Arguments* args,
const base::Callback<R()>& callback) {
- args->Return(callback.Run());
+ R r = callback.Run();
+ LOG(ERROR) << "Setting return value to: " << r;
+ args->Return(r);
}
};
template<>
@@ -210,6 +212,13 @@ inline bool GetNextArgument(Arguments* args, int create_flags, bool is_first,
return true;
}
+// It's common for clients to just need the isolate, so we make that easy.
+inline bool GetNextArgument(Arguments* args, int create_flags,
+ bool is_first, v8::Isolate** result) {
+ *result = args->isolate();
+ return true;
+}
+
// DispatchToCallback converts all the JavaScript arguments to C++ types and
// invokes the base::Callback.
« no previous file with comments | « gin/arguments.h ('k') | gin/gin.gyp » ('j') | gin/runner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698