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

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

Issue 196343032: Implement ImageData constructors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Generate code that custom wrap()s constructor instances 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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 template <typename T> void V8_USE(T) { } 74 template <typename T> void V8_USE(T) { }
75 75
76 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 76 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
77 { 77 {
78 if (UNLIKELY(info.Length() < 1)) { 78 if (UNLIKELY(info.Length() < 1)) {
79 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr uctor3", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsola te()); 79 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr uctor3", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsola te());
80 return; 80 return;
81 } 81 }
82 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[0]) ; 82 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, stringArg, info[0]) ;
83 RefPtr<TestInterfaceConstructor3> impl = TestInterfaceConstructor3::create(s tringArg); 83 RefPtr<TestInterfaceConstructor3> impl = TestInterfaceConstructor3::create(s tringArg);
84
84 v8::Handle<v8::Object> wrapper = info.Holder(); 85 v8::Handle<v8::Object> wrapper = info.Holder();
85 86 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor3>(impl.r elease(), &V8TestInterfaceConstructor3::wrapperTypeInfo, wrapper, info.GetIsolat e(), WrapperConfiguration::Independent);
86 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor3>(impl.r elease(), &V8TestInterfaceConstructor3::wrapperTypeInfo, wrapper, info.GetIsolat e(), WrapperConfiguration::Dependent);
87 v8SetReturnValue(info, wrapper); 87 v8SetReturnValue(info, wrapper);
88 } 88 }
89 89
90 } // namespace TestInterfaceConstructor3V8Internal 90 } // namespace TestInterfaceConstructor3V8Internal
91 91
92 void V8TestInterfaceConstructor3::constructorCallback(const v8::FunctionCallback Info<v8::Value>& info) 92 void V8TestInterfaceConstructor3::constructorCallback(const v8::FunctionCallback Info<v8::Value>& info)
93 { 93 {
94 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); 94 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
95 if (!info.IsConstructCall()) { 95 if (!info.IsConstructCall()) {
96 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr uctor3", "Please use the 'new' operator, this DOM object constructor cannot be c alled as a function."), info.GetIsolate()); 96 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr uctor3", "Please use the 'new' operator, this DOM object constructor cannot be c alled as a function."), info.GetIsolate());
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 fromInternalPointer(object)->deref(); 178 fromInternalPointer(object)->deref();
179 } 179 }
180 180
181 template<> 181 template<>
182 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor3* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate) 182 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor3* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate)
183 { 183 {
184 return toV8(impl, creationContext, isolate); 184 return toV8(impl, creationContext, isolate);
185 } 185 }
186 186
187 } // namespace WebCore 187 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698