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

Unified Diff: storage/browser/blob/blob_reader.cc

Issue 2858133002: Add uma stats to help evaluate the impact of changes to the quota allocation logic. (Closed)
Patch Set: macros Created 3 years, 7 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
« no previous file with comments | « content/browser/service_worker/service_worker_disk_cache.cc ('k') | storage/common/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/blob/blob_reader.cc
diff --git a/storage/browser/blob/blob_reader.cc b/storage/browser/blob/blob_reader.cc
index 2d486872d6305c71f8f945730adf83ac1c2699a4..56cf9ad53634a02f1b92bd85c52c1a399ceff5f7 100644
--- a/storage/browser/blob/blob_reader.cc
+++ b/storage/browser/blob/blob_reader.cc
@@ -27,9 +27,12 @@
#include "storage/browser/fileapi/file_system_context.h"
#include "storage/browser/fileapi/file_system_url.h"
#include "storage/common/data_element.h"
+#include "storage/common/storage_histograms.h"
namespace storage {
namespace {
+const char kCacheStorageRecordBytesLabel[] = "DiskCache.CacheStorage";
+
bool IsFileType(DataElement::Type type) {
switch (type) {
case DataElement::TYPE_FILE:
@@ -145,6 +148,8 @@ void BlobReader::DidReadDiskCacheEntrySideData(const StatusCallback& done,
int result) {
if (result >= 0) {
DCHECK_EQ(expected_size, result);
+ if (result > 0)
+ storage::RecordBytesRead(kCacheStorageRecordBytesLabel, result);
done.Run(Status::DONE);
return;
}
@@ -584,6 +589,8 @@ BlobReader::Status BlobReader::ReadDiskCacheEntryItem(const BlobDataItem& item,
void BlobReader::DidReadDiskCacheEntry(int result) {
TRACE_EVENT_ASYNC_END1("Blob", "BlobRequest::ReadDiskCacheItem", this, "uuid",
blob_data_->uuid());
+ if (result > 0)
+ storage::RecordBytesRead(kCacheStorageRecordBytesLabel, result);
DidReadItem(result);
}
« no previous file with comments | « content/browser/service_worker/service_worker_disk_cache.cc ('k') | storage/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698