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

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

Issue 1322533002: bindings: Supports to change the method location. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed review comments. Created 5 years, 3 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
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8DOMConfiguration.cpp » ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 v8::Local<v8::Name> methodName(v8::Isolate* isolate) const { return v8At omicString(isolate, name); } 153 v8::Local<v8::Name> methodName(v8::Isolate* isolate) const { return v8At omicString(isolate, name); }
154 v8::FunctionCallback callbackForWorld(const DOMWrapperWorld& world) cons t 154 v8::FunctionCallback callbackForWorld(const DOMWrapperWorld& world) cons t
155 { 155 {
156 return world.isMainWorld() && callbackForMainWorld ? callbackForMain World : callback; 156 return world.isMainWorld() && callbackForMainWorld ? callbackForMain World : callback;
157 } 157 }
158 158
159 const char* const name; 159 const char* const name;
160 v8::FunctionCallback callback; 160 v8::FunctionCallback callback;
161 v8::FunctionCallback callbackForMainWorld; 161 v8::FunctionCallback callbackForMainWorld;
162 int length; 162 int length;
163 ExposeConfiguration exposeConfiguration; 163 unsigned exposeConfiguration : 1; // ExposeConfiguration
164 unsigned propertyLocationConfiguration : 3; // PropertyLocationConfigura tion
164 }; 165 };
165 166
166 struct SymbolKeyedMethodConfiguration { 167 struct SymbolKeyedMethodConfiguration {
167 SymbolKeyedMethodConfiguration& operator=(const SymbolKeyedMethodConfigu ration&) = delete; 168 SymbolKeyedMethodConfiguration& operator=(const SymbolKeyedMethodConfigu ration&) = delete;
168 DISALLOW_ALLOCATION(); 169 DISALLOW_ALLOCATION();
169 v8::Local<v8::Name> methodName(v8::Isolate* isolate) const { return getS ymbol(isolate); } 170 v8::Local<v8::Name> methodName(v8::Isolate* isolate) const { return getS ymbol(isolate); }
170 v8::FunctionCallback callbackForWorld(const DOMWrapperWorld&) const 171 v8::FunctionCallback callbackForWorld(const DOMWrapperWorld&) const
171 { 172 {
172 return callback; 173 return callback;
173 } 174 }
174 175
175 v8::Local<v8::Symbol> (*getSymbol)(v8::Isolate*); 176 v8::Local<v8::Symbol> (*getSymbol)(v8::Isolate*);
176 v8::FunctionCallback callback; 177 v8::FunctionCallback callback;
177 // SymbolKeyedMethodConfiguration doesn't support per-world bindings. 178 // SymbolKeyedMethodConfiguration doesn't support per-world bindings.
178 int length; 179 int length;
179 ExposeConfiguration exposeConfiguration; 180 unsigned exposeConfiguration : 1; // ExposeConfiguration
181 unsigned propertyLocationConfiguration : 3; // PropertyLocationConfigura tion
180 }; 182 };
181 183
182 static void installMethods(v8::Isolate*, v8::Local<v8::ObjectTemplate> proto typeTemplate, v8::Local<v8::Signature>, v8::PropertyAttribute, const MethodConfi guration*, size_t callbackCount); 184 static void installMethods(v8::Isolate*, v8::Local<v8::ObjectTemplate> insta nceTemplate, v8::Local<v8::ObjectTemplate> prototypeTemplate, v8::Local<v8::Func tionTemplate> interfaceTemplate, v8::Local<v8::Signature>, v8::PropertyAttribute , const MethodConfiguration*, size_t methodCount);
183 185
184 static void installMethod(v8::Isolate*, v8::Local<v8::FunctionTemplate>, v8: :Local<v8::Signature>, v8::PropertyAttribute, const MethodConfiguration&); 186 static void installMethod(v8::Isolate*, v8::Local<v8::ObjectTemplate> instan ceTemplate, v8::Local<v8::ObjectTemplate> prototypeTemplate, v8::Local<v8::Funct ionTemplate> interfaceTemplate, v8::Local<v8::Signature>, v8::PropertyAttribute, const MethodConfiguration&);
185
186 static void installMethod(v8::Isolate*, v8::Local<v8::ObjectTemplate>, v8::L ocal<v8::Signature>, v8::PropertyAttribute, const MethodConfiguration&);
187 187
188 static void installMethod(v8::Isolate*, v8::Local<v8::ObjectTemplate>, v8::L ocal<v8::Signature>, v8::PropertyAttribute, const SymbolKeyedMethodConfiguration &); 188 static void installMethod(v8::Isolate*, v8::Local<v8::ObjectTemplate>, v8::L ocal<v8::Signature>, v8::PropertyAttribute, const SymbolKeyedMethodConfiguration &);
189 189
190 static v8::Local<v8::Signature> installDOMClassTemplate(v8::Isolate*, v8::Lo cal<v8::FunctionTemplate>, const char* interfaceName, v8::Local<v8::FunctionTemp late> parentClass, size_t fieldCount, 190 static v8::Local<v8::Signature> installDOMClassTemplate(v8::Isolate*, v8::Lo cal<v8::FunctionTemplate>, const char* interfaceName, v8::Local<v8::FunctionTemp late> parentClass, size_t fieldCount,
191 const AttributeConfiguration*, size_t attributeCount, 191 const AttributeConfiguration*, size_t attributeCount,
192 const AccessorConfiguration*, size_t accessorCount, 192 const AccessorConfiguration*, size_t accessorCount,
193 const MethodConfiguration*, size_t callbackCount); 193 const MethodConfiguration*, size_t methodCount);
194 194
195 static v8::Local<v8::FunctionTemplate> domClassTemplate(v8::Isolate*, Wrappe rTypeInfo*, void (*)(v8::Local<v8::FunctionTemplate>, v8::Isolate*)); 195 static v8::Local<v8::FunctionTemplate> domClassTemplate(v8::Isolate*, Wrappe rTypeInfo*, void (*)(v8::Local<v8::FunctionTemplate>, v8::Isolate*));
196 }; 196 };
197 197
198 } // namespace blink 198 } // namespace blink
199 199
200 #endif // V8DOMConfiguration_h 200 #endif // V8DOMConfiguration_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8DOMConfiguration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698