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

Unified Diff: content/browser/service_worker/service_worker_cache_storage.cc

Issue 985053002: [ServiceWorkerCache] Cache and CacheStorage creation UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also monitor cache storage creation Created 5 years, 9 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: content/browser/service_worker/service_worker_cache_storage.cc
diff --git a/content/browser/service_worker/service_worker_cache_storage.cc b/content/browser/service_worker/service_worker_cache_storage.cc
index d5fb07c6789be43dc86f66bce251e0ed19fa0b81..20b09359b5eda100a4b02fef063cab999ff69d1a 100644
--- a/content/browser/service_worker/service_worker_cache_storage.cc
+++ b/content/browser/service_worker/service_worker_cache_storage.cc
@@ -10,6 +10,7 @@
#include "base/files/file_util.h"
#include "base/files/memory_mapped_file.h"
#include "base/memory/ref_counted.h"
+#include "base/metrics/histogram.h"
#include "base/sha1.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
@@ -613,6 +614,9 @@ void ServiceWorkerCacheStorage::CreateCacheDidCreateCache(
return;
}
+ UMA_HISTOGRAM_BOOLEAN("ServiceWorkerCache.CreateCacheStorageResult",
michaeln 2015/03/13 22:47:16 Should the label be "CreateCacheResult"?
jkarlin 2015/03/14 01:47:19 The names are a bit misleading. ServiceWorkerCache
+ cache != nullptr);
+
cache_map_.insert(std::make_pair(cache_name, cache->AsWeakPtr()));
ordered_cache_names_.push_back(cache_name);
@@ -717,7 +721,7 @@ void ServiceWorkerCacheStorage::MatchCacheImpl(
scoped_refptr<ServiceWorkerCache> cache = GetLoadedCache(cache_name);
if (!cache.get()) {
- callback.Run(ServiceWorkerCache::ErrorTypeNotFound,
+ callback.Run(ServiceWorkerCache::ERROR_TYPE_NOT_FOUND,
scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>());
return;
@@ -770,7 +774,8 @@ void ServiceWorkerCacheStorage::MatchAllCachesDidMatch(
ServiceWorkerCache::ErrorType error,
scoped_ptr<ServiceWorkerResponse> response,
scoped_ptr<storage::BlobDataHandle> handle) {
- if (callback->is_null() || error == ServiceWorkerCache::ErrorTypeNotFound) {
+ if (callback->is_null() ||
+ error == ServiceWorkerCache::ERROR_TYPE_NOT_FOUND) {
barrier_closure.Run();
return;
}
@@ -783,7 +788,7 @@ void ServiceWorkerCacheStorage::MatchAllCachesDidMatch(
void ServiceWorkerCacheStorage::MatchAllCachesDidMatchAll(
scoped_ptr<ServiceWorkerCache::ResponseCallback> callback) {
if (!callback->is_null()) {
- callback->Run(ServiceWorkerCache::ErrorTypeNotFound,
+ callback->Run(ServiceWorkerCache::ERROR_TYPE_NOT_FOUND,
scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>());
}

Powered by Google App Engine
This is Rietveld 408576698