Log Message
Add diagnostic logging to measure speculative revalidation accuracy https://bugs.webkit.org/show_bug.cgi?id=151953 <rdar://problem/23092196>
Reviewed by Darin Adler. Source/WebCore: Add diagnostic logging to measure speculative revalidation accuracy. * page/DiagnosticLoggingKeys.cpp: (WebCore::DiagnosticLoggingKeys::entryRightlyNotWarmedUpKey): (WebCore::DiagnosticLoggingKeys::entryWronglyNotWarmedUpKey): (WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithRevalidationKey): (WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithoutRevalidationKey): (WebCore::DiagnosticLoggingKeys::unknownEntryRequestKey): (WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithRevalidationKey): (WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithoutRevalidationKey): * page/DiagnosticLoggingKeys.h: Source/WebKit2: We track the following: 1. Resources we knew about AND did not get requested A. We did not speculate (Good) B. We speculated but did not go to network (Bad) C. We speculated and went to network (Very bad) 2. Resources we did not know about (Neutral) 3. Resources we knew about AND got requested A. We did not speculate (Bad) B. We speculated but did not go to network (Good) C. We speculated and went to network (Very good) * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::retrieve): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::allSpeculativeLoadingDiagnosticMessages): (WebKit::NetworkCache::printSpeculativeLoadingDiagnosticMessageCounts): (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage): (WebKit::NetworkCache::SpeculativeLoadManager::ExpiringEntry::ExpiringEntry): (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry): (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::wasRevalidated): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::markLoadAsCompleted): (WebKit::NetworkCache::SpeculativeLoadManager::retrieve): (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry): (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry): (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry): (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation): (WebKit::NetworkCache::makeSubresourcesKey): Deleted. (WebKit::NetworkCache::constructRevalidationRequest): Deleted. (WebKit::NetworkCache::responseNeedsRevalidation): Deleted. (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady): Deleted. (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage): Deleted. (WebKit::NetworkCache::SpeculativeLoadManager::satisfyPendingRequests): Deleted. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
Modified Paths
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp
- trunk/Source/WebCore/page/DiagnosticLoggingKeys.h
- trunk/Source/WebKit2/ChangeLog
- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp
- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h
Diff
Modified: trunk/Source/WebCore/ChangeLog (193755 => 193756)
--- trunk/Source/WebCore/ChangeLog 2015-12-08 17:37:35 UTC (rev 193755)
+++ trunk/Source/WebCore/ChangeLog 2015-12-08 17:39:46 UTC (rev 193756)
@@ -1,3 +1,23 @@
+2015-12-08 Chris Dumez <[email protected]>
+
+ Add diagnostic logging to measure speculative revalidation accuracy
+ https://bugs.webkit.org/show_bug.cgi?id=151953
+ <rdar://problem/23092196>
+
+ Reviewed by Darin Adler.
+
+ Add diagnostic logging to measure speculative revalidation accuracy.
+
+ * page/DiagnosticLoggingKeys.cpp:
+ (WebCore::DiagnosticLoggingKeys::entryRightlyNotWarmedUpKey):
+ (WebCore::DiagnosticLoggingKeys::entryWronglyNotWarmedUpKey):
+ (WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithRevalidationKey):
+ (WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithoutRevalidationKey):
+ (WebCore::DiagnosticLoggingKeys::unknownEntryRequestKey):
+ (WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithRevalidationKey):
+ (WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithoutRevalidationKey):
+ * page/DiagnosticLoggingKeys.h:
+
2015-12-08 Brady Eidson <[email protected]>
Modern IDB: storage/indexeddb/index-cursor.html fails.
Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp (193755 => 193756)
--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp 2015-12-08 17:37:35 UTC (rev 193755)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp 2015-12-08 17:39:46 UTC (rev 193756)
@@ -103,6 +103,16 @@
return ASCIILiteral("engineFailedToLoad");
}
+String DiagnosticLoggingKeys::entryRightlyNotWarmedUpKey()
+{
+ return ASCIILiteral("entryRightlyNotWarmedUp");
+}
+
+String DiagnosticLoggingKeys::entryWronglyNotWarmedUpKey()
+{
+ return ASCIILiteral("entryWronglyNotWarmedUp");
+}
+
String DiagnosticLoggingKeys::navigationKey()
{
return ASCIILiteral("navigation");
@@ -418,6 +428,16 @@
return ASCIILiteral("styleSheet");
}
+String DiagnosticLoggingKeys::successfulSpeculativeWarmupWithRevalidationKey()
+{
+ return ASCIILiteral("successfulSpeculativeWarmupWithRevalidation");
+}
+
+String DiagnosticLoggingKeys::successfulSpeculativeWarmupWithoutRevalidationKey()
+{
+ return ASCIILiteral("successfulSpeculativeWarmupWithoutRevalidation");
+}
+
String DiagnosticLoggingKeys::svgDocumentKey()
{
return ASCIILiteral("svgDocument");
@@ -433,6 +453,11 @@
return ASCIILiteral("underMemoryPressure");
}
+String DiagnosticLoggingKeys::unknownEntryRequestKey()
+{
+ return ASCIILiteral("unknownEntryRequest");
+}
+
String DiagnosticLoggingKeys::unlikelyToReuseKey()
{
return ASCIILiteral("unlikelyToReuse");
@@ -513,6 +538,16 @@
return ASCIILiteral("video");
}
+String DiagnosticLoggingKeys::wastedSpeculativeWarmupWithRevalidationKey()
+{
+ return ASCIILiteral("wastedSpeculativeWarmupWithRevalidation");
+}
+
+String DiagnosticLoggingKeys::wastedSpeculativeWarmupWithoutRevalidationKey()
+{
+ return ASCIILiteral("wastedSpeculativeWarmupWithoutRevalidation");
+}
+
String DiagnosticLoggingKeys::webViewKey()
{
return ASCIILiteral("webView");
Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.h (193755 => 193756)
--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.h 2015-12-08 17:37:35 UTC (rev 193755)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.h 2015-12-08 17:39:46 UTC (rev 193756)
@@ -48,6 +48,8 @@
static String diskCacheAfterValidationKey();
static String documentLoaderStoppingKey();
static String engineFailedToLoadKey();
+ WEBCORE_EXPORT static String entryRightlyNotWarmedUpKey();
+ WEBCORE_EXPORT static String entryWronglyNotWarmedUpKey();
static String expiredKey();
static String fontKey();
static String hasPluginsKey();
@@ -115,9 +117,12 @@
static String sourceKey();
WEBCORE_EXPORT static String streamingMedia();
static String styleSheetKey();
+ WEBCORE_EXPORT static String successfulSpeculativeWarmupWithRevalidationKey();
+ WEBCORE_EXPORT static String successfulSpeculativeWarmupWithoutRevalidationKey();
static String svgDocumentKey();
WEBCORE_EXPORT static String uncacheableStatusCodeKey();
static String underMemoryPressureKey();
+ WEBCORE_EXPORT static String unknownEntryRequestKey();
WEBCORE_EXPORT static String unlikelyToReuseKey();
WEBCORE_EXPORT static String unsupportedHTTPMethodKey();
static String unsuspendableDOMObjectKey();
@@ -134,6 +139,8 @@
WEBCORE_EXPORT static String userKey();
WEBCORE_EXPORT static String varyingHeaderMismatchKey();
static String videoKey();
+ WEBCORE_EXPORT static String wastedSpeculativeWarmupWithRevalidationKey();
+ WEBCORE_EXPORT static String wastedSpeculativeWarmupWithoutRevalidationKey();
WEBCORE_EXPORT static String webViewKey();
WEBCORE_EXPORT static String zoomedKey();
Modified: trunk/Source/WebKit2/ChangeLog (193755 => 193756)
--- trunk/Source/WebKit2/ChangeLog 2015-12-08 17:37:35 UTC (rev 193755)
+++ trunk/Source/WebKit2/ChangeLog 2015-12-08 17:39:46 UTC (rev 193756)
@@ -1,3 +1,45 @@
+2015-12-08 Chris Dumez <[email protected]>
+
+ Add diagnostic logging to measure speculative revalidation accuracy
+ https://bugs.webkit.org/show_bug.cgi?id=151953
+ <rdar://problem/23092196>
+
+ Reviewed by Darin Adler.
+
+ We track the following:
+ 1. Resources we knew about AND did not get requested
+ A. We did not speculate (Good)
+ B. We speculated but did not go to network (Bad)
+ C. We speculated and went to network (Very bad)
+ 2. Resources we did not know about (Neutral)
+ 3. Resources we knew about AND got requested
+ A. We did not speculate (Bad)
+ B. We speculated but did not go to network (Good)
+ C. We speculated and went to network (Very good)
+
+ * NetworkProcess/cache/NetworkCache.cpp:
+ (WebKit::NetworkCache::Cache::retrieve):
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
+ (WebKit::NetworkCache::allSpeculativeLoadingDiagnosticMessages):
+ (WebKit::NetworkCache::printSpeculativeLoadingDiagnosticMessageCounts):
+ (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
+ (WebKit::NetworkCache::SpeculativeLoadManager::ExpiringEntry::ExpiringEntry):
+ (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
+ (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::wasRevalidated):
+ (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::markLoadAsCompleted):
+ (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
+ (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
+ (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
+ (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
+ (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
+ (WebKit::NetworkCache::makeSubresourcesKey): Deleted.
+ (WebKit::NetworkCache::constructRevalidationRequest): Deleted.
+ (WebKit::NetworkCache::responseNeedsRevalidation): Deleted.
+ (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady): Deleted.
+ (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage): Deleted.
+ (WebKit::NetworkCache::SpeculativeLoadManager::satisfyPendingRequests): Deleted.
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
+
2015-12-08 Csaba Osztrogonác <[email protected]>
[EFL] REGRESSION(r173394): MiniBrowser stucked in an infinite loop if NETWORK_CACHE is disabled
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp (193755 => 193756)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp 2015-12-08 17:37:35 UTC (rev 193755)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp 2015-12-08 17:39:46 UTC (rev 193756)
@@ -370,7 +370,7 @@
}
#if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
- if (m_speculativeLoadManager && m_speculativeLoadManager->retrieve(storageKey, [originalRequest, completionHandler](std::unique_ptr<Entry> entry) {
+ if (m_speculativeLoadManager && m_speculativeLoadManager->retrieve(frameID, storageKey, [originalRequest, completionHandler](std::unique_ptr<Entry> entry) {
if (entry && verifyVaryingRequestHeaders(entry->varyingRequestHeaders(), originalRequest))
completionHandler(WTF::move(entry));
else
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp (193755 => 193756)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 2015-12-08 17:37:35 UTC (rev 193755)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 2015-12-08 17:39:46 UTC (rev 193756)
@@ -32,7 +32,10 @@
#include "NetworkCacheEntry.h"
#include "NetworkCacheSpeculativeLoad.h"
#include "NetworkCacheSubresourcesEntry.h"
+#include "NetworkProcess.h"
+#include <WebCore/DiagnosticLoggingKeys.h>
#include <WebCore/HysteresisActivity.h>
+#include <wtf/HashCountedSet.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/RefCounted.h>
#include <wtf/RunLoop.h>
@@ -45,6 +48,30 @@
static const auto preloadedEntryLifetime = 10_s;
+#if !LOG_DISABLED
+static HashCountedSet<String>& allSpeculativeLoadingDiagnosticMessages()
+{
+ static NeverDestroyed<HashCountedSet<String>> messages;
+ return messages;
+}
+
+static void printSpeculativeLoadingDiagnosticMessageCounts()
+{
+ LOG(NetworkCacheSpeculativePreloading, "-- Speculative loading statistics --");
+ for (auto& pair : allSpeculativeLoadingDiagnosticMessages())
+ LOG(NetworkCacheSpeculativePreloading, "%s: %u", pair.key.utf8().data(), pair.value);
+}
+#endif
+
+static void logSpeculativeLoadingDiagnosticMessage(const GlobalFrameID& frameID, const String& message)
+{
+#if !LOG_DISABLED
+ if (WebKit2LogNetworkCacheSpeculativePreloading.state == WTFLogChannelOn)
+ allSpeculativeLoadingDiagnosticMessages().add(message);
+#endif
+ NetworkProcess::singleton().logDiagnosticMessage(frameID.first, WebCore::DiagnosticLoggingKeys::networkCacheKey(), message, WebCore::ShouldSample::Yes);
+}
+
static const AtomicString& subresourcesType()
{
ASSERT(RunLoop::isMain());
@@ -82,32 +109,39 @@
return age - lifetime > 0_ms;
}
-class SpeculativeLoadManager::PreloadedEntry {
+class SpeculativeLoadManager::ExpiringEntry {
WTF_MAKE_FAST_ALLOCATED;
public:
- PreloadedEntry(std::unique_ptr<Entry> entry, std::function<void()>&& lifetimeReachedHandler)
- : m_entry(WTF::move(entry))
- , m_lifetimeTimer(*this, &PreloadedEntry::lifetimeTimerFired)
- , m_lifetimeReachedHandler(WTF::move(lifetimeReachedHandler))
+ explicit ExpiringEntry(std::function<void()>&& expirationHandler)
+ : m_lifetimeTimer(WTF::move(expirationHandler))
{
m_lifetimeTimer.startOneShot(preloadedEntryLifetime);
}
+private:
+ Timer m_lifetimeTimer;
+};
+
+class SpeculativeLoadManager::PreloadedEntry : private ExpiringEntry {
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ PreloadedEntry(std::unique_ptr<Entry> entry, WasRevalidated wasRevalidated, std::function<void()>&& lifetimeReachedHandler)
+ : ExpiringEntry(WTF::move(lifetimeReachedHandler))
+ , m_entry(WTF::move(entry))
+ , m_wasRevalidated(wasRevalidated == WasRevalidated::Yes)
+ { }
+
std::unique_ptr<Entry> takeCacheEntry()
{
ASSERT(m_entry);
return WTF::move(m_entry);
}
+ bool wasRevalidated() const { return m_wasRevalidated; }
+
private:
- void lifetimeTimerFired()
- {
- m_lifetimeReachedHandler();
- }
-
std::unique_ptr<Entry> m_entry;
- Timer m_lifetimeTimer;
- std::function<void()> m_lifetimeReachedHandler;
+ bool m_wasRevalidated;
};
class SpeculativeLoadManager::PendingFrameLoad : public RefCounted<PendingFrameLoad> {
@@ -136,6 +170,10 @@
if (m_didFinishLoad)
return;
+#if !LOG_DISABLED
+ printSpeculativeLoadingDiagnosticMessageCounts();
+#endif
+
m_didFinishLoad = true;
saveToDiskIfReady();
m_loadCompletionHandler();
@@ -201,18 +239,29 @@
{
}
-bool SpeculativeLoadManager::retrieve(const Key& storageKey, const RetrieveCompletionHandler& completionHandler)
+bool SpeculativeLoadManager::retrieve(const GlobalFrameID& frameID, const Key& storageKey, const RetrieveCompletionHandler& completionHandler)
{
// Check already preloaded entries.
if (auto preloadedEntry = m_preloadedEntries.take(storageKey)) {
LOG(NetworkCacheSpeculativePreloading, "(NetworkProcess) Retrieval: Using preloaded entry to satisfy request for '%s':", storageKey.identifier().utf8().data());
+ if (preloadedEntry->wasRevalidated())
+ logSpeculativeLoadingDiagnosticMessage(frameID, DiagnosticLoggingKeys::successfulSpeculativeWarmupWithRevalidationKey());
+ else
+ logSpeculativeLoadingDiagnosticMessage(frameID, DiagnosticLoggingKeys::successfulSpeculativeWarmupWithoutRevalidationKey());
+
completionHandler(preloadedEntry->takeCacheEntry());
return true;
}
// Check pending speculative revalidations.
- if (!m_pendingPreloads.contains(storageKey))
+ if (!m_pendingPreloads.contains(storageKey)) {
+ if (m_notPreloadedEntries.remove(storageKey))
+ logSpeculativeLoadingDiagnosticMessage(frameID, DiagnosticLoggingKeys::entryWronglyNotWarmedUpKey());
+ else
+ logSpeculativeLoadingDiagnosticMessage(frameID, DiagnosticLoggingKeys::unknownEntryRequestKey());
+
return false;
+ }
LOG(NetworkCacheSpeculativePreloading, "(NetworkProcess) Retrieval: revalidation already in progress for '%s':", storageKey.identifier().utf8().data());
@@ -260,13 +309,18 @@
pendingFrameLoad->registerSubresource(resourceKey);
}
-void SpeculativeLoadManager::addPreloadedEntry(std::unique_ptr<Entry> entry)
+void SpeculativeLoadManager::addPreloadedEntry(std::unique_ptr<Entry> entry, const GlobalFrameID& frameID, WasRevalidated wasRevalidated)
{
ASSERT(entry);
ASSERT(!entry->needsValidation());
auto key = entry->key();
- m_preloadedEntries.add(key, std::make_unique<PreloadedEntry>(WTF::move(entry), [this, key]() {
- m_preloadedEntries.remove(key);
+ m_preloadedEntries.add(key, std::make_unique<PreloadedEntry>(WTF::move(entry), wasRevalidated, [this, key, frameID] {
+ auto preloadedEntry = m_preloadedEntries.take(key);
+ ASSERT(preloadedEntry);
+ if (preloadedEntry->wasRevalidated())
+ logSpeculativeLoadingDiagnosticMessage(frameID, DiagnosticLoggingKeys::wastedSpeculativeWarmupWithRevalidationKey());
+ else
+ logSpeculativeLoadingDiagnosticMessage(frameID, DiagnosticLoggingKeys::wastedSpeculativeWarmupWithoutRevalidationKey());
}));
}
@@ -316,16 +370,19 @@
auto key = entry->key();
LOG(NetworkCacheSpeculativePreloading, "(NetworkProcess) Speculatively revalidating '%s':", key.identifier().utf8().data());
- auto revalidator = std::make_unique<SpeculativeLoad>(frameID, constructRevalidationRequest(*entry), WTF::move(entry), [this, key](std::unique_ptr<Entry> revalidatedEntry) {
+ auto revalidator = std::make_unique<SpeculativeLoad>(frameID, constructRevalidationRequest(*entry), WTF::move(entry), [this, key, frameID](std::unique_ptr<Entry> revalidatedEntry) {
ASSERT(!revalidatedEntry || !revalidatedEntry->needsValidation());
auto protectRevalidator = m_pendingPreloads.take(key);
LOG(NetworkCacheSpeculativePreloading, "(NetworkProcess) Speculative revalidation completed for '%s':", key.identifier().utf8().data());
- if (satisfyPendingRequests(key, revalidatedEntry.get()))
+ if (satisfyPendingRequests(key, revalidatedEntry.get())) {
+ if (revalidatedEntry)
+ logSpeculativeLoadingDiagnosticMessage(frameID, DiagnosticLoggingKeys::successfulSpeculativeWarmupWithRevalidationKey());
return;
+ }
if (revalidatedEntry)
- addPreloadedEntry(WTF::move(revalidatedEntry));
+ addPreloadedEntry(WTF::move(revalidatedEntry), frameID, WasRevalidated::Yes);
});
m_pendingPreloads.add(key, WTF::move(revalidator));
}
@@ -336,8 +393,11 @@
retrieveEntryFromStorage(key, [this, key, frameID](std::unique_ptr<Entry> entry) {
m_pendingPreloads.remove(key);
- if (satisfyPendingRequests(key, entry.get()))
+ if (satisfyPendingRequests(key, entry.get())) {
+ if (entry)
+ logSpeculativeLoadingDiagnosticMessage(frameID, DiagnosticLoggingKeys::successfulSpeculativeWarmupWithoutRevalidationKey());
return;
+ }
if (!entry)
return;
@@ -345,17 +405,23 @@
if (entry->needsValidation())
revalidateEntry(WTF::move(entry), frameID);
else
- addPreloadedEntry(WTF::move(entry));
+ addPreloadedEntry(WTF::move(entry), frameID, WasRevalidated::No);
});
}
void SpeculativeLoadManager::startSpeculativeRevalidation(const GlobalFrameID& frameID, SubresourcesEntry& entry)
{
for (auto& subresource : entry.subresources()) {
+ auto key = subresource.key;
if (!subresource.value.isTransient)
- preloadEntry(subresource.key, frameID);
- else
+ preloadEntry(key, frameID);
+ else {
LOG(NetworkCacheSpeculativePreloading, "(NetworkProcess) Not preloading '%s' because it is marked as transient", subresource.key.identifier().utf8().data());
+ m_notPreloadedEntries.add(key, std::make_unique<ExpiringEntry>([this, key, frameID] {
+ logSpeculativeLoadingDiagnosticMessage(frameID, DiagnosticLoggingKeys::entryRightlyNotWarmedUpKey());
+ m_notPreloadedEntries.remove(key);
+ }));
+ }
}
}
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h (193755 => 193756)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h 2015-12-08 17:37:35 UTC (rev 193755)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h 2015-12-08 17:39:46 UTC (rev 193756)
@@ -50,10 +50,11 @@
void registerLoad(const GlobalFrameID&, const WebCore::ResourceRequest&, const Key& resourceKey);
typedef std::function<void (std::unique_ptr<Entry>)> RetrieveCompletionHandler;
- bool retrieve(const Key& storageKey, const RetrieveCompletionHandler&);
+ bool retrieve(const GlobalFrameID&, const Key& storageKey, const RetrieveCompletionHandler&);
private:
- void addPreloadedEntry(std::unique_ptr<Entry>);
+ enum class WasRevalidated { No, Yes };
+ void addPreloadedEntry(std::unique_ptr<Entry>, const GlobalFrameID&, WasRevalidated);
void preloadEntry(const Key&, const GlobalFrameID&);
void retrieveEntryFromStorage(const Key&, const RetrieveCompletionHandler&);
void revalidateEntry(std::unique_ptr<Entry>, const GlobalFrameID&);
@@ -71,6 +72,9 @@
class PreloadedEntry;
HashMap<Key, std::unique_ptr<PreloadedEntry>> m_preloadedEntries;
+
+ class ExpiringEntry;
+ HashMap<Key, std::unique_ptr<ExpiringEntry>> m_notPreloadedEntries; // For logging.
};
} // namespace NetworkCache
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
