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

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

Issue 2499263002: Add UMA to estimate deroppable memory usage of encoded data size in Resources (Closed)
Patch Set: Created 4 years, 1 month 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/core/fetch/Resource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp
index 723beaef078e02bae7e48b631f91cd3c31c8ab38..977345cf05fdc46338c0ae82919f609f27a2c950 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
@@ -859,6 +859,15 @@ void Resource::onMemoryStateChange(MemoryState state) {
m_cacheHandler->clearCachedMetadata(CachedMetadataHandler::CacheLocally);
}
+bool Resource::isReloadable() const {
+ ResourceClientWalker<ResourceClient> w(m_finishedClients);
+ while (ResourceClient* c = w.next()) {
+ if (!c->isReloadable())
+ return false;
+ }
+ return true;
+}
+
void Resource::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfDetail,
WebProcessMemoryDump* memoryDump) const {
static const size_t kMaxURLReportLength = 128;

Powered by Google App Engine
This is Rietveld 408576698