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

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: removed untrue assert Created 6 years, 3 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
« no previous file with comments | « Source/bindings/core/v8/ScriptDebugServer.cpp ('k') | Source/bindings/core/v8/ScriptStreamer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b7db957876c4130195800b0e930a55b92aaf3136 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/ScriptStreamer.h"
#include "core/fetch/ResourcePtr.h"
#include "core/fetch/ScriptResource.h"
#include "platform/weborigin/KURL.h"
@@ -54,9 +55,17 @@ public:
// We lose the encoding information from ScriptResource.
// Not sure if that matters.
- ScriptSourceCode(ScriptResource* cs)
- : m_source(cs->script())
- , m_resource(cs)
+ ScriptSourceCode(ScriptResource* resource)
+ : m_source(resource->script())
+ , m_resource(resource)
+ , m_startPosition(TextPosition::minimumPosition())
+ {
+ }
+
+ ScriptSourceCode(PassRefPtr<ScriptStreamer> streamer, ScriptResource* resource)
+ : m_source(resource->script())
+ , m_resource(resource)
+ , m_streamer(streamer)
, m_startPosition(TextPosition::minimumPosition())
{
}
@@ -77,9 +86,12 @@ public:
int startLine() const { return m_startPosition.m_line.oneBasedInt(); }
const TextPosition& startPosition() const { return m_startPosition; }
+ ScriptStreamer* streamer() const { return m_streamer.get(); }
+
private:
String m_source;
ResourcePtr<ScriptResource> m_resource;
+ RefPtr<ScriptStreamer> m_streamer;
mutable KURL m_url;
TextPosition m_startPosition;
};
« no previous file with comments | « Source/bindings/core/v8/ScriptDebugServer.cpp ('k') | Source/bindings/core/v8/ScriptStreamer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698