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

Side by Side Diff: Source/bindings/v8/V8Binding.h

Issue 335113002: IDL: Support argument default values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 6 months 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
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/bindings/v8/V8StringResource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2012 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 void throwMinimumArityTypeErrorForMethod(const char* method, const char* type, u nsigned expected, unsigned providedLeastNumMandatoryParams, v8::Isolate*); 79 void throwMinimumArityTypeErrorForMethod(const char* method, const char* type, u nsigned expected, unsigned providedLeastNumMandatoryParams, v8::Isolate*);
80 void throwMinimumArityTypeErrorForConstructor(const char* type, unsigned expecte d, unsigned providedLeastNumMandatoryParams, v8::Isolate*); 80 void throwMinimumArityTypeErrorForConstructor(const char* type, unsigned expecte d, unsigned providedLeastNumMandatoryParams, v8::Isolate*);
81 void throwMinimumArityTypeError(ExceptionState&, unsigned expected, unsigned pro videdLeastNumMandatoryParams); 81 void throwMinimumArityTypeError(ExceptionState&, unsigned expected, unsigned pro videdLeastNumMandatoryParams);
82 82
83 // Returns false if the callback threw an exception, true otherwise. 83 // Returns false if the callback threw an exception, true otherwise.
84 bool invokeCallback(ScriptState*, v8::Local<v8::Function> callback, int argc, v8 ::Handle<v8::Value> argv[]); 84 bool invokeCallback(ScriptState*, v8::Local<v8::Function> callback, int argc, v8 ::Handle<v8::Value> argv[]);
85 bool invokeCallback(ScriptState*, v8::Local<v8::Function> callback, v8::Handle<v 8::Value> thisValue, int argc, v8::Handle<v8::Value> argv[]); 85 bool invokeCallback(ScriptState*, v8::Local<v8::Function> callback, v8::Handle<v 8::Value> thisValue, int argc, v8::Handle<v8::Value> argv[]);
86 86
87 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator(); 87 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator();
88 88
89 inline v8::Handle<v8::Value> argumentOrNull(const v8::FunctionCallbackInfo<v8::V alue>& info, int index)
90 {
91 return index >= info.Length() ? v8::Local<v8::Value>() : info[index];
92 }
93
94 template<typename CallbackInfo, typename V> 89 template<typename CallbackInfo, typename V>
95 inline void v8SetReturnValue(const CallbackInfo& info, V v) 90 inline void v8SetReturnValue(const CallbackInfo& info, V v)
96 { 91 {
97 info.GetReturnValue().Set(v); 92 info.GetReturnValue().Set(v);
98 } 93 }
99 94
100 template<typename CallbackInfo> 95 template<typename CallbackInfo>
101 inline void v8SetReturnValueBool(const CallbackInfo& info, bool v) 96 inline void v8SetReturnValueBool(const CallbackInfo& info, bool v)
102 { 97 {
103 info.GetReturnValue().Set(v); 98 info.GetReturnValue().Set(v);
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 m_block.Reset(); 998 m_block.Reset();
1004 } 999 }
1005 1000
1006 private: 1001 private:
1007 v8::TryCatch& m_block; 1002 v8::TryCatch& m_block;
1008 }; 1003 };
1009 1004
1010 } // namespace WebCore 1005 } // namespace WebCore
1011 1006
1012 #endif // V8Binding_h 1007 #endif // V8Binding_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/bindings/v8/V8StringResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698