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

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

Issue 1130763006: IDL: Add any support to IDL dictionary and use it in CustomEventInit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/tests/results/core/TestDictionary.h ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestDictionary.h" 8 #include "V8TestDictionary.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
(...skipping 20 matching lines...) Expand all
31 return; 31 return;
32 } 32 }
33 33
34 v8::TryCatch block; 34 v8::TryCatch block;
35 v8::Local<v8::Object> v8Object; 35 v8::Local<v8::Object> v8Object;
36 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block )) { 36 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block )) {
37 exceptionState.rethrowV8Exception(block.Exception()); 37 exceptionState.rethrowV8Exception(block.Exception());
38 return; 38 return;
39 } 39 }
40 { 40 {
41 v8::Local<v8::Value> anyMemberValue;
42 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "anyM ember")).ToLocal(&anyMemberValue)) {
43 exceptionState.rethrowV8Exception(block.Exception());
44 return;
45 }
46 if (anyMemberValue.IsEmpty() || anyMemberValue->IsUndefined()) {
47 // Do nothing.
48 } else {
49 ScriptValue anyMember = ScriptValue(ScriptState::current(isolate), a nyMemberValue);
50 impl.setAnyMember(anyMember);
51 }
52 }
53
54 {
41 v8::Local<v8::Value> booleanMemberValue; 55 v8::Local<v8::Value> booleanMemberValue;
42 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "bool eanMember")).ToLocal(&booleanMemberValue)) { 56 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "bool eanMember")).ToLocal(&booleanMemberValue)) {
43 exceptionState.rethrowV8Exception(block.Exception()); 57 exceptionState.rethrowV8Exception(block.Exception());
44 return; 58 return;
45 } 59 }
46 if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) { 60 if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) {
47 // Do nothing. 61 // Do nothing.
48 } else { 62 } else {
49 bool booleanMember = toBoolean(isolate, booleanMemberValue, exceptio nState); 63 bool booleanMember = toBoolean(isolate, booleanMemberValue, exceptio nState);
50 if (exceptionState.hadException()) 64 if (exceptionState.hadException())
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 { 561 {
548 v8::Local<v8::Object> v8Object = v8::Object::New(isolate); 562 v8::Local<v8::Object> v8Object = v8::Object::New(isolate);
549 if (!toV8TestDictionary(impl, v8Object, creationContext, isolate)) 563 if (!toV8TestDictionary(impl, v8Object, creationContext, isolate))
550 return v8::Local<v8::Value>(); 564 return v8::Local<v8::Value>();
551 return v8Object; 565 return v8Object;
552 } 566 }
553 567
554 bool toV8TestDictionary(const TestDictionary& impl, v8::Local<v8::Object> dictio nary, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) 568 bool toV8TestDictionary(const TestDictionary& impl, v8::Local<v8::Object> dictio nary, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
555 { 569 {
556 // TODO(bashi): Use ForceSet() instead of Set(). http://crbug.com/476720 570 // TODO(bashi): Use ForceSet() instead of Set(). http://crbug.com/476720
571 if (impl.hasAnyMember()) {
572 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin g(isolate, "anyMember"), impl.anyMember().v8Value())))
573 return false;
574 } else {
575 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin g(isolate, "anyMember"), v8::Null(isolate))))
576 return false;
577 }
578
557 if (impl.hasBooleanMember()) { 579 if (impl.hasBooleanMember()) {
558 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin g(isolate, "booleanMember"), v8Boolean(impl.booleanMember(), isolate)))) 580 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin g(isolate, "booleanMember"), v8Boolean(impl.booleanMember(), isolate))))
559 return false; 581 return false;
560 } 582 }
561 583
562 if (impl.hasCreateMember()) { 584 if (impl.hasCreateMember()) {
563 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin g(isolate, "create"), v8Boolean(impl.createMember(), isolate)))) 585 if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8Strin g(isolate, "create"), v8Boolean(impl.createMember(), isolate))))
564 return false; 586 return false;
565 } 587 }
566 588
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 } 746 }
725 747
726 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState) 748 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState)
727 { 749 {
728 TestDictionary impl; 750 TestDictionary impl;
729 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); 751 V8TestDictionary::toImpl(isolate, value, impl, exceptionState);
730 return impl; 752 return impl;
731 } 753 }
732 754
733 } // namespace blink 755 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/core/TestDictionary.h ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698