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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceEventConstructor.cpp

Issue 210663003: Use |isolate| local variable in bindings, clean up comments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update extension Created 6 years, 9 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 // Copyright 2014 The Chromium Authors. All rights reserved.
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be
3 * 3 // found in the LICENSE file.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30 4
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
32 6
33 #include "config.h" 7 #include "config.h"
34 #include "V8TestInterfaceEventConstructor.h" 8 #include "V8TestInterfaceEventConstructor.h"
35 9
36 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
37 #include "V8TestInterfaceEmpty.h" 11 #include "V8TestInterfaceEmpty.h"
38 #include "bindings/v8/Dictionary.h" 12 #include "bindings/v8/Dictionary.h"
39 #include "bindings/v8/ExceptionState.h" 13 #include "bindings/v8/ExceptionState.h"
40 #include "bindings/v8/ScriptValue.h" 14 #include "bindings/v8/ScriptValue.h"
41 #include "bindings/v8/SerializedScriptValue.h" 15 #include "bindings/v8/SerializedScriptValue.h"
(...skipping 14 matching lines...) Expand all
56 static void initializeScriptWrappableForInterface(TestInterfaceEventConstructor* object) 30 static void initializeScriptWrappableForInterface(TestInterfaceEventConstructor* object)
57 { 31 {
58 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) 32 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
59 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceEventConstr uctor::wrapperTypeInfo); 33 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceEventConstr uctor::wrapperTypeInfo);
60 else 34 else
61 ASSERT_NOT_REACHED(); 35 ASSERT_NOT_REACHED();
62 } 36 }
63 37
64 } // namespace WebCore 38 } // namespace WebCore
65 39
66 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows:
67 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
68 // in the global namespace.
69 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c)
70 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceEventCon structor* object) 40 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceEventCon structor* object)
71 { 41 {
72 WebCore::initializeScriptWrappableForInterface(object); 42 WebCore::initializeScriptWrappableForInterface(object);
73 } 43 }
74 44
75 namespace WebCore { 45 namespace WebCore {
76 const WrapperTypeInfo V8TestInterfaceEventConstructor::wrapperTypeInfo = { gin:: kEmbedderBlink, V8TestInterfaceEventConstructor::domTemplate, V8TestInterfaceEve ntConstructor::derefObject, 0, 0, 0, V8TestInterfaceEventConstructor::installPer ContextEnabledMethods, &V8Event::wrapperTypeInfo, WrapperTypeObjectPrototype, fa lse }; 46 const WrapperTypeInfo V8TestInterfaceEventConstructor::wrapperTypeInfo = { gin:: kEmbedderBlink, V8TestInterfaceEventConstructor::domTemplate, V8TestInterfaceEve ntConstructor::derefObject, 0, 0, 0, V8TestInterfaceEventConstructor::installPer ContextEnabledMethods, &V8Event::wrapperTypeInfo, WrapperTypeObjectPrototype, fa lse };
77 47
78 namespace TestInterfaceEventConstructorV8Internal { 48 namespace TestInterfaceEventConstructorV8Internal {
79 49
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 static void deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAt tributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallback Info<v8::Value>& info) 229 static void deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAt tributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallback Info<v8::Value>& info)
260 { 230 {
261 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 231 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
262 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use Counter::initializedByEventConstructorReadonlyStringAttribute); 232 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use Counter::initializedByEventConstructorReadonlyStringAttribute);
263 TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedB yEventConstructorReadonlyStringAttributeAttributeGetter(info); 233 TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedB yEventConstructorReadonlyStringAttributeAttributeGetter(info);
264 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 234 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
265 } 235 }
266 236
267 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 237 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
268 { 238 {
269 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceEventConstructor", info.Holder(), info.GetIsolate()); 239 v8::Isolate* isolate = info.GetIsolate();
240 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceEventConstructor", info.Holder(), isolate);
270 if (info.Length() < 1) { 241 if (info.Length() < 1) {
271 exceptionState.throwTypeError("An event name must be provided."); 242 exceptionState.throwTypeError("An event name must be provided.");
272 exceptionState.throwIfNeeded(); 243 exceptionState.throwIfNeeded();
273 return; 244 return;
274 } 245 }
275 246
276 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); 247 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
277 v8::Local<v8::Value> initializedByEventConstructorReadonlyAnyAttribute; 248 v8::Local<v8::Value> initializedByEventConstructorReadonlyAnyAttribute;
278 TestInterfaceEventConstructorInit eventInit; 249 TestInterfaceEventConstructorInit eventInit;
279 if (info.Length() >= 2) { 250 if (info.Length() >= 2) {
280 V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate ())); 251 V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], isolate));
281 if (!initializeTestInterfaceEventConstructor(eventInit, options, excepti onState, info)) { 252 if (!initializeTestInterfaceEventConstructor(eventInit, options, excepti onState, info)) {
282 exceptionState.throwIfNeeded(); 253 exceptionState.throwIfNeeded();
283 return; 254 return;
284 } 255 }
285 options.get("initializedByEventConstructorReadonlyAnyAttribute", initial izedByEventConstructorReadonlyAnyAttribute); 256 options.get("initializedByEventConstructorReadonlyAnyAttribute", initial izedByEventConstructorReadonlyAnyAttribute);
286 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty()) 257 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty())
287 V8HiddenValue::setHiddenValue(info.GetIsolate(), info.Holder(), v8At omicString(info.GetIsolate(), "initializedByEventConstructorReadonlyAnyAttribute "), initializedByEventConstructorReadonlyAnyAttribute); 258 V8HiddenValue::setHiddenValue(isolate, info.Holder(), v8AtomicString (isolate, "initializedByEventConstructorReadonlyAnyAttribute"), initializedByEve ntConstructorReadonlyAnyAttribute);
288 } 259 }
289 RefPtr<TestInterfaceEventConstructor> event = TestInterfaceEventConstructor: :create(type, eventInit, exceptionState); 260 RefPtr<TestInterfaceEventConstructor> event = TestInterfaceEventConstructor: :create(type, eventInit, exceptionState);
290 if (exceptionState.throwIfNeeded()) 261 if (exceptionState.throwIfNeeded())
291 return; 262 return;
292 if (DOMWrapperWorld::current(info.GetIsolate())->isIsolatedWorld()) { 263 if (DOMWrapperWorld::current(isolate)->isIsolatedWorld()) {
293 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty()) 264 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty())
294 event->setSerializedInitializedByEventConstructorReadonlyAnyAttribut e(SerializedScriptValue::createAndSwallowExceptions(initializedByEventConstructo rReadonlyAnyAttribute, info.GetIsolate())); 265 event->setSerializedInitializedByEventConstructorReadonlyAnyAttribut e(SerializedScriptValue::createAndSwallowExceptions(initializedByEventConstructo rReadonlyAnyAttribute, isolate));
295 } 266 }
296 267
297 v8::Handle<v8::Object> wrapper = info.Holder(); 268 v8::Handle<v8::Object> wrapper = info.Holder();
298 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventConstructor>(ev ent.release(), &V8TestInterfaceEventConstructor::wrapperTypeInfo, wrapper, info. GetIsolate(), WrapperConfiguration::Independent); 269 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventConstructor>(ev ent.release(), &V8TestInterfaceEventConstructor::wrapperTypeInfo, wrapper, isola te, WrapperConfiguration::Independent);
299 v8SetReturnValue(info, wrapper); 270 v8SetReturnValue(info, wrapper);
300 } 271 }
301 272
302 } // namespace TestInterfaceEventConstructorV8Internal 273 } // namespace TestInterfaceEventConstructorV8Internal
303 274
304 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceEventCons tructorAttributes[] = { 275 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceEventCons tructorAttributes[] = {
305 {"readonlyStringAttribute", TestInterfaceEventConstructorV8Internal::readonl yStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContr ol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 276 {"readonlyStringAttribute", TestInterfaceEventConstructorV8Internal::readonl yStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessContr ol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
306 {"initializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventC onstructorV8Internal::initializedByEventConstructorReadonlyStringAttributeAttrib uteGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stat ic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 277 {"initializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventC onstructorV8Internal::initializedByEventConstructorReadonlyStringAttributeAttrib uteGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stat ic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
307 {"initializedByEventConstructorReadonlyAnyAttribute", TestInterfaceEventCons tructorV8Internal::initializedByEventConstructorReadonlyAnyAttributeAttributeGet terCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 278 {"initializedByEventConstructorReadonlyAnyAttribute", TestInterfaceEventCons tructorV8Internal::initializedByEventConstructorReadonlyAnyAttributeAttributeGet terCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cas t<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
308 {"initializedByEventConstructorReadonlyBooleanAttribute", TestInterfaceEvent ConstructorV8Internal::initializedByEventConstructorReadonlyBooleanAttributeAttr ibuteGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 279 {"initializedByEventConstructorReadonlyBooleanAttribute", TestInterfaceEvent ConstructorV8Internal::initializedByEventConstructorReadonlyBooleanAttributeAttr ibuteGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 fromInternalPointer(object)->deref(); 413 fromInternalPointer(object)->deref();
443 } 414 }
444 415
445 template<> 416 template<>
446 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventConstructor* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate) 417 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventConstructor* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate)
447 { 418 {
448 return toV8(impl, creationContext, isolate); 419 return toV8(impl, creationContext, isolate);
449 } 420 }
450 421
451 } // namespace WebCore 422 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698