Chromium Code Reviews| 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>()); |
| } |