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

Unified Diff: Source/core/fetch/Resource.cpp

Issue 528013002: Restore in-memory parser cache for V8 compile. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: bool -> enum. 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
Index: Source/core/fetch/Resource.cpp
diff --git a/Source/core/fetch/Resource.cpp b/Source/core/fetch/Resource.cpp
index ff898e2a129f2decc402aee403328c16bf45330b..283b124bad73e52ab7057485a66567c23a246688 100644
--- a/Source/core/fetch/Resource.cpp
+++ b/Source/core/fetch/Resource.cpp
@@ -413,7 +413,7 @@ void Resource::setSerializedCachedMetadata(const char* data, size_t size)
m_cachedMetadata = CachedMetadata::deserialize(data, size);
}
-void Resource::setCachedMetadata(unsigned dataTypeID, const char* data, size_t size)
+void Resource::setCachedMetadata(unsigned dataTypeID, const char* data, size_t size, MetadataCacheType cacheType)
{
// Currently, only one type of cached metadata per resource is supported.
// If the need arises for multiple types of metadata per resource this could
@@ -421,8 +421,11 @@ void Resource::setCachedMetadata(unsigned dataTypeID, const char* data, size_t s
ASSERT(!m_cachedMetadata);
m_cachedMetadata = CachedMetadata::create(dataTypeID, data, size);
- const Vector<char>& serializedData = m_cachedMetadata->serialize();
- blink::Platform::current()->cacheMetadata(m_response.url(), m_response.responseTime(), serializedData.data(), serializedData.size());
+
+ if (cacheType == SendToPlatform) {
+ const Vector<char>& serializedData = m_cachedMetadata->serialize();
+ blink::Platform::current()->cacheMetadata(m_response.url(), m_response.responseTime(), serializedData.data(), serializedData.size());
+ }
}
void Resource::clearCachedMetadata()
« Source/bindings/core/v8/V8ScriptRunnerTest.cpp ('K') | « Source/core/fetch/Resource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698