summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/parser/SourceProvider.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
commit41386e9cb918eed93b3f13648cbef387e371e451 (patch)
treea97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/parser/SourceProvider.h
parente15dd966d523731101f70ccf768bba12435a0208 (diff)
downloadWebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/parser/SourceProvider.h')
-rw-r--r--Source/JavaScriptCore/parser/SourceProvider.h41
1 files changed, 7 insertions, 34 deletions
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 <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/TextPosition.h>
#include <wtf/text/WTFString.h>
@@ -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<StringSourceProvider> create(const String& source, const String& url, const TextPosition& startPosition = TextPosition::minimumPosition())
+ static PassRefPtr<StringSourceProvider> 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<WebAssemblySourceProvider> create(const Vector<uint8_t>& data, const String& url)
- {
- return adoptRef(*new WebAssemblySourceProvider(data, url));
- }
-
- virtual const String& source() const override
- {
- return m_source;
- }
-
- const Vector<uint8_t>& data() const
- {
- return m_data;
- }
-
- private:
- WebAssemblySourceProvider(const Vector<uint8_t>& data, const String& url)
- : SourceProvider(url, TextPosition::minimumPosition())
- , m_source("[WebAssembly source]")
- , m_data(data)
- {
- }
-
- String m_source;
- Vector<uint8_t> m_data;
- };
-#endif
-
} // namespace JSC
#endif // SourceProvider_h