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

Unified Diff: Source/bindings/core/v8/ScriptSourceCode.h

Issue 368283002: Stream scripts to V8 as they load - Blink side. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: renaming Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/core/v8/ScriptSourceCode.h
diff --git a/Source/bindings/core/v8/ScriptSourceCode.h b/Source/bindings/core/v8/ScriptSourceCode.h
index 8cd98fb185be29c814c3ef005bdff0e81a58ad77..035fa34590d31caa4543839ffd3df29fc143f934 100644
--- a/Source/bindings/core/v8/ScriptSourceCode.h
+++ b/Source/bindings/core/v8/ScriptSourceCode.h
@@ -31,6 +31,7 @@
#ifndef ScriptSourceCode_h
#define ScriptSourceCode_h
+#include "bindings/core/v8/V8ScriptStreamer.h"
#include "core/fetch/ResourcePtr.h"
#include "core/fetch/ScriptResource.h"
#include "platform/weborigin/KURL.h"
@@ -61,6 +62,14 @@ public:
{
}
+ ScriptSourceCode(PassRefPtr<V8ScriptStreamer> streamer, ScriptResource* cs)
+ : m_source(cs->script())
+ , m_resource(cs)
+ , m_streamer(streamer)
+ , m_startPosition(TextPosition::minimumPosition())
+ {
+ }
+
bool isEmpty() const { return m_source.isEmpty(); }
const String& source() const { return m_source; }
@@ -77,9 +86,12 @@ public:
int startLine() const { return m_startPosition.m_line.oneBasedInt(); }
const TextPosition& startPosition() const { return m_startPosition; }
+ V8ScriptStreamer* streamer() const { return m_streamer.get(); }
+
private:
String m_source;
ResourcePtr<ScriptResource> m_resource;
+ RefPtr<V8ScriptStreamer> m_streamer;
haraken 2014/08/17 16:05:25 In my understanding, V8ScriptStreamer is owned by
marja 2014/08/20 11:45:54 I don't think we can get away without RefPtrs; the
haraken 2014/08/20 15:00:18 Makes sense, thanks for the clarification!
mutable KURL m_url;
TextPosition m_startPosition;
};

Powered by Google App Engine
This is Rietveld 408576698