From 41386e9cb918eed93b3f13648cbef387e371e451 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Wed, 20 May 2015 09:56:07 +0000 Subject: webkitgtk-2.4.9 --- Source/JavaScriptCore/parser/SourceProvider.h | 41 +++++---------------------- 1 file changed, 7 insertions(+), 34 deletions(-) (limited to 'Source/JavaScriptCore/parser/SourceProvider.h') diff --git a/Source/JavaScriptCore/parser/SourceProvider.h b/Source/JavaScriptCore/parser/SourceProvider.h index c263a1390..72c0de41e 100644 --- a/Source/JavaScriptCore/parser/SourceProvider.h +++ b/Source/JavaScriptCore/parser/SourceProvider.h @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -29,6 +29,7 @@ #ifndef SourceProvider_h #define SourceProvider_h +#include #include #include #include @@ -53,6 +54,9 @@ namespace JSC { TextPosition startPosition() const { return m_startPosition; } intptr_t asID() { + ASSERT(this); + if (!this) // Be defensive in release mode. + return nullID; if (!m_id) getID(); return m_id; @@ -74,9 +78,9 @@ namespace JSC { class StringSourceProvider : public SourceProvider { public: - static Ref create(const String& source, const String& url, const TextPosition& startPosition = TextPosition::minimumPosition()) + static PassRefPtr create(const String& source, const String& url, const TextPosition& startPosition = TextPosition::minimumPosition()) { - return adoptRef(*new StringSourceProvider(source, url, startPosition)); + return adoptRef(new StringSourceProvider(source, url, startPosition)); } virtual const String& source() const override @@ -94,37 +98,6 @@ namespace JSC { String m_source; }; -#if ENABLE(WEBASSEMBLY) - class WebAssemblySourceProvider : public SourceProvider { - public: - static Ref create(const Vector& data, const String& url) - { - return adoptRef(*new WebAssemblySourceProvider(data, url)); - } - - virtual const String& source() const override - { - return m_source; - } - - const Vector& data() const - { - return m_data; - } - - private: - WebAssemblySourceProvider(const Vector& data, const String& url) - : SourceProvider(url, TextPosition::minimumPosition()) - , m_source("[WebAssembly source]") - , m_data(data) - { - } - - String m_source; - Vector m_data; - }; -#endif - } // namespace JSC #endif // SourceProvider_h -- cgit v1.2.1