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

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: 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/core/Init.cpp ('k') | Source/core/dom/PendingScript.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/PendingScript.h
diff --git a/Source/core/dom/PendingScript.h b/Source/core/dom/PendingScript.h
index 77f87faf4d53d4657b09529445bf98cf795a31e9..88b0010132f8aa8556fc6e3b80aaef7c619b6927 100644
--- a/Source/core/dom/PendingScript.h
+++ b/Source/core/dom/PendingScript.h
@@ -38,7 +38,7 @@
namespace blink {
-class ScriptResource;
+class ScriptStreamer;
// A container for an external script which may be loaded and executed.
//
@@ -80,16 +80,16 @@ 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;
}
TextPosition startingPosition() const { return m_startingPosition; }
void setStartingPosition(const TextPosition& position) { m_startingPosition = position; }
- void watchForLoad(ResourceClient*);
- void stopWatchingForLoad(ResourceClient*);
+ void watchForLoad(ScriptResourceClient*);
+ void stopWatchingForLoad(ScriptResourceClient*);
Element* element() const { return m_element.get(); }
void setElement(Element* element) { m_element = element; }
@@ -98,15 +98,27 @@ public:
void setScriptResource(ScriptResource*);
virtual void notifyFinished(Resource*);
+ virtual void notifyAppendData(ScriptResource*);
void trace(Visitor*);
ScriptSourceCode getSource(const KURL& documentURL, bool& errorOccurred) const;
+ void setStreamer(PassRefPtr<ScriptStreamer> streamer)
+ {
+ ASSERT(!m_streamer);
+ ASSERT(!m_watchingForLoad);
+ m_streamer = streamer;
+ }
+
+ bool isStreaming() const;
+
private:
bool m_watchingForLoad;
RefPtrWillBeMember<Element> m_element;
TextPosition m_startingPosition; // Only used for inline script tags.
+
+ RefPtr<ScriptStreamer> m_streamer;
};
}
« no previous file with comments | « Source/core/Init.cpp ('k') | Source/core/dom/PendingScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698