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

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

Issue 483163003: Introduce ES6 iterator for DOM objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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) 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 v8::Handle<v8::FunctionTemplate> V8DOMConfiguration::functionTemplateForMethod(v 8::Handle<v8::Signature> signature, const MethodConfiguration& callback, v8::Iso late* isolate) 110 v8::Handle<v8::FunctionTemplate> V8DOMConfiguration::functionTemplateForMethod(v 8::Handle<v8::Signature> signature, const MethodConfiguration& callback, v8::Iso late* isolate)
111 { 111 {
112 v8::FunctionCallback functionCallback = callback.callback; 112 v8::FunctionCallback functionCallback = callback.callback;
113 if (DOMWrapperWorld::current(isolate).isMainWorld() && callback.callbackForM ainWorld) 113 if (DOMWrapperWorld::current(isolate).isMainWorld() && callback.callbackForM ainWorld)
114 functionCallback = callback.callbackForMainWorld; 114 functionCallback = callback.callbackForMainWorld;
115 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New (isolate, functionCallback, v8Undefined(), signature, callback.length); 115 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New (isolate, functionCallback, v8Undefined(), signature, callback.length);
116 functionTemplate->RemovePrototype(); 116 functionTemplate->RemovePrototype();
117 return functionTemplate; 117 return functionTemplate;
118 } 118 }
119 119
120 v8::Handle<v8::FunctionTemplate> V8DOMConfiguration::functionTemplateForMethod(v 8::Handle<v8::Signature> signature, const SymbolKeyedMethodConfiguration& callba ck, v8::Isolate* isolate)
Jens Widell 2014/08/21 13:58:01 This is identical to the other functionTemplateFor
yhirano 2014/08/25 06:09:26 Done.
121 {
122 v8::FunctionCallback functionCallback = callback.callback;
123 if (DOMWrapperWorld::current(isolate).isMainWorld() && callback.callbackForM ainWorld)
124 functionCallback = callback.callbackForMainWorld;
125 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New (isolate, functionCallback, v8Undefined(), signature, callback.length);
126 functionTemplate->RemovePrototype();
127 return functionTemplate;
128 }
129
120 v8::Local<v8::Signature> V8DOMConfiguration::installDOMClassTemplate(v8::Handle< v8::FunctionTemplate> functionDescriptor, const char* interfaceName, v8::Handle< v8::FunctionTemplate> parentClass, size_t fieldCount, 130 v8::Local<v8::Signature> V8DOMConfiguration::installDOMClassTemplate(v8::Handle< v8::FunctionTemplate> functionDescriptor, const char* interfaceName, v8::Handle< v8::FunctionTemplate> parentClass, size_t fieldCount,
121 const AttributeConfiguration* attributes, size_t attributeCount, 131 const AttributeConfiguration* attributes, size_t attributeCount,
122 const AccessorConfiguration* accessors, size_t accessorCount, 132 const AccessorConfiguration* accessors, size_t accessorCount,
123 const MethodConfiguration* callbacks, size_t callbackCount, 133 const MethodConfiguration* callbacks, size_t callbackCount,
124 v8::Isolate* isolate) 134 v8::Isolate* isolate)
125 { 135 {
126 functionDescriptor->SetClassName(v8AtomicString(isolate, interfaceName)); 136 functionDescriptor->SetClassName(v8AtomicString(isolate, interfaceName));
127 v8::Local<v8::ObjectTemplate> instanceTemplate = functionDescriptor->Instanc eTemplate(); 137 v8::Local<v8::ObjectTemplate> instanceTemplate = functionDescriptor->Instanc eTemplate();
128 instanceTemplate->SetInternalFieldCount(fieldCount); 138 instanceTemplate->SetInternalFieldCount(fieldCount);
129 if (!parentClass.IsEmpty()) { 139 if (!parentClass.IsEmpty()) {
(...skipping 23 matching lines...) Expand all
153 return result; 163 return result;
154 164
155 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); 165 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate");
156 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons tructorMode); 166 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons tructorMode);
157 configureDOMClassTemplate(result, isolate); 167 configureDOMClassTemplate(result, isolate);
158 data->setDOMTemplate(wrapperTypeInfo, result); 168 data->setDOMTemplate(wrapperTypeInfo, result);
159 return result; 169 return result;
160 } 170 }
161 171
162 } // namespace blink 172 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698