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

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: Address comments from PS 2 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 cbf7f0ba7ea1f81d2c332fa1348f19359f59f669..61b4c2723ffa3ee5ec64763af177a08a0e14f3d8 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_macros.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",
+ cache != nullptr);
+
cache_map_.insert(std::make_pair(cache_name, cache->AsWeakPtr()));
ordered_cache_names_.push_back(cache_name);
@@ -631,6 +635,8 @@ void ServiceWorkerCacheStorage::CreateCacheDidWriteIndex(
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(cache.get());
+ // TODO(jkarlin): Handle !success.
+
callback.Run(cache, CACHE_STORAGE_ERROR_NO_ERROR);
}
@@ -717,7 +723,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 +776,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 +790,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