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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp

Issue 1915833002: Introduce Platform::cacheMetadataInCacheStorage() to store V8 code cache in CacheStorage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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: third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
index 94bb106cede79388baf860788d27fae901f18d82..eb5221a57f355e672ea12af083355ca0c78c9853 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
@@ -280,10 +280,12 @@ private:
ASSERT(lengthOfBOM == 0 || m_queueTailPosition == 0);
CachedMetadataHandler* cacheHandler = streamer->resource()->cacheHandler();
- if (cacheHandler && cacheHandler->cachedMetadata(V8ScriptRunner::tagForCodeCache(cacheHandler))) {
- // The resource has a code cache, so it's unnecessary to stream and
- // parse the code. Cancel the streaming and resume the non-streaming
- // code path.
+ if (cacheHandler && (cacheHandler->shouldAggressivelyCache() || cacheHandler->cachedMetadata(V8ScriptRunner::tagForCodeCache(cacheHandler)))) {
+ // When we should aggressively cache the code cache, we can't use
+ // SourceStream because currently V8ScriptRunner doesn't supoprt
+ // code caching with SourceStream. And if the resource has a code
+ // cache, it's unnecessary to stream and parse the code.
+ // Cancel the streaming and resume the non-streaming code path.
streamer->suppressStreaming();
cancel();
return;

Powered by Google App Engine
This is Rietveld 408576698