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

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

Issue 23450039: Pass isolate to ScriptValue constructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove useless member Created 7 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 | 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 bool CustomElementConstructorBuilder::didRegisterDefinition(CustomElementDefinit ion* definition) const 226 bool CustomElementConstructorBuilder::didRegisterDefinition(CustomElementDefinit ion* definition) const
227 { 227 {
228 ASSERT(!m_constructor.IsEmpty()); 228 ASSERT(!m_constructor.IsEmpty());
229 229
230 return m_callbacks->setBinding(definition, CustomElementBinding::create(m_co ntext->GetIsolate(), m_prototype, m_wrapperType)); 230 return m_callbacks->setBinding(definition, CustomElementBinding::create(m_co ntext->GetIsolate(), m_prototype, m_wrapperType));
231 } 231 }
232 232
233 ScriptValue CustomElementConstructorBuilder::bindingsReturnValue() const 233 ScriptValue CustomElementConstructorBuilder::bindingsReturnValue() const
234 { 234 {
235 return ScriptValue(m_constructor); 235 return ScriptValue(m_constructor, v8::Isolate::GetCurrent());
haraken 2013/09/16 16:39:53 Can't you use m_context->GetIsolate() ?
do-not-use 2013/09/17 06:52:13 Done.
236 } 236 }
237 237
238 bool CustomElementConstructorBuilder::hasValidPrototypeChainFor(WrapperTypeInfo* type) const 238 bool CustomElementConstructorBuilder::hasValidPrototypeChainFor(WrapperTypeInfo* type) const
239 { 239 {
240 v8::Handle<v8::Object> elementPrototype = V8PerContextData::from(m_context)- >prototypeForType(type); 240 v8::Handle<v8::Object> elementPrototype = V8PerContextData::from(m_context)- >prototypeForType(type);
241 if (elementPrototype.IsEmpty()) 241 if (elementPrototype.IsEmpty())
242 return false; 242 return false;
243 243
244 v8::Handle<v8::Value> chain = m_prototype; 244 v8::Handle<v8::Value> chain = m_prototype;
245 while (!chain.IsEmpty() && chain->IsObject()) { 245 while (!chain.IsEmpty() && chain->IsObject()) {
(...skipping 27 matching lines...) Expand all
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

Powered by Google App Engine
This is Rietveld 408576698