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

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

Issue 1316833003: bindings: Support (deprecated) Dictionary in IDL dictionary (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
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/Dictionary.h"
10 #include "bindings/core/v8/ExceptionState.h" 11 #include "bindings/core/v8/ExceptionState.h"
11 #include "bindings/core/v8/ScriptValue.h" 12 #include "bindings/core/v8/ScriptValue.h"
12 #include "bindings/core/v8/UnionTypesCore.h" 13 #include "bindings/core/v8/UnionTypesCore.h"
13 #include "bindings/core/v8/V8ArrayBufferView.h" 14 #include "bindings/core/v8/V8ArrayBufferView.h"
14 #include "bindings/core/v8/V8Element.h" 15 #include "bindings/core/v8/V8Element.h"
15 #include "bindings/core/v8/V8EventTarget.h" 16 #include "bindings/core/v8/V8EventTarget.h"
16 #include "bindings/core/v8/V8InternalDictionary.h" 17 #include "bindings/core/v8/V8InternalDictionary.h"
17 #include "bindings/core/v8/V8TestInterface.h" 18 #include "bindings/core/v8/V8TestInterface.h"
18 #include "bindings/core/v8/V8TestInterface2.h" 19 #include "bindings/core/v8/V8TestInterface2.h"
19 #include "bindings/core/v8/V8TestInterfaceGarbageCollected.h" 20 #include "bindings/core/v8/V8TestInterfaceGarbageCollected.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } else { 97 } else {
97 UseCounter::countDeprecationIfNotPrivateScript(isolate, callingExecu tionContext(isolate), UseCounter::CreateMember); 98 UseCounter::countDeprecationIfNotPrivateScript(isolate, callingExecu tionContext(isolate), UseCounter::CreateMember);
98 bool deprecatedCreateMember = toBoolean(isolate, deprecatedCreateMem berValue, exceptionState); 99 bool deprecatedCreateMember = toBoolean(isolate, deprecatedCreateMem berValue, exceptionState);
99 if (exceptionState.hadException()) 100 if (exceptionState.hadException())
100 return; 101 return;
101 impl.setCreateMember(deprecatedCreateMember); 102 impl.setCreateMember(deprecatedCreateMember);
102 } 103 }
103 } 104 }
104 105
105 { 106 {
107 v8::Local<v8::Value> dictionaryMemberValue;
108 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "dict ionaryMember")).ToLocal(&dictionaryMemberValue)) {
109 exceptionState.rethrowV8Exception(block.Exception());
110 return;
111 }
112 if (dictionaryMemberValue.IsEmpty() || dictionaryMemberValue->IsUndefine d()) {
113 // Do nothing.
114 } else {
115 Dictionary dictionaryMember = Dictionary(dictionaryMemberValue, isol ate, exceptionState);
116 if (exceptionState.hadException())
117 return;
118 if (!dictionaryMember.isObject()) {
119 exceptionState.throwTypeError("member dictionaryMember is not an object.");
120 return;
121 }
122 impl.setDictionaryMember(dictionaryMember);
123 }
124 }
125
126 {
106 v8::Local<v8::Value> doubleOrNullMemberValue; 127 v8::Local<v8::Value> doubleOrNullMemberValue;
107 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "doub leOrNullMember")).ToLocal(&doubleOrNullMemberValue)) { 128 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "doub leOrNullMember")).ToLocal(&doubleOrNullMemberValue)) {
108 exceptionState.rethrowV8Exception(block.Exception()); 129 exceptionState.rethrowV8Exception(block.Exception());
109 return; 130 return;
110 } 131 }
111 if (doubleOrNullMemberValue.IsEmpty() || doubleOrNullMemberValue->IsUnde fined()) { 132 if (doubleOrNullMemberValue.IsEmpty() || doubleOrNullMemberValue->IsUnde fined()) {
112 // Do nothing. 133 // Do nothing.
113 } else if (doubleOrNullMemberValue->IsNull()) { 134 } else if (doubleOrNullMemberValue->IsNull()) {
114 impl.setDoubleOrNullMemberToNull(); 135 impl.setDoubleOrNullMemberToNull();
115 } else { 136 } else {
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 if (impl.hasCreateMember()) { 670 if (impl.hasCreateMember()) {
650 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "create"), v8Boolean(impl.createMember(), isolate)))) 671 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "create"), v8Boolean(impl.createMember(), isolate))))
651 return false; 672 return false;
652 } 673 }
653 674
654 if (impl.hasCreateMember()) { 675 if (impl.hasCreateMember()) {
655 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "deprecatedCreateMember"), v8Boolean(impl.createMember (), isolate)))) 676 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "deprecatedCreateMember"), v8Boolean(impl.createMember (), isolate))))
656 return false; 677 return false;
657 } 678 }
658 679
680 if (impl.hasDictionaryMember()) {
681 ASSERT(impl.dictionaryMember().isObject());
682 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "dictionaryMember"), impl.dictionaryMember().v8Value() )))
683 return false;
684 }
685
659 if (impl.hasDoubleOrNullMember()) { 686 if (impl.hasDoubleOrNullMember()) {
660 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "doubleOrNullMember"), v8::Number::New(isolate, impl.d oubleOrNullMember())))) 687 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "doubleOrNullMember"), v8::Number::New(isolate, impl.d oubleOrNullMember()))))
661 return false; 688 return false;
662 } else { 689 } else {
663 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "doubleOrNullMember"), v8::Null(isolate)))) 690 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "doubleOrNullMember"), v8::Null(isolate))))
664 return false; 691 return false;
665 } 692 }
666 693
667 if (impl.hasDoubleOrStringMember()) { 694 if (impl.hasDoubleOrStringMember()) {
668 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "doubleOrStringMember"), toV8(impl.doubleOrStringMembe r(), creationContext, isolate)))) 695 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentCon text(), v8String(isolate, "doubleOrStringMember"), toV8(impl.doubleOrStringMembe r(), creationContext, isolate))))
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 } 870 }
844 871
845 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState) 872 TestDictionary NativeValueTraits<TestDictionary>::nativeValue(v8::Isolate* isola te, v8::Local<v8::Value> value, ExceptionState& exceptionState)
846 { 873 {
847 TestDictionary impl; 874 TestDictionary impl;
848 V8TestDictionary::toImpl(isolate, value, impl, exceptionState); 875 V8TestDictionary::toImpl(isolate, value, impl, exceptionState);
849 return impl; 876 return impl;
850 } 877 }
851 878
852 } // namespace blink 879 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/core/TestDictionary.h ('k') | Source/core/testing/DictionaryTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698