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

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

Issue 964553003: bindings: Use V8 MaybeLocal<> APIs in Dictionary class (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/core/v8/Dictionary.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 204 }
205 205
206 bool CustomElementConstructorBuilder::prototypeIsValid(const AtomicString& type, ExceptionState& exceptionState) const 206 bool CustomElementConstructorBuilder::prototypeIsValid(const AtomicString& type, ExceptionState& exceptionState) const
207 { 207 {
208 if (m_prototype->InternalFieldCount() || !V8HiddenValue::getHiddenValue(m_sc riptState->isolate(), m_prototype, V8HiddenValue::customElementIsInterfaceProtot ypeObject(m_scriptState->isolate())).IsEmpty()) { 208 if (m_prototype->InternalFieldCount() || !V8HiddenValue::getHiddenValue(m_sc riptState->isolate(), m_prototype, V8HiddenValue::customElementIsInterfaceProtot ypeObject(m_scriptState->isolate())).IsEmpty()) {
209 CustomElementException::throwException(CustomElementException::Prototype InUse, type, exceptionState); 209 CustomElementException::throwException(CustomElementException::Prototype InUse, type, exceptionState);
210 return false; 210 return false;
211 } 211 }
212 212
213 v8::PropertyAttribute propertyAttribute; 213 v8::PropertyAttribute propertyAttribute;
214 if (!getValueFromMaybe(m_prototype->GetPropertyAttributes(m_scriptState->iso late()->GetCurrentContext(), v8String(m_scriptState->isolate(), "constructor")), propertyAttribute) || (propertyAttribute & v8::DontDelete)) { 214 if (!v8Call(m_prototype->GetPropertyAttributes(m_scriptState->isolate()->Get CurrentContext(), v8String(m_scriptState->isolate(), "constructor")), propertyAt tribute) || (propertyAttribute & v8::DontDelete)) {
215 CustomElementException::throwException(CustomElementException::Construct orPropertyNotConfigurable, type, exceptionState); 215 CustomElementException::throwException(CustomElementException::Construct orPropertyNotConfigurable, type, exceptionState);
216 return false; 216 return false;
217 } 217 }
218 218
219 return true; 219 return true;
220 } 220 }
221 221
222 bool CustomElementConstructorBuilder::didRegisterDefinition(CustomElementDefinit ion* definition) const 222 bool CustomElementConstructorBuilder::didRegisterDefinition(CustomElementDefinit ion* definition) const
223 { 223 {
224 ASSERT(!m_constructor.IsEmpty()); 224 ASSERT(!m_constructor.IsEmpty());
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomEl ement", info.Holder(), info.GetIsolate()); 270 ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomEl ement", info.Holder(), info.GetIsolate());
271 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 271 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
272 RefPtrWillBeRawPtr<Element> element = document->createElementNS(namespaceURI , tagName, maybeType->IsNull() ? nullAtom : type, exceptionState); 272 RefPtrWillBeRawPtr<Element> element = document->createElementNS(namespaceURI , tagName, maybeType->IsNull() ? nullAtom : type, exceptionState);
273 if (exceptionState.throwIfNeeded()) 273 if (exceptionState.throwIfNeeded())
274 return; 274 return;
275 v8SetReturnValueFast(info, element.release(), document); 275 v8SetReturnValueFast(info, element.release(), document);
276 } 276 }
277 277
278 } // namespace blink 278 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/Dictionary.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698