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

Side by Side Diff: Source/bindings/v8/CustomElementConstructorBuilder.cpp

Issue 39393004: IDL compiler: rename WrapperTypeInfo info => wrapperTypeInfo (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 /* 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 ScriptValue prototypeScriptValue; 76 ScriptValue prototypeScriptValue;
77 if (m_options->get("prototype", prototypeScriptValue) && !prototypeScriptVal ue.isNull()) { 77 if (m_options->get("prototype", prototypeScriptValue) && !prototypeScriptVal ue.isNull()) {
78 m_prototype = prototypeScriptValue.v8Value().As<v8::Object>(); 78 m_prototype = prototypeScriptValue.v8Value().As<v8::Object>();
79 if (m_prototype.IsEmpty()) { 79 if (m_prototype.IsEmpty()) {
80 CustomElementException::throwException(CustomElementException::Proto typeNotAnObject, type, es); 80 CustomElementException::throwException(CustomElementException::Proto typeNotAnObject, type, es);
81 return false; 81 return false;
82 } 82 }
83 } else { 83 } else {
84 m_prototype = v8::Object::New(); 84 m_prototype = v8::Object::New();
85 v8::Local<v8::Object> basePrototype = V8PerContextData::from(m_context)- >prototypeForType(&V8HTMLElement::info); 85 v8::Local<v8::Object> basePrototype = V8PerContextData::from(m_context)- >prototypeForType(&V8HTMLElement::wrapperTypeInfo);
86 if (!basePrototype.IsEmpty()) 86 if (!basePrototype.IsEmpty())
87 m_prototype->SetPrototype(basePrototype); 87 m_prototype->SetPrototype(basePrototype);
88 } 88 }
89 89
90 String extends; 90 String extends;
91 bool extendsProvidedAndNonNull = m_options->get("extends", extends); 91 bool extendsProvidedAndNonNull = m_options->get("extends", extends);
92 92
93 if (!V8PerContextData::from(m_context)) { 93 if (!V8PerContextData::from(m_context)) {
94 // FIXME: This should generate an InvalidContext exception at a later po int. 94 // FIXME: This should generate an InvalidContext exception at a later po int.
95 CustomElementException::throwException(CustomElementException::ContextDe stroyedCheckingPrototype, type, es); 95 CustomElementException::throwException(CustomElementException::ContextDe stroyedCheckingPrototype, type, es);
96 return false; 96 return false;
97 } 97 }
98 98
99 AtomicString namespaceURI = HTMLNames::xhtmlNamespaceURI; 99 AtomicString namespaceURI = HTMLNames::xhtmlNamespaceURI;
100 if (hasValidPrototypeChainFor(&V8SVGElement::info)) 100 if (hasValidPrototypeChainFor(&V8SVGElement::wrapperTypeInfo))
101 namespaceURI = SVGNames::svgNamespaceURI; 101 namespaceURI = SVGNames::svgNamespaceURI;
102 102
103 AtomicString localName; 103 AtomicString localName;
104 104
105 if (extendsProvidedAndNonNull) { 105 if (extendsProvidedAndNonNull) {
106 localName = extends.lower(); 106 localName = extends.lower();
107 107
108 if (!Document::isValidName(localName)) { 108 if (!Document::isValidName(localName)) {
109 CustomElementException::throwException(CustomElementException::Exten dsIsInvalidName, type, es); 109 CustomElementException::throwException(CustomElementException::Exten dsIsInvalidName, type, es);
110 return false; 110 return false;
111 } 111 }
112 if (CustomElement::isValidName(localName)) { 112 if (CustomElement::isValidName(localName)) {
113 CustomElementException::throwException(CustomElementException::Exten dsIsCustomElementName, type, es); 113 CustomElementException::throwException(CustomElementException::Exten dsIsCustomElementName, type, es);
114 return false; 114 return false;
115 } 115 }
116 } else { 116 } else {
117 localName = type; 117 localName = type;
118 } 118 }
119 119
120 if (!extendsProvidedAndNonNull) 120 if (!extendsProvidedAndNonNull)
121 m_wrapperType = &V8HTMLElement::info; 121 m_wrapperType = &V8HTMLElement::wrapperTypeInfo;
122 else if (namespaceURI == HTMLNames::xhtmlNamespaceURI) 122 else if (namespaceURI == HTMLNames::xhtmlNamespaceURI)
123 m_wrapperType = findWrapperTypeForHTMLTagName(localName); 123 m_wrapperType = findWrapperTypeForHTMLTagName(localName);
124 else 124 else
125 m_wrapperType = findWrapperTypeForSVGTagName(localName); 125 m_wrapperType = findWrapperTypeForSVGTagName(localName);
126 126
127 ASSERT(m_wrapperType); 127 ASSERT(m_wrapperType);
128 tagName = QualifiedName(nullAtom, localName, namespaceURI); 128 tagName = QualifiedName(nullAtom, localName, namespaceURI);
129 return m_wrapperType; 129 return m_wrapperType;
130 } 130 }
131 131
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 ExceptionState es(args.GetIsolate()); 274 ExceptionState es(args.GetIsolate());
275 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 275 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
276 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m aybeType->IsNull() ? nullAtom : type, es); 276 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m aybeType->IsNull() ? nullAtom : type, es);
277 if (es.throwIfNeeded()) 277 if (es.throwIfNeeded())
278 return; 278 return;
279 v8SetReturnValueFast(args, element.release(), document); 279 v8SetReturnValueFast(args, element.release(), document);
280 } 280 }
281 281
282 } // namespace WebCore 282 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestTypedefs.cpp ('k') | Source/bindings/v8/DOMWrapperWorld.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698