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

Unified Diff: Source/core/dom/PendingScript.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/core/dom/PendingScript.h
diff --git a/Source/core/dom/PendingScript.h b/Source/core/dom/PendingScript.h
index 9425382303d6c8c1afd2e9a219d20f33e82214c6..9b8a0b8d51ba653db4ef3eec07c8833779f1ac58 100644
--- a/Source/core/dom/PendingScript.h
+++ b/Source/core/dom/PendingScript.h
@@ -38,6 +38,7 @@
namespace blink {
class ScriptResource;
+class V8ScriptStreamer;
// A container for an external script which may be loaded and executed.
//
@@ -79,8 +80,8 @@ public:
m_watchingForLoad = other.m_watchingForLoad;
m_element = other.m_element;
m_startingPosition = other.m_startingPosition;
- this->ResourceOwner<ScriptResource, ResourceClient>::operator=(other);
-
+ m_streamer = other.m_streamer;
+ this->ResourceOwner<ScriptResource, ScriptResourceClient>::operator=(other);
return *this;
}
@@ -97,13 +98,26 @@ public:
void setScriptResource(ScriptResource*);
virtual void notifyFinished(Resource*);
+ virtual void notifyAppendData(ScriptResource*);
void trace(Visitor*);
+ void setStreamer(PassRefPtr<V8ScriptStreamer> streamer)
+ {
+ ASSERT(!m_streamer);
+ m_streamer = RefPtr<V8ScriptStreamer>(streamer);
haraken 2014/08/17 16:05:28 RefPtr<V8ScriptStreamer> wouldn't be needed.
marja 2014/08/20 11:45:56 Done.
+ }
+ V8ScriptStreamer* streamer() { return m_streamer.get(); }
+ PassRefPtr<V8ScriptStreamer> releaseStreamer() { return m_streamer.release(); }
haraken 2014/08/17 16:05:28 Is it possible that releaseStreamer() is called be
marja 2014/08/20 11:45:56 I removed releaseStreamer, since the ownership dan
+
+ bool isStreaming() const;
+
private:
bool m_watchingForLoad;
RefPtrWillBeMember<Element> m_element;
TextPosition m_startingPosition; // Only used for inline script tags.
+
+ RefPtr<V8ScriptStreamer> m_streamer;
};
}

Powered by Google App Engine
This is Rietveld 408576698