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

Side by Side 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: cleanup 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gin/function_template.h.pump » ('j') | gin/modules/timer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // This file was GENERATED by command: 1 // This file was GENERATED by command:
2 // pump.py function_template.h.pump 2 // pump.py function_template.h.pump
3 // DO NOT EDIT BY HAND!!! 3 // DO NOT EDIT BY HAND!!!
4 4
5 5
6 6
7 #ifndef GIN_FUNCTION_TEMPLATE_H_ 7 #ifndef GIN_FUNCTION_TEMPLATE_H_
8 #define GIN_FUNCTION_TEMPLATE_H_ 8 #define GIN_FUNCTION_TEMPLATE_H_
9 9
10 // Copyright 2013 The Chromium Authors. All rights reserved. 10 // Copyright 2013 The Chromium Authors. All rights reserved.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 204
205 // For advanced use cases, we allow callers to request the unparsed Arguments 205 // For advanced use cases, we allow callers to request the unparsed Arguments
206 // object and poke around in it directly. 206 // object and poke around in it directly.
207 inline bool GetNextArgument(Arguments* args, int create_flags, bool is_first, 207 inline bool GetNextArgument(Arguments* args, int create_flags, bool is_first,
208 Arguments* result) { 208 Arguments* result) {
209 *result = *args; 209 *result = *args;
210 return true; 210 return true;
211 } 211 }
212 212
213 // It's common for clients to just need the isolate, so we make that easy.
214 inline bool GetNextArgument(Arguments* args, int create_flags,
215 bool is_first, v8::Isolate** result) {
216 *result = args->isolate();
217 return true;
218 }
219
213 220
214 // DispatchToCallback converts all the JavaScript arguments to C++ types and 221 // DispatchToCallback converts all the JavaScript arguments to C++ types and
215 // invokes the base::Callback. 222 // invokes the base::Callback.
216 template<typename Sig> 223 template<typename Sig>
217 struct Dispatcher { 224 struct Dispatcher {
218 }; 225 };
219 226
220 template<typename R> 227 template<typename R>
221 struct Dispatcher<R()> { 228 struct Dispatcher<R()> {
222 static void DispatchToCallback( 229 static void DispatchToCallback(
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 isolate, new HolderT(callback, callback_flags)); 351 isolate, new HolderT(callback, callback_flags));
345 return v8::FunctionTemplate::New( 352 return v8::FunctionTemplate::New(
346 isolate, 353 isolate,
347 &internal::Dispatcher<Sig>::DispatchToCallback, 354 &internal::Dispatcher<Sig>::DispatchToCallback,
348 ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.get())); 355 ConvertToV8<internal::CallbackHolderBase*>(isolate, holder.get()));
349 } 356 }
350 357
351 } // namespace gin 358 } // namespace gin
352 359
353 #endif // GIN_FUNCTION_TEMPLATE_H_ 360 #endif // GIN_FUNCTION_TEMPLATE_H_
OLDNEW
« no previous file with comments | « no previous file | gin/function_template.h.pump » ('j') | gin/modules/timer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698