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

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

Issue 111373003: Migrate bindings constructors to the new ExceptionState model. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Ugh. Created 7 years 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 18 matching lines...) Expand all
29 */ 29 */
30 30
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
32 32
33 #include "config.h" 33 #include "config.h"
34 #include "V8TestInterfaceEventConstructor.h" 34 #include "V8TestInterfaceEventConstructor.h"
35 35
36 #include "RuntimeEnabledFeatures.h" 36 #include "RuntimeEnabledFeatures.h"
37 #include "bindings/v8/Dictionary.h" 37 #include "bindings/v8/Dictionary.h"
38 #include "bindings/v8/ExceptionMessages.h" 38 #include "bindings/v8/ExceptionMessages.h"
39 #include "bindings/v8/ExceptionState.h"
40 #include "bindings/v8/ScriptValue.h" 39 #include "bindings/v8/ScriptValue.h"
41 #include "bindings/v8/SerializedScriptValue.h" 40 #include "bindings/v8/SerializedScriptValue.h"
42 #include "bindings/v8/V8DOMConfiguration.h" 41 #include "bindings/v8/V8DOMConfiguration.h"
43 #include "bindings/v8/V8ObjectConstructor.h" 42 #include "bindings/v8/V8ObjectConstructor.h"
44 #include "core/dom/ContextFeatures.h" 43 #include "core/dom/ContextFeatures.h"
45 #include "core/dom/Document.h" 44 #include "core/dom/Document.h"
46 #include "core/frame/UseCounter.h" 45 #include "core/frame/UseCounter.h"
47 #include "platform/TraceEvent.h" 46 #include "platform/TraceEvent.h"
48 47
49 namespace WebCore { 48 namespace WebCore {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 static void deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAt tributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallback Info<v8::Value>& info) 148 static void deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAt tributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallback Info<v8::Value>& info)
150 { 149 {
151 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
152 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::initializ edByEventConstructorReadonlyStringAttribute); 151 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::initializ edByEventConstructorReadonlyStringAttribute);
153 TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedB yEventConstructorReadonlyStringAttributeAttributeGetter(info); 152 TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedB yEventConstructorReadonlyStringAttributeAttributeGetter(info);
154 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 153 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
155 } 154 }
156 155
157 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 156 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
158 { 157 {
158 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceEventConstructor", info.Holder(), info.GetIsolate());
159 if (info.Length() < 1) { 159 if (info.Length() < 1) {
160 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceEventC onstructor", "An event name must be provided."), info.GetIsolate()); 160 exceptionState.throwTypeError("An event name must be provided.");
161 exceptionState.throwIfNeeded();
161 return; 162 return;
162 } 163 }
163 164
164 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); 165 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
165 v8::Local<v8::Value> initializedByEventConstructorReadonlyAnyAttribute; 166 v8::Local<v8::Value> initializedByEventConstructorReadonlyAnyAttribute;
166 TestInterfaceEventConstructorInit eventInit; 167 TestInterfaceEventConstructorInit eventInit;
167 if (info.Length() >= 2) { 168 if (info.Length() >= 2) {
168 V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate ())); 169 V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate ()));
169 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
170 if (!initializeTestInterfaceEventConstructor(eventInit, options, excepti onState)) { 170 if (!initializeTestInterfaceEventConstructor(eventInit, options, excepti onState)) {
171 exceptionState.throwIfNeeded(); 171 exceptionState.throwIfNeeded();
172 return; 172 return;
173 } 173 }
174 options.get("initializedByEventConstructorReadonlyAnyAttribute", initial izedByEventConstructorReadonlyAnyAttribute); 174 options.get("initializedByEventConstructorReadonlyAnyAttribute", initial izedByEventConstructorReadonlyAnyAttribute);
175 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty()) 175 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty())
176 info.Holder()->SetHiddenValue(V8HiddenPropertyName::initializedByEve ntConstructorReadonlyAnyAttribute(info.GetIsolate()), initializedByEventConstruc torReadonlyAnyAttribute); 176 info.Holder()->SetHiddenValue(V8HiddenPropertyName::initializedByEve ntConstructorReadonlyAnyAttribute(info.GetIsolate()), initializedByEventConstruc torReadonlyAnyAttribute);
177 } 177 }
178 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
179 RefPtr<TestInterfaceEventConstructor> event = TestInterfaceEventConstructor: :create(type, eventInit, exceptionState); 178 RefPtr<TestInterfaceEventConstructor> event = TestInterfaceEventConstructor: :create(type, eventInit, exceptionState);
180 if (exceptionState.throwIfNeeded()) 179 if (exceptionState.throwIfNeeded())
181 return; 180 return;
182 if (isolatedWorldForIsolate(info.GetIsolate())) { 181 if (isolatedWorldForIsolate(info.GetIsolate())) {
183 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty()) 182 if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty())
184 event->setSerializedInitializedByEventConstructorReadonlyAnyAttribut e(SerializedScriptValue::createAndSwallowExceptions(initializedByEventConstructo rReadonlyAnyAttribute, info.GetIsolate())); 183 event->setSerializedInitializedByEventConstructorReadonlyAnyAttribut e(SerializedScriptValue::createAndSwallowExceptions(initializedByEventConstructo rReadonlyAnyAttribute, info.GetIsolate()));
185 } 184 }
186 185
187 v8::Handle<v8::Object> wrapper = info.Holder(); 186 v8::Handle<v8::Object> wrapper = info.Holder();
188 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventConstructor>(ev ent.release(), &V8TestInterfaceEventConstructor::wrapperTypeInfo, wrapper, info. GetIsolate(), WrapperConfiguration::Dependent); 187 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventConstructor>(ev ent.release(), &V8TestInterfaceEventConstructor::wrapperTypeInfo, wrapper, info. GetIsolate(), WrapperConfiguration::Dependent);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 fromInternalPointer(object)->deref(); 312 fromInternalPointer(object)->deref();
314 } 313 }
315 314
316 template<> 315 template<>
317 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventConstructor* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate) 316 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventConstructor* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate)
318 { 317 {
319 return toV8(impl, creationContext, isolate); 318 return toV8(impl, creationContext, isolate);
320 } 319 }
321 320
322 } // namespace WebCore 321 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfaceConstructor.cpp ('k') | Source/bindings/v8/Dictionary.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698