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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestPermissiveDictionary.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
11 // clang-format off 11 // clang-format off
12 #include "V8TestPermissiveDictionary.h" 12 #include "V8TestPermissiveDictionary.h"
13 13
14 #include "bindings/core/v8/ExceptionState.h" 14 #include "bindings/core/v8/ExceptionState.h"
15 #include "bindings/core/v8/IDLTypes.h" 15 #include "bindings/core/v8/IDLTypes.h"
16 #include "bindings/core/v8/NativeValueTraitsImpl.h" 16 #include "bindings/core/v8/NativeValueTraitsImpl.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 void V8TestPermissiveDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Valu e> v8Value, TestPermissiveDictionary& impl, ExceptionState& exceptionState) { 20 void V8TestPermissiveDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Valu e> v8Value, TestPermissiveDictionary& impl, ExceptionState& exceptionState) {
21 if (isUndefinedOrNull(v8Value)) { 21 if (isUndefinedOrNull(v8Value)) {
22 return; 22 return;
23 } 23 }
24 if (!v8Value->IsObject()) { 24 if (!v8Value->IsObject()) {
25 // Do nothing. 25 // Do nothing.
26 return; 26 return;
27 } 27 }
28 v8::Local<v8::Object> v8Object = v8Value.As<v8::Object>();
29 (void)v8Object;
28 30
29 v8::TryCatch block(isolate); 31 v8::TryCatch block(isolate);
30 v8::Local<v8::Object> v8Object;
31 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block)) {
32 exceptionState.rethrowV8Exception(block.Exception());
33 return;
34 }
35 v8::Local<v8::Value> booleanMemberValue; 32 v8::Local<v8::Value> booleanMemberValue;
36 if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "bool eanMember")).ToLocal(&booleanMemberValue)) { 33 if (!v8Object->Get(isolate->GetCurrentContext(), v8AtomicString(isolate, "bool eanMember")).ToLocal(&booleanMemberValue)) {
37 exceptionState.rethrowV8Exception(block.Exception()); 34 exceptionState.rethrowV8Exception(block.Exception());
38 return; 35 return;
39 } 36 }
40 if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) { 37 if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) {
41 // Do nothing. 38 // Do nothing.
42 } else { 39 } else {
43 bool booleanMember = NativeValueTraits<IDLBoolean>::nativeValue(isolate, boo leanMemberValue, exceptionState); 40 bool booleanMember = NativeValueTraits<IDLBoolean>::nativeValue(isolate, boo leanMemberValue, exceptionState);
44 if (exceptionState.hadException()) 41 if (exceptionState.hadException())
(...skipping 18 matching lines...) Expand all
63 return true; 60 return true;
64 } 61 }
65 62
66 TestPermissiveDictionary NativeValueTraits<TestPermissiveDictionary>::nativeValu e(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionSta te) { 63 TestPermissiveDictionary NativeValueTraits<TestPermissiveDictionary>::nativeValu e(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionSta te) {
67 TestPermissiveDictionary impl; 64 TestPermissiveDictionary impl;
68 V8TestPermissiveDictionary::toImpl(isolate, value, impl, exceptionState); 65 V8TestPermissiveDictionary::toImpl(isolate, value, impl, exceptionState);
69 return impl; 66 return impl;
70 } 67 }
71 68
72 } // namespace blink 69 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698