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

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: 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
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // Helpers for throwing JavaScript TypeErrors for arity mismatches. 75 // Helpers for throwing JavaScript TypeErrors for arity mismatches.
76 void throwArityTypeErrorForMethod(const char* method, const char* type, const ch ar* valid, unsigned provided, v8::Isolate*); 76 void throwArityTypeErrorForMethod(const char* method, const char* type, const ch ar* valid, unsigned provided, v8::Isolate*);
77 void throwArityTypeErrorForConstructor(const char* type, const char* valid, unsi gned provided, v8::Isolate*); 77 void throwArityTypeErrorForConstructor(const char* type, const char* valid, unsi gned provided, v8::Isolate*);
78 void throwArityTypeError(ExceptionState&, const char* valid, unsigned provided); 78 void throwArityTypeError(ExceptionState&, const char* valid, unsigned provided);
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 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator(); 83 v8::ArrayBuffer::Allocator* v8ArrayBufferAllocator();
84 84
85 inline v8::Handle<v8::Value> argumentOrNull(const v8::FunctionCallbackInfo<v8::V alue>& info, int index)
86 {
87 return index >= info.Length() ? v8::Local<v8::Value>() : info[index];
88 }
89
90 template<typename CallbackInfo, typename V> 85 template<typename CallbackInfo, typename V>
91 inline void v8SetReturnValue(const CallbackInfo& info, V v) 86 inline void v8SetReturnValue(const CallbackInfo& info, V v)
92 { 87 {
93 info.GetReturnValue().Set(v); 88 info.GetReturnValue().Set(v);
94 } 89 }
95 90
96 template<typename CallbackInfo> 91 template<typename CallbackInfo>
97 inline void v8SetReturnValueBool(const CallbackInfo& info, bool v) 92 inline void v8SetReturnValueBool(const CallbackInfo& info, bool v)
98 { 93 {
99 info.GetReturnValue().Set(v); 94 info.GetReturnValue().Set(v);
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 m_block.Reset(); 958 m_block.Reset();
964 } 959 }
965 960
966 private: 961 private:
967 v8::TryCatch& m_block; 962 v8::TryCatch& m_block;
968 }; 963 };
969 964
970 } // namespace WebCore 965 } // namespace WebCore
971 966
972 #endif // V8Binding_h 967 #endif // V8Binding_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698