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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp

Issue 2748353003: [Bindings] Remove redundant ToObject invocation in dictionary toImpl. (Closed)
Patch Set: cast directly after check Created 3 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. 5 // This file has been auto-generated by code_generator_v8.py.
6 // DO NOT MODIFY! 6 // DO NOT MODIFY!
7 7
8 // This file has been generated from the Jinja2 template in 8 // This file has been generated from the Jinja2 template in
9 // third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl 9 // third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl
10 10
(...skipping 21 matching lines...) Expand all
32 namespace blink { 32 namespace blink {
33 33
34 void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value , TestDictionary& impl, ExceptionState& exceptionState) { 34 void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value , TestDictionary& impl, ExceptionState& exceptionState) {
35 if (isUndefinedOrNull(v8Value)) { 35 if (isUndefinedOrNull(v8Value)) {
36 return; 36 return;
37 } 37 }
38 if (!v8Value->IsObject()) { 38 if (!v8Value->IsObject()) {
39 exceptionState.throwTypeError("cannot convert to dictionary."); 39 exceptionState.throwTypeError("cannot convert to dictionary.");
40 return; 40 return;
41 } 41 }
42 v8::Local<v8::Object> v8Object = v8Value.As<v8::Object>();
43 (void)v8Object;
42 44
43 v8::TryCatch block(isolate); 45 v8::TryCatch block(isolate);
44 v8::Local<v8::Object> v8Object;
45 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block)) {
46 exceptionState.rethrowV8Exception(block.Exception());
47 return;
48 }
49 v8::Local<v8::Value> anyMemberValue; 46 v8::Local<v8::Value> anyMemberValue;
50 if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "anyM ember")).ToLocal(&anyMemberValue)) { 47 if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "anyM ember")).ToLocal(&anyMemberValue)) {
51 exceptionState.rethrowV8Exception(block.Exception()); 48 exceptionState.rethrowV8Exception(block.Exception());
52 return; 49 return;
53 } 50 }
54 if (anyMemberValue.IsEmpty() || anyMemberValue->IsUndefined()) { 51 if (anyMemberValue.IsEmpty() || anyMemberValue->IsUndefined()) {
55 // Do nothing. 52 // Do nothing.
56 } else { 53 } else {
57 ScriptValue anyMember = ScriptValue(ScriptState::current(isolate), anyMember Value); 54 ScriptValue anyMember = ScriptValue(ScriptState::current(isolate), anyMember Value);
58 impl.setAnyMember(anyMember); 55 impl.setAnyMember(anyMember);
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 return true; 886 return true;
890 } 887 }
891 888
892 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState) { 889 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
893 TestDictionary impl; 890 TestDictionary impl;
894 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); 891 V8TestDictionary::toImpl(isolate, value, impl, exceptionState);
895 return impl; 892 return impl;
896 } 893 }
897 894
898 } // namespace blink 895 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698