#ifndef SourceProvider_h
#define SourceProvider_h
-#include <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/TextPosition.h>
#include <wtf/text/WTFString.h>
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;
class StringSourceProvider : public SourceProvider {
public:
- static PassRefPtr<StringSourceProvider> create(const String& source, const String& url, const TextPosition& startPosition = TextPosition::minimumPosition())
+ static Ref<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