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

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

Issue 1047993002: bindings: Add validation for enum Sequence or Array (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 int length = collection->length(); 912 int length = collection->length();
913 v8::Handle<v8::Array> properties = v8::Array::New(info.GetIsolate(), length) ; 913 v8::Handle<v8::Array> properties = v8::Array::New(info.GetIsolate(), length) ;
914 for (int i = 0; i < length; ++i) { 914 for (int i = 0; i < length; ++i) {
915 // FIXME: Do we need to check that the item function returns a non-null value for this index? 915 // FIXME: Do we need to check that the item function returns a non-null value for this index?
916 v8::Handle<v8::Integer> integer = v8::Integer::New(info.GetIsolate(), i) ; 916 v8::Handle<v8::Integer> integer = v8::Integer::New(info.GetIsolate(), i) ;
917 properties->Set(integer, integer); 917 properties->Set(integer, integer);
918 } 918 }
919 v8SetReturnValue(info, properties); 919 v8SetReturnValue(info, properties);
920 } 920 }
921 921
922 bool isValidEnum(const String value, const char** validValues, size_t length, Ex ceptionState&);
923 bool isValidEnum(const Vector<String>& values, const char** validValues, size_t length, ExceptionState&);
924
922 // These methods store hidden values into an array that is stored in the interna l field of a DOM wrapper. 925 // These methods store hidden values into an array that is stored in the interna l field of a DOM wrapper.
923 void addHiddenValueToArray(v8::Isolate*, v8::Handle<v8::Object>, v8::Local<v8::V alue>, int cacheIndex); 926 void addHiddenValueToArray(v8::Isolate*, v8::Handle<v8::Object>, v8::Local<v8::V alue>, int cacheIndex);
924 void removeHiddenValueFromArray(v8::Isolate*, v8::Handle<v8::Object>, v8::Local< v8::Value>, int cacheIndex); 927 void removeHiddenValueFromArray(v8::Isolate*, v8::Handle<v8::Object>, v8::Local< v8::Value>, int cacheIndex);
925 CORE_EXPORT void moveEventListenerToNewWrapper(v8::Isolate*, v8::Handle<v8::Obje ct>, EventListener* oldValue, v8::Local<v8::Value> newValue, int cacheIndex); 928 CORE_EXPORT void moveEventListenerToNewWrapper(v8::Isolate*, v8::Handle<v8::Obje ct>, EventListener* oldValue, v8::Local<v8::Value> newValue, int cacheIndex);
926 929
927 // Result values for platform object 'deleter' methods, 930 // Result values for platform object 'deleter' methods,
928 // http://www.w3.org/TR/WebIDL/#delete 931 // http://www.w3.org/TR/WebIDL/#delete
929 enum DeleteResult { 932 enum DeleteResult {
930 DeleteSuccess, 933 DeleteSuccess,
931 DeleteReject, 934 DeleteReject,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol ate*, ExecutionContext*, v8::Handle<v8::Function>); 990 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol ate*, ExecutionContext*, v8::Handle<v8::Function>);
988 991
989 // Callback functions used by generated code. 992 // Callback functions used by generated code.
990 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>&); 993 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>&);
991 994
992 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso late*); 995 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso late*);
993 996
994 } // namespace blink 997 } // namespace blink
995 998
996 #endif // V8Binding_h 999 #endif // V8Binding_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698