diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/bindings/js/ScriptSourceCode.h')
-rw-r--r-- | src/3rdparty/webkit/WebCore/bindings/js/ScriptSourceCode.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/3rdparty/webkit/WebCore/bindings/js/ScriptSourceCode.h b/src/3rdparty/webkit/WebCore/bindings/js/ScriptSourceCode.h index 0a16265ff..1b05dedb6 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/ScriptSourceCode.h +++ b/src/3rdparty/webkit/WebCore/bindings/js/ScriptSourceCode.h @@ -32,20 +32,24 @@ #define ScriptSourceCode_h #include "CachedScriptSourceProvider.h" +#include "ScriptSourceProvider.h" #include "StringSourceProvider.h" #include "KURL.h" +#include <wtf/RefPtr.h> namespace WebCore { class ScriptSourceCode { public: ScriptSourceCode(const String& source, const KURL& url = KURL(), int startLine = 1) - : m_code(makeSource(source, url.isNull() ? String() : url.string(), startLine)) + : m_provider(StringSourceProvider::create(source, url.isNull() ? String() : url.string())) + , m_code(m_provider, startLine) { } ScriptSourceCode(CachedScript* cs) - : m_code(makeSource(cs)) + : m_provider(CachedScriptSourceProvider::create(cs)) + , m_code(m_provider) { } @@ -53,9 +57,11 @@ public: const JSC::SourceCode& jsSourceCode() const { return m_code; } - const String& source() const { return static_cast<StringSourceProvider*>(m_code.provider())->source(); } + const String& source() const { return m_provider->source(); } private: + RefPtr<ScriptSourceProvider> m_provider; + JSC::SourceCode m_code; }; |