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

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

Issue 209713003: Make DOMWrapperWorld::current() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 CustomElementConstructorBuilder::CustomElementConstructorBuilder(ScriptState* st ate, const Dictionary* options) 59 CustomElementConstructorBuilder::CustomElementConstructorBuilder(ScriptState* st ate, const Dictionary* options)
60 : m_context(state->context()) 60 : m_context(state->context())
61 , m_options(options) 61 , m_options(options)
62 , m_wrapperType(0) 62 , m_wrapperType(0)
63 { 63 {
64 ASSERT(m_context == v8::Isolate::GetCurrent()->GetCurrentContext()); 64 ASSERT(m_context == v8::Isolate::GetCurrent()->GetCurrentContext());
65 } 65 }
66 66
67 bool CustomElementConstructorBuilder::isFeatureAllowed() const 67 bool CustomElementConstructorBuilder::isFeatureAllowed() const
68 { 68 {
69 return DOMWrapperWorld::world(m_context)->isMainWorld(); 69 return DOMWrapperWorld::world(m_context).isMainWorld();
70 } 70 }
71 71
72 bool CustomElementConstructorBuilder::validateOptions(const AtomicString& type, QualifiedName& tagName, ExceptionState& exceptionState) 72 bool CustomElementConstructorBuilder::validateOptions(const AtomicString& type, QualifiedName& tagName, ExceptionState& exceptionState)
73 { 73 {
74 ASSERT(m_prototype.IsEmpty()); 74 ASSERT(m_prototype.IsEmpty());
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 if (!prototypeScriptValue.isObject()) { 78 if (!prototypeScriptValue.isObject()) {
79 CustomElementException::throwException(CustomElementException::Proto typeNotAnObject, type, exceptionState); 79 CustomElementException::throwException(CustomElementException::Proto typeNotAnObject, type, exceptionState);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 277
278 ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomEl ement", info.Holder(), info.GetIsolate()); 278 ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomEl ement", info.Holder(), info.GetIsolate());
279 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 279 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
280 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m aybeType->IsNull() ? nullAtom : type, exceptionState); 280 RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, m aybeType->IsNull() ? nullAtom : type, exceptionState);
281 if (exceptionState.throwIfNeeded()) 281 if (exceptionState.throwIfNeeded())
282 return; 282 return;
283 v8SetReturnValueFast(info, element.release(), document); 283 v8SetReturnValueFast(info, element.release(), document);
284 } 284 }
285 285
286 } // namespace WebCore 286 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestTypedefs.h ('k') | Source/bindings/v8/CustomElementWrapper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698