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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinitionBuilder.cpp

Issue 2316263003: Add toImplSequence() (Closed)
Patch Set: comments Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "bindings/core/v8/ScriptCustomElementDefinitionBuilder.h" 5 #include "bindings/core/v8/ScriptCustomElementDefinitionBuilder.h"
6 6
7 #include "bindings/core/v8/DOMWrapperWorld.h" 7 #include "bindings/core/v8/DOMWrapperWorld.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptCustomElementDefinition.h" 9 #include "bindings/core/v8/ScriptCustomElementDefinition.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 return true; 131 return true;
132 } 132 }
133 133
134 bool ScriptCustomElementDefinitionBuilder::retrieveObservedAttributes() 134 bool ScriptCustomElementDefinitionBuilder::retrieveObservedAttributes()
135 { 135 {
136 v8::Local<v8::Value> observedAttributesValue; 136 v8::Local<v8::Value> observedAttributesValue;
137 if (!valueForName(m_constructor, "observedAttributes", observedAttributesVal ue)) 137 if (!valueForName(m_constructor, "observedAttributes", observedAttributesVal ue))
138 return false; 138 return false;
139 if (observedAttributesValue->IsUndefined()) 139 if (observedAttributesValue->IsUndefined())
140 return true; 140 return true;
141 Vector<AtomicString> list = toImplArray<Vector<AtomicString>>( 141 Vector<AtomicString> list = toImplSequence<Vector<AtomicString>>(
142 observedAttributesValue, 0, m_scriptState->isolate(), m_exceptionState); 142 m_scriptState->isolate(), observedAttributesValue, m_exceptionState);
143 if (m_exceptionState.hadException()) 143 if (m_exceptionState.hadException())
144 return false; 144 return false;
145 if (list.isEmpty()) 145 if (list.isEmpty())
146 return true; 146 return true;
147 m_observedAttributes.reserveCapacityForSize(list.size()); 147 m_observedAttributes.reserveCapacityForSize(list.size());
148 for (const auto& attribute : list) 148 for (const auto& attribute : list)
149 m_observedAttributes.add(attribute); 149 m_observedAttributes.add(attribute);
150 return true; 150 return true;
151 } 151 }
152 152
(...skipping 18 matching lines...) Expand all
171 m_constructor, 171 m_constructor,
172 m_prototype, 172 m_prototype,
173 m_connectedCallback, 173 m_connectedCallback,
174 m_disconnectedCallback, 174 m_disconnectedCallback,
175 m_adoptedCallback, 175 m_adoptedCallback,
176 m_attributeChangedCallback, 176 m_attributeChangedCallback,
177 m_observedAttributes); 177 m_observedAttributes);
178 } 178 }
179 179
180 } // namespace blink 180 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698