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

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

Issue 99083002: WIP: Migrate generated bindings to new ExceptionState constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: MessagePort. 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
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 namespace WebCore { 78 namespace WebCore {
79 const WrapperTypeInfo V8Float64Array::wrapperTypeInfo = { gin::kEmbedderBlink, V 8Float64Array::GetTemplate, V8Float64Array::derefObject, 0, 0, 0, V8Float64Array ::installPerContextEnabledMethods, &V8ArrayBufferView::wrapperTypeInfo, WrapperT ypeObjectPrototype }; 79 const WrapperTypeInfo V8Float64Array::wrapperTypeInfo = { gin::kEmbedderBlink, V 8Float64Array::GetTemplate, V8Float64Array::derefObject, 0, 0, 0, V8Float64Array ::installPerContextEnabledMethods, &V8ArrayBufferView::wrapperTypeInfo, WrapperT ypeObjectPrototype };
80 80
81 namespace Float64ArrayV8Internal { 81 namespace Float64ArrayV8Internal {
82 82
83 template <typename T> void V8_USE(T) { } 83 template <typename T> void V8_USE(T) { }
84 84
85 static void fooMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 85 static void fooMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
86 { 86 {
87 ExceptionState exceptionState(ExceptionState::ExecutionContext, "foo", "Floa t64Array", info.Holder(), info.GetIsolate());
87 if (UNLIKELY(info.Length() < 1)) { 88 if (UNLIKELY(info.Length() < 1)) {
88 throwTypeError(ExceptionMessages::failedToExecute("foo", "Float64Array", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate()); 89 throwTypeError(ExceptionMessages::failedToExecute("foo", "Float64Array", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
sof 2013/12/03 16:04:29 Not for here, but reusing the exceptionState above
Mike West 2013/12/04 08:42:19 Yes. I'll fix these in a subsequent CL (or you can
89 return; 90 return;
90 } 91 }
91 Float64Array* imp = V8Float64Array::toNative(info.Holder()); 92 Float64Array* imp = V8Float64Array::toNative(info.Holder());
92 V8TRYCATCH_VOID(Float32Array*, array, info[0]->IsFloat32Array() ? V8Float32A rray::toNative(v8::Handle<v8::Float32Array>::Cast(info[0])) : 0); 93 V8TRYCATCH_VOID(Float32Array*, array, info[0]->IsFloat32Array() ? V8Float32A rray::toNative(v8::Handle<v8::Float32Array>::Cast(info[0])) : 0);
93 v8SetReturnValue(info, imp->foo(array)); 94 v8SetReturnValue(info, imp->foo(array));
94 } 95 }
95 96
96 static void fooMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 97 static void fooMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
97 { 98 {
98 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 99 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
99 Float64ArrayV8Internal::fooMethod(info); 100 Float64ArrayV8Internal::fooMethod(info);
100 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 101 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
101 } 102 }
102 103
103 static void setMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 104 static void setMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
104 { 105 {
106 ExceptionState exceptionState(ExceptionState::ExecutionContext, "set", "Floa t64Array", info.Holder(), info.GetIsolate());
105 setWebGLArrayHelper<Float64Array, V8Float64Array>(info); 107 setWebGLArrayHelper<Float64Array, V8Float64Array>(info);
106 } 108 }
107 109
108 static void setMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 110 static void setMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
109 { 111 {
110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 112 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
111 Float64ArrayV8Internal::setMethod(info); 113 Float64ArrayV8Internal::setMethod(info);
112 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 114 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
113 } 115 }
114 116
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 fromInternalPointer(object)->deref(); 242 fromInternalPointer(object)->deref();
241 } 243 }
242 244
243 template<> 245 template<>
244 v8::Handle<v8::Value> toV8NoInline(Float64Array* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 246 v8::Handle<v8::Value> toV8NoInline(Float64Array* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
245 { 247 {
246 return toV8(impl, creationContext, isolate); 248 return toV8(impl, creationContext, isolate);
247 } 249 }
248 250
249 } // namespace WebCore 251 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698