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

Unified Diff: third_party/WebKit/Source/core/fetch/ImageResource.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/ImageResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
index 929cb375d24e5dcb1ae3a954288a0506d43996ba..c8cf194774c5b9e9b830aab7ab231d972b4c2792 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -23,6 +23,7 @@
#include "core/fetch/ImageResource.h"
+#include "base/metrics/histogram_macros.h"
#include "core/fetch/ImageResourceObserver.h"
#include "core/fetch/MemoryCache.h"
#include "core/fetch/ResourceClient.h"
@@ -252,6 +253,10 @@ void ImageResource::destroyDecodedDataIfPossible() {
return;
CHECK(!errorOccurred());
m_image->destroyDecodedData();
+ if (!isPreloaded() && isReloadable()) {
+ UMA_HISTOGRAM_MEMORY_KB("Memory.Renderer.EstimantedDroppableEncodedSize",
+ encodedSize() / 1024);
+ }
}
void ImageResource::doResetAnimation() {

Powered by Google App Engine
This is Rietveld 408576698