Commit f04de1ef authored by jkarlin's avatar jkarlin Committed by Commit bot

We're finding corrupted backends in the wild. As a first measurement

step, find out how often opens and creation fail.

Also refactored casing of an enum.

BUG=461654

Review URL: https://codereview.chromium.org/985053002

Cr-Commit-Position: refs/heads/master@{#320893}
parent d04d4593
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/guid.h" #include "base/guid.h"
#include "base/message_loop/message_loop_proxy.h" #include "base/message_loop/message_loop_proxy.h"
#include "base/metrics/histogram_macros.h"
#include "base/profiler/scoped_tracker.h" #include "base/profiler/scoped_tracker.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "content/browser/service_worker/service_worker_cache.pb.h" #include "content/browser/service_worker/service_worker_cache.pb.h"
...@@ -435,14 +436,14 @@ void ServiceWorkerCache::Put(scoped_ptr<ServiceWorkerFetchRequest> request, ...@@ -435,14 +436,14 @@ void ServiceWorkerCache::Put(scoped_ptr<ServiceWorkerFetchRequest> request,
if (!response->blob_uuid.empty()) { if (!response->blob_uuid.empty()) {
if (!blob_storage_context_) { if (!blob_storage_context_) {
callback.Run(ErrorTypeStorage, scoped_ptr<ServiceWorkerResponse>(), callback.Run(ERROR_TYPE_STORAGE, scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
} }
blob_data_handle = blob_data_handle =
blob_storage_context_->GetBlobDataFromUUID(response->blob_uuid); blob_storage_context_->GetBlobDataFromUUID(response->blob_uuid);
if (!blob_data_handle) { if (!blob_data_handle) {
callback.Run(ErrorTypeStorage, scoped_ptr<ServiceWorkerResponse>(), callback.Run(ERROR_TYPE_STORAGE, scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
} }
...@@ -478,7 +479,7 @@ void ServiceWorkerCache::Match(scoped_ptr<ServiceWorkerFetchRequest> request, ...@@ -478,7 +479,7 @@ void ServiceWorkerCache::Match(scoped_ptr<ServiceWorkerFetchRequest> request,
InitBackend(); InitBackend();
break; break;
case BACKEND_CLOSED: case BACKEND_CLOSED:
callback.Run(ErrorTypeStorage, scoped_ptr<ServiceWorkerResponse>(), callback.Run(ERROR_TYPE_STORAGE, scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
case BACKEND_OPEN: case BACKEND_OPEN:
...@@ -501,7 +502,7 @@ void ServiceWorkerCache::Delete(scoped_ptr<ServiceWorkerFetchRequest> request, ...@@ -501,7 +502,7 @@ void ServiceWorkerCache::Delete(scoped_ptr<ServiceWorkerFetchRequest> request,
InitBackend(); InitBackend();
break; break;
case BACKEND_CLOSED: case BACKEND_CLOSED:
callback.Run(ErrorTypeStorage); callback.Run(ERROR_TYPE_STORAGE);
return; return;
case BACKEND_OPEN: case BACKEND_OPEN:
DCHECK(backend_); DCHECK(backend_);
...@@ -521,7 +522,7 @@ void ServiceWorkerCache::Keys(const RequestsCallback& callback) { ...@@ -521,7 +522,7 @@ void ServiceWorkerCache::Keys(const RequestsCallback& callback) {
InitBackend(); InitBackend();
break; break;
case BACKEND_CLOSED: case BACKEND_CLOSED:
callback.Run(ErrorTypeStorage, scoped_ptr<Requests>()); callback.Run(ERROR_TYPE_STORAGE, scoped_ptr<Requests>());
return; return;
case BACKEND_OPEN: case BACKEND_OPEN:
DCHECK(backend_); DCHECK(backend_);
...@@ -600,7 +601,7 @@ void ServiceWorkerCache::MatchImpl( ...@@ -600,7 +601,7 @@ void ServiceWorkerCache::MatchImpl(
const ResponseCallback& callback) { const ResponseCallback& callback) {
DCHECK(backend_state_ != BACKEND_UNINITIALIZED); DCHECK(backend_state_ != BACKEND_UNINITIALIZED);
if (backend_state_ != BACKEND_OPEN) { if (backend_state_ != BACKEND_OPEN) {
callback.Run(ErrorTypeStorage, scoped_ptr<ServiceWorkerResponse>(), callback.Run(ERROR_TYPE_STORAGE, scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
} }
...@@ -625,9 +626,10 @@ void ServiceWorkerCache::MatchDidOpenEntry( ...@@ -625,9 +626,10 @@ void ServiceWorkerCache::MatchDidOpenEntry(
scoped_ptr<MatchContext> match_context, scoped_ptr<MatchContext> match_context,
int rv) { int rv) {
if (rv != net::OK) { if (rv != net::OK) {
match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeNotFound, match_context->original_callback.Run(
scoped_ptr<ServiceWorkerResponse>(), ServiceWorkerCache::ERROR_TYPE_NOT_FOUND,
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>());
return; return;
} }
...@@ -646,7 +648,7 @@ void ServiceWorkerCache::MatchDidReadMetadata( ...@@ -646,7 +648,7 @@ void ServiceWorkerCache::MatchDidReadMetadata(
scoped_ptr<MatchContext> match_context, scoped_ptr<MatchContext> match_context,
scoped_ptr<ServiceWorkerCacheMetadata> metadata) { scoped_ptr<ServiceWorkerCacheMetadata> metadata) {
if (!metadata) { if (!metadata) {
match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeStorage, match_context->original_callback.Run(ServiceWorkerCache::ERROR_TYPE_STORAGE,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -680,14 +682,15 @@ void ServiceWorkerCache::MatchDidReadMetadata( ...@@ -680,14 +682,15 @@ void ServiceWorkerCache::MatchDidReadMetadata(
if (!VaryMatches(match_context->request->headers, cached_request_headers, if (!VaryMatches(match_context->request->headers, cached_request_headers,
response->headers)) { response->headers)) {
match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeNotFound, match_context->original_callback.Run(
scoped_ptr<ServiceWorkerResponse>(), ServiceWorkerCache::ERROR_TYPE_NOT_FOUND,
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>());
return; return;
} }
if (match_context->entry->GetDataSize(INDEX_RESPONSE_BODY) == 0) { if (match_context->entry->GetDataSize(INDEX_RESPONSE_BODY) == 0) {
match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeOK, match_context->original_callback.Run(ServiceWorkerCache::ERROR_TYPE_OK,
match_context->response.Pass(), match_context->response.Pass(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -695,7 +698,7 @@ void ServiceWorkerCache::MatchDidReadMetadata( ...@@ -695,7 +698,7 @@ void ServiceWorkerCache::MatchDidReadMetadata(
// Stream the response body into a blob. // Stream the response body into a blob.
if (!match_context->blob_storage_context) { if (!match_context->blob_storage_context) {
match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeStorage, match_context->original_callback.Run(ServiceWorkerCache::ERROR_TYPE_STORAGE,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -732,7 +735,7 @@ void ServiceWorkerCache::MatchDidReadResponseBodyData( ...@@ -732,7 +735,7 @@ void ServiceWorkerCache::MatchDidReadResponseBodyData(
"422516 ServiceWorkerCache::MatchDidReadResponseBodyData")); "422516 ServiceWorkerCache::MatchDidReadResponseBodyData"));
if (rv < 0) { if (rv < 0) {
match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeStorage, match_context->original_callback.Run(ServiceWorkerCache::ERROR_TYPE_STORAGE,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -771,7 +774,7 @@ void ServiceWorkerCache::MatchDidReadResponseBodyData( ...@@ -771,7 +774,7 @@ void ServiceWorkerCache::MatchDidReadResponseBodyData(
void ServiceWorkerCache::MatchDoneWithBody( void ServiceWorkerCache::MatchDoneWithBody(
scoped_ptr<MatchContext> match_context) { scoped_ptr<MatchContext> match_context) {
if (!match_context->blob_storage_context) { if (!match_context->blob_storage_context) {
match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeStorage, match_context->original_callback.Run(ServiceWorkerCache::ERROR_TYPE_STORAGE,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -781,7 +784,7 @@ void ServiceWorkerCache::MatchDoneWithBody( ...@@ -781,7 +784,7 @@ void ServiceWorkerCache::MatchDoneWithBody(
match_context->blob_storage_context->AddFinishedBlob( match_context->blob_storage_context->AddFinishedBlob(
match_context->blob_data.get())); match_context->blob_data.get()));
match_context->original_callback.Run(ServiceWorkerCache::ErrorTypeOK, match_context->original_callback.Run(ServiceWorkerCache::ERROR_TYPE_OK,
match_context->response.Pass(), match_context->response.Pass(),
blob_data_handle.Pass()); blob_data_handle.Pass());
} }
...@@ -789,7 +792,7 @@ void ServiceWorkerCache::MatchDoneWithBody( ...@@ -789,7 +792,7 @@ void ServiceWorkerCache::MatchDoneWithBody(
void ServiceWorkerCache::PutImpl(scoped_ptr<PutContext> put_context) { void ServiceWorkerCache::PutImpl(scoped_ptr<PutContext> put_context) {
DCHECK(backend_state_ != BACKEND_UNINITIALIZED); DCHECK(backend_state_ != BACKEND_UNINITIALIZED);
if (backend_state_ != BACKEND_OPEN) { if (backend_state_ != BACKEND_OPEN) {
put_context->callback.Run(ErrorTypeStorage, put_context->callback.Run(ERROR_TYPE_STORAGE,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -806,7 +809,7 @@ void ServiceWorkerCache::PutImpl(scoped_ptr<PutContext> put_context) { ...@@ -806,7 +809,7 @@ void ServiceWorkerCache::PutImpl(scoped_ptr<PutContext> put_context) {
void ServiceWorkerCache::PutDidDelete(scoped_ptr<PutContext> put_context, void ServiceWorkerCache::PutDidDelete(scoped_ptr<PutContext> put_context,
ErrorType delete_error) { ErrorType delete_error) {
if (backend_state_ != BACKEND_OPEN) { if (backend_state_ != BACKEND_OPEN) {
put_context->callback.Run(ErrorTypeStorage, put_context->callback.Run(ERROR_TYPE_STORAGE,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -830,7 +833,7 @@ void ServiceWorkerCache::PutDidDelete(scoped_ptr<PutContext> put_context, ...@@ -830,7 +833,7 @@ void ServiceWorkerCache::PutDidDelete(scoped_ptr<PutContext> put_context,
void ServiceWorkerCache::PutDidCreateEntry(scoped_ptr<PutContext> put_context, void ServiceWorkerCache::PutDidCreateEntry(scoped_ptr<PutContext> put_context,
int rv) { int rv) {
if (rv != net::OK) { if (rv != net::OK) {
put_context->callback.Run(ServiceWorkerCache::ErrorTypeExists, put_context->callback.Run(ServiceWorkerCache::ERROR_TYPE_EXISTS,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -871,7 +874,7 @@ void ServiceWorkerCache::PutDidCreateEntry(scoped_ptr<PutContext> put_context, ...@@ -871,7 +874,7 @@ void ServiceWorkerCache::PutDidCreateEntry(scoped_ptr<PutContext> put_context,
scoped_ptr<std::string> serialized(new std::string()); scoped_ptr<std::string> serialized(new std::string());
if (!metadata.SerializeToString(serialized.get())) { if (!metadata.SerializeToString(serialized.get())) {
put_context->callback.Run(ServiceWorkerCache::ErrorTypeStorage, put_context->callback.Run(ServiceWorkerCache::ERROR_TYPE_STORAGE,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -903,7 +906,7 @@ void ServiceWorkerCache::PutDidWriteHeaders(scoped_ptr<PutContext> put_context, ...@@ -903,7 +906,7 @@ void ServiceWorkerCache::PutDidWriteHeaders(scoped_ptr<PutContext> put_context,
int rv) { int rv) {
if (rv != expected_bytes) { if (rv != expected_bytes) {
put_context->cache_entry->Doom(); put_context->cache_entry->Doom();
put_context->callback.Run(ServiceWorkerCache::ErrorTypeStorage, put_context->callback.Run(ServiceWorkerCache::ERROR_TYPE_STORAGE,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -921,7 +924,7 @@ void ServiceWorkerCache::PutDidWriteHeaders(scoped_ptr<PutContext> put_context, ...@@ -921,7 +924,7 @@ void ServiceWorkerCache::PutDidWriteHeaders(scoped_ptr<PutContext> put_context,
put_context->cache_entry->GetDataSize(INDEX_HEADERS)); put_context->cache_entry->GetDataSize(INDEX_HEADERS));
} }
put_context->callback.Run(ServiceWorkerCache::ErrorTypeOK, put_context->callback.Run(ServiceWorkerCache::ERROR_TYPE_OK,
put_context->response.Pass(), put_context->response.Pass(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -957,7 +960,7 @@ void ServiceWorkerCache::PutDidWriteBlobToCache( ...@@ -957,7 +960,7 @@ void ServiceWorkerCache::PutDidWriteBlobToCache(
if (!success) { if (!success) {
put_context->cache_entry->Doom(); put_context->cache_entry->Doom();
put_context->callback.Run(ServiceWorkerCache::ErrorTypeStorage, put_context->callback.Run(ServiceWorkerCache::ERROR_TYPE_STORAGE,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -972,7 +975,7 @@ void ServiceWorkerCache::PutDidWriteBlobToCache( ...@@ -972,7 +975,7 @@ void ServiceWorkerCache::PutDidWriteBlobToCache(
put_context->cache_entry->GetDataSize(INDEX_RESPONSE_BODY)); put_context->cache_entry->GetDataSize(INDEX_RESPONSE_BODY));
} }
put_context->callback.Run(ServiceWorkerCache::ErrorTypeOK, put_context->callback.Run(ServiceWorkerCache::ERROR_TYPE_OK,
put_context->response.Pass(), put_context->response.Pass(),
put_context->out_blob_data_handle.Pass()); put_context->out_blob_data_handle.Pass());
} }
...@@ -982,7 +985,7 @@ void ServiceWorkerCache::DeleteImpl( ...@@ -982,7 +985,7 @@ void ServiceWorkerCache::DeleteImpl(
const ErrorCallback& callback) { const ErrorCallback& callback) {
DCHECK(backend_state_ != BACKEND_UNINITIALIZED); DCHECK(backend_state_ != BACKEND_UNINITIALIZED);
if (backend_state_ != BACKEND_OPEN) { if (backend_state_ != BACKEND_OPEN) {
callback.Run(ErrorTypeStorage); callback.Run(ERROR_TYPE_STORAGE);
return; return;
} }
scoped_ptr<disk_cache::Entry*> entry(new disk_cache::Entry*); scoped_ptr<disk_cache::Entry*> entry(new disk_cache::Entry*);
...@@ -1010,7 +1013,7 @@ void ServiceWorkerCache::DeleteDidOpenEntry( ...@@ -1010,7 +1013,7 @@ void ServiceWorkerCache::DeleteDidOpenEntry(
const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy, const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy,
int rv) { int rv) {
if (rv != net::OK) { if (rv != net::OK) {
callback.Run(ServiceWorkerCache::ErrorTypeNotFound); callback.Run(ServiceWorkerCache::ERROR_TYPE_NOT_FOUND);
return; return;
} }
...@@ -1026,13 +1029,13 @@ void ServiceWorkerCache::DeleteDidOpenEntry( ...@@ -1026,13 +1029,13 @@ void ServiceWorkerCache::DeleteDidOpenEntry(
} }
entry->Doom(); entry->Doom();
callback.Run(ServiceWorkerCache::ErrorTypeOK); callback.Run(ServiceWorkerCache::ERROR_TYPE_OK);
} }
void ServiceWorkerCache::KeysImpl(const RequestsCallback& callback) { void ServiceWorkerCache::KeysImpl(const RequestsCallback& callback) {
DCHECK(backend_state_ != BACKEND_UNINITIALIZED); DCHECK(backend_state_ != BACKEND_UNINITIALIZED);
if (backend_state_ != BACKEND_OPEN) { if (backend_state_ != BACKEND_OPEN) {
callback.Run(ErrorTypeStorage, scoped_ptr<Requests>()); callback.Run(ERROR_TYPE_STORAGE, scoped_ptr<Requests>());
return; return;
} }
...@@ -1074,13 +1077,13 @@ void ServiceWorkerCache::KeysDidOpenNextEntry( ...@@ -1074,13 +1077,13 @@ void ServiceWorkerCache::KeysDidOpenNextEntry(
} }
if (rv < 0) { if (rv < 0) {
keys_context->original_callback.Run(ErrorTypeStorage, keys_context->original_callback.Run(ERROR_TYPE_STORAGE,
scoped_ptr<Requests>()); scoped_ptr<Requests>());
return; return;
} }
if (backend_state_ != BACKEND_OPEN) { if (backend_state_ != BACKEND_OPEN) {
keys_context->original_callback.Run(ErrorTypeNotFound, keys_context->original_callback.Run(ERROR_TYPE_NOT_FOUND,
scoped_ptr<Requests>()); scoped_ptr<Requests>());
return; return;
} }
...@@ -1107,7 +1110,7 @@ void ServiceWorkerCache::KeysProcessNextEntry( ...@@ -1107,7 +1110,7 @@ void ServiceWorkerCache::KeysProcessNextEntry(
const Entries::iterator& iter) { const Entries::iterator& iter) {
if (iter == keys_context->entries.end()) { if (iter == keys_context->entries.end()) {
// All done. Return all of the keys. // All done. Return all of the keys.
keys_context->original_callback.Run(ErrorTypeOK, keys_context->original_callback.Run(ERROR_TYPE_OK,
keys_context->out_keys.Pass()); keys_context->out_keys.Pass());
return; return;
} }
...@@ -1192,12 +1195,12 @@ void ServiceWorkerCache::CreateBackendDidCreate( ...@@ -1192,12 +1195,12 @@ void ServiceWorkerCache::CreateBackendDidCreate(
scoped_ptr<ScopedBackendPtr> backend_ptr, scoped_ptr<ScopedBackendPtr> backend_ptr,
int rv) { int rv) {
if (rv != net::OK) { if (rv != net::OK) {
callback.Run(ServiceWorkerCache::ErrorTypeStorage); callback.Run(ServiceWorkerCache::ERROR_TYPE_STORAGE);
return; return;
} }
backend_ = backend_ptr->Pass(); backend_ = backend_ptr->Pass();
callback.Run(ServiceWorkerCache::ErrorTypeOK); callback.Run(ServiceWorkerCache::ERROR_TYPE_OK);
} }
void ServiceWorkerCache::InitBackend() { void ServiceWorkerCache::InitBackend() {
...@@ -1217,10 +1220,14 @@ void ServiceWorkerCache::InitBackend() { ...@@ -1217,10 +1220,14 @@ void ServiceWorkerCache::InitBackend() {
void ServiceWorkerCache::InitDone(ErrorType error) { void ServiceWorkerCache::InitDone(ErrorType error) {
initializing_ = false; initializing_ = false;
backend_state_ = (error == ErrorTypeOK && backend_ && backend_state_ = (error == ERROR_TYPE_OK && backend_ &&
backend_state_ == BACKEND_UNINITIALIZED) backend_state_ == BACKEND_UNINITIALIZED)
? BACKEND_OPEN ? BACKEND_OPEN
: BACKEND_CLOSED; : BACKEND_CLOSED;
UMA_HISTOGRAM_ENUMERATION("ServiceWorkerCache.InitBackendResult", error,
ErrorType::ERROR_TYPE_LAST + 1);
scheduler_->CompleteOperationAndRunNext(); scheduler_->CompleteOperationAndRunNext();
} }
......
...@@ -40,11 +40,14 @@ class TestServiceWorkerCache; ...@@ -40,11 +40,14 @@ class TestServiceWorkerCache;
class CONTENT_EXPORT ServiceWorkerCache class CONTENT_EXPORT ServiceWorkerCache
: public base::RefCounted<ServiceWorkerCache> { : public base::RefCounted<ServiceWorkerCache> {
public: public:
// This enum is used in histograms, so do not change the ordering and always
// append new types to the end.
enum ErrorType { enum ErrorType {
ErrorTypeOK = 0, ERROR_TYPE_OK = 0,
ErrorTypeExists, ERROR_TYPE_EXISTS,
ErrorTypeStorage, ERROR_TYPE_STORAGE,
ErrorTypeNotFound ERROR_TYPE_NOT_FOUND,
ERROR_TYPE_LAST = ERROR_TYPE_NOT_FOUND
}; };
enum EntryIndex { INDEX_HEADERS = 0, INDEX_RESPONSE_BODY }; enum EntryIndex { INDEX_HEADERS = 0, INDEX_RESPONSE_BODY };
...@@ -69,19 +72,19 @@ class CONTENT_EXPORT ServiceWorkerCache ...@@ -69,19 +72,19 @@ class CONTENT_EXPORT ServiceWorkerCache
const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy, const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy,
base::WeakPtr<storage::BlobStorageContext> blob_context); base::WeakPtr<storage::BlobStorageContext> blob_context);
// Returns ErrorTypeNotFound if not found. // Returns ERROR_TYPE_NOT_FOUND if not found.
void Match(scoped_ptr<ServiceWorkerFetchRequest> request, void Match(scoped_ptr<ServiceWorkerFetchRequest> request,
const ResponseCallback& callback); const ResponseCallback& callback);
// Puts the request and response object in the cache. The response body (if // Puts the request and response object in the cache. The response body (if
// present) is stored in the cache, but not the request body. Returns // present) is stored in the cache, but not the request body. Returns
// ErrorTypeOK on success. // ERROR_TYPE_OK on success.
void Put(scoped_ptr<ServiceWorkerFetchRequest> request, void Put(scoped_ptr<ServiceWorkerFetchRequest> request,
scoped_ptr<ServiceWorkerResponse> response, scoped_ptr<ServiceWorkerResponse> response,
const ResponseCallback& callback); const ResponseCallback& callback);
// Returns ErrorNotFound if not found. Otherwise deletes and returns // Returns ErrorNotFound if not found. Otherwise deletes and returns
// ErrorTypeOK. // ERROR_TYPE_OK.
void Delete(scoped_ptr<ServiceWorkerFetchRequest> request, void Delete(scoped_ptr<ServiceWorkerFetchRequest> request,
const ErrorCallback& callback); const ErrorCallback& callback);
......
...@@ -51,16 +51,16 @@ WebServiceWorkerCacheError ToWebServiceWorkerCacheError( ...@@ -51,16 +51,16 @@ WebServiceWorkerCacheError ToWebServiceWorkerCacheError(
WebServiceWorkerCacheError CacheErrorToWebServiceWorkerCacheError( WebServiceWorkerCacheError CacheErrorToWebServiceWorkerCacheError(
ServiceWorkerCache::ErrorType err) { ServiceWorkerCache::ErrorType err) {
switch (err) { switch (err) {
case ServiceWorkerCache::ErrorTypeOK: case ServiceWorkerCache::ERROR_TYPE_OK:
NOTREACHED(); NOTREACHED();
return blink::WebServiceWorkerCacheErrorNotImplemented; return blink::WebServiceWorkerCacheErrorNotImplemented;
case ServiceWorkerCache::ErrorTypeExists: case ServiceWorkerCache::ERROR_TYPE_EXISTS:
return blink::WebServiceWorkerCacheErrorExists; return blink::WebServiceWorkerCacheErrorExists;
case ServiceWorkerCache::ErrorTypeStorage: case ServiceWorkerCache::ERROR_TYPE_STORAGE:
// TODO(jkarlin): Change this to CACHE_STORAGE_ERROR_STORAGE once that's // TODO(jkarlin): Change this to CACHE_STORAGE_ERROR_STORAGE once that's
// added. // added.
return blink::WebServiceWorkerCacheErrorNotFound; return blink::WebServiceWorkerCacheErrorNotFound;
case ServiceWorkerCache::ErrorTypeNotFound: case ServiceWorkerCache::ERROR_TYPE_NOT_FOUND:
return blink::WebServiceWorkerCacheErrorNotFound; return blink::WebServiceWorkerCacheErrorNotFound;
} }
NOTREACHED(); NOTREACHED();
...@@ -385,7 +385,7 @@ void ServiceWorkerCacheListener::OnCacheStorageMatchCallback( ...@@ -385,7 +385,7 @@ void ServiceWorkerCacheListener::OnCacheStorageMatchCallback(
ServiceWorkerCache::ErrorType error, ServiceWorkerCache::ErrorType error,
scoped_ptr<ServiceWorkerResponse> response, scoped_ptr<ServiceWorkerResponse> response,
scoped_ptr<storage::BlobDataHandle> blob_data_handle) { scoped_ptr<storage::BlobDataHandle> blob_data_handle) {
if (error != ServiceWorkerCache::ErrorTypeOK) { if (error != ServiceWorkerCache::ERROR_TYPE_OK) {
Send(ServiceWorkerMsg_CacheStorageMatchError( Send(ServiceWorkerMsg_CacheStorageMatchError(
request_id, CacheErrorToWebServiceWorkerCacheError(error))); request_id, CacheErrorToWebServiceWorkerCacheError(error)));
return; return;
...@@ -403,7 +403,7 @@ void ServiceWorkerCacheListener::OnCacheMatchCallback( ...@@ -403,7 +403,7 @@ void ServiceWorkerCacheListener::OnCacheMatchCallback(
ServiceWorkerCache::ErrorType error, ServiceWorkerCache::ErrorType error,
scoped_ptr<ServiceWorkerResponse> response, scoped_ptr<ServiceWorkerResponse> response,
scoped_ptr<storage::BlobDataHandle> blob_data_handle) { scoped_ptr<storage::BlobDataHandle> blob_data_handle) {
if (error != ServiceWorkerCache::ErrorTypeOK) { if (error != ServiceWorkerCache::ERROR_TYPE_OK) {
Send(ServiceWorkerMsg_CacheMatchError( Send(ServiceWorkerMsg_CacheMatchError(
request_id, CacheErrorToWebServiceWorkerCacheError(error))); request_id, CacheErrorToWebServiceWorkerCacheError(error)));
return; return;
...@@ -420,7 +420,7 @@ void ServiceWorkerCacheListener::OnCacheKeysCallback( ...@@ -420,7 +420,7 @@ void ServiceWorkerCacheListener::OnCacheKeysCallback(
const scoped_refptr<ServiceWorkerCache>& cache, const scoped_refptr<ServiceWorkerCache>& cache,
ServiceWorkerCache::ErrorType error, ServiceWorkerCache::ErrorType error,
scoped_ptr<ServiceWorkerCache::Requests> requests) { scoped_ptr<ServiceWorkerCache::Requests> requests) {
if (error != ServiceWorkerCache::ErrorTypeOK) { if (error != ServiceWorkerCache::ERROR_TYPE_OK) {
Send(ServiceWorkerMsg_CacheKeysError( Send(ServiceWorkerMsg_CacheKeysError(
request_id, CacheErrorToWebServiceWorkerCacheError(error))); request_id, CacheErrorToWebServiceWorkerCacheError(error)));
return; return;
...@@ -443,7 +443,7 @@ void ServiceWorkerCacheListener::OnCacheDeleteCallback( ...@@ -443,7 +443,7 @@ void ServiceWorkerCacheListener::OnCacheDeleteCallback(
int request_id, int request_id,
const scoped_refptr<ServiceWorkerCache>& cache, const scoped_refptr<ServiceWorkerCache>& cache,
ServiceWorkerCache::ErrorType error) { ServiceWorkerCache::ErrorType error) {
if (error != ServiceWorkerCache::ErrorTypeOK) { if (error != ServiceWorkerCache::ERROR_TYPE_OK) {
Send(ServiceWorkerMsg_CacheBatchError( Send(ServiceWorkerMsg_CacheBatchError(
request_id, CacheErrorToWebServiceWorkerCacheError(error))); request_id, CacheErrorToWebServiceWorkerCacheError(error)));
return; return;
...@@ -459,7 +459,7 @@ void ServiceWorkerCacheListener::OnCachePutCallback( ...@@ -459,7 +459,7 @@ void ServiceWorkerCacheListener::OnCachePutCallback(
ServiceWorkerCache::ErrorType error, ServiceWorkerCache::ErrorType error,
scoped_ptr<ServiceWorkerResponse> response, scoped_ptr<ServiceWorkerResponse> response,
scoped_ptr<storage::BlobDataHandle> blob_data_handle) { scoped_ptr<storage::BlobDataHandle> blob_data_handle) {
if (error != ServiceWorkerCache::ErrorTypeOK) { if (error != ServiceWorkerCache::ERROR_TYPE_OK) {
Send(ServiceWorkerMsg_CacheBatchError( Send(ServiceWorkerMsg_CacheBatchError(
request_id, CacheErrorToWebServiceWorkerCacheError(error))); request_id, CacheErrorToWebServiceWorkerCacheError(error)));
return; return;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/files/memory_mapped_file.h" #include "base/files/memory_mapped_file.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/metrics/histogram_macros.h"
#include "base/sha1.h" #include "base/sha1.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
...@@ -613,6 +614,9 @@ void ServiceWorkerCacheStorage::CreateCacheDidCreateCache( ...@@ -613,6 +614,9 @@ void ServiceWorkerCacheStorage::CreateCacheDidCreateCache(
return; return;
} }
UMA_HISTOGRAM_BOOLEAN("ServiceWorkerCache.CreateCacheStorageResult",
cache != nullptr);
cache_map_.insert(std::make_pair(cache_name, cache->AsWeakPtr())); cache_map_.insert(std::make_pair(cache_name, cache->AsWeakPtr()));
ordered_cache_names_.push_back(cache_name); ordered_cache_names_.push_back(cache_name);
...@@ -631,6 +635,8 @@ void ServiceWorkerCacheStorage::CreateCacheDidWriteIndex( ...@@ -631,6 +635,8 @@ void ServiceWorkerCacheStorage::CreateCacheDidWriteIndex(
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(cache.get()); DCHECK(cache.get());
// TODO(jkarlin): Handle !success.
callback.Run(cache, CACHE_STORAGE_ERROR_NO_ERROR); callback.Run(cache, CACHE_STORAGE_ERROR_NO_ERROR);
} }
...@@ -717,7 +723,7 @@ void ServiceWorkerCacheStorage::MatchCacheImpl( ...@@ -717,7 +723,7 @@ void ServiceWorkerCacheStorage::MatchCacheImpl(
scoped_refptr<ServiceWorkerCache> cache = GetLoadedCache(cache_name); scoped_refptr<ServiceWorkerCache> cache = GetLoadedCache(cache_name);
if (!cache.get()) { if (!cache.get()) {
callback.Run(ServiceWorkerCache::ErrorTypeNotFound, callback.Run(ServiceWorkerCache::ERROR_TYPE_NOT_FOUND,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
return; return;
...@@ -770,7 +776,8 @@ void ServiceWorkerCacheStorage::MatchAllCachesDidMatch( ...@@ -770,7 +776,8 @@ void ServiceWorkerCacheStorage::MatchAllCachesDidMatch(
ServiceWorkerCache::ErrorType error, ServiceWorkerCache::ErrorType error,
scoped_ptr<ServiceWorkerResponse> response, scoped_ptr<ServiceWorkerResponse> response,
scoped_ptr<storage::BlobDataHandle> handle) { 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(); barrier_closure.Run();
return; return;
} }
...@@ -783,7 +790,7 @@ void ServiceWorkerCacheStorage::MatchAllCachesDidMatch( ...@@ -783,7 +790,7 @@ void ServiceWorkerCacheStorage::MatchAllCachesDidMatch(
void ServiceWorkerCacheStorage::MatchAllCachesDidMatchAll( void ServiceWorkerCacheStorage::MatchAllCachesDidMatchAll(
scoped_ptr<ServiceWorkerCache::ResponseCallback> callback) { scoped_ptr<ServiceWorkerCache::ResponseCallback> callback) {
if (!callback->is_null()) { if (!callback->is_null()) {
callback->Run(ServiceWorkerCache::ErrorTypeNotFound, callback->Run(ServiceWorkerCache::ERROR_TYPE_NOT_FOUND,
scoped_ptr<ServiceWorkerResponse>(), scoped_ptr<ServiceWorkerResponse>(),
scoped_ptr<storage::BlobDataHandle>()); scoped_ptr<storage::BlobDataHandle>());
} }
......
...@@ -28,7 +28,7 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test { ...@@ -28,7 +28,7 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test {
callback_bool_(false), callback_bool_(false),
callback_error_( callback_error_(
ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_NO_ERROR), ServiceWorkerCacheStorage::CACHE_STORAGE_ERROR_NO_ERROR),
callback_cache_error_(ServiceWorkerCache::ErrorTypeOK), callback_cache_error_(ServiceWorkerCache::ERROR_TYPE_OK),
origin1_("http://example1.com"), origin1_("http://example1.com"),
origin2_("http://example2.com") {} origin2_("http://example2.com") {}
...@@ -186,7 +186,7 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test { ...@@ -186,7 +186,7 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test {
base::Unretained(this), base::Unretained(loop.get()))); base::Unretained(this), base::Unretained(loop.get())));
loop->Run(); loop->Run();
bool error = callback_cache_error_ != ServiceWorkerCache::ErrorTypeOK; bool error = callback_cache_error_ != ServiceWorkerCache::ERROR_TYPE_OK;
return !error; return !error;
} }
...@@ -201,7 +201,7 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test { ...@@ -201,7 +201,7 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test {
base::Unretained(this), base::Unretained(loop.get()))); base::Unretained(this), base::Unretained(loop.get())));
loop->Run(); loop->Run();
bool error = callback_cache_error_ != ServiceWorkerCache::ErrorTypeOK; bool error = callback_cache_error_ != ServiceWorkerCache::ERROR_TYPE_OK;
return !error; return !error;
} }
...@@ -221,7 +221,7 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test { ...@@ -221,7 +221,7 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test {
base::Unretained(loop.get()))); base::Unretained(loop.get())));
loop->Run(); loop->Run();
bool error = callback_cache_error_ != ServiceWorkerCache::ErrorTypeOK; bool error = callback_cache_error_ != ServiceWorkerCache::ERROR_TYPE_OK;
return !error; return !error;
} }
...@@ -238,7 +238,7 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test { ...@@ -238,7 +238,7 @@ class ServiceWorkerCacheStorageManagerTest : public testing::Test {
base::Unretained(loop.get()))); base::Unretained(loop.get())));
loop->Run(); loop->Run();
bool error = callback_cache_error_ != ServiceWorkerCache::ErrorTypeOK; bool error = callback_cache_error_ != ServiceWorkerCache::ERROR_TYPE_OK;
return !error; return !error;
} }
...@@ -377,14 +377,14 @@ TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchNoEntry) { ...@@ -377,14 +377,14 @@ TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchNoEntry) {
EXPECT_TRUE(Open(origin1_, "foo")); EXPECT_TRUE(Open(origin1_, "foo"));
EXPECT_TRUE(CachePut(callback_cache_, GURL("http://example.com/foo"))); EXPECT_TRUE(CachePut(callback_cache_, GURL("http://example.com/foo")));
EXPECT_FALSE(StorageMatch(origin1_, "foo", GURL("http://example.com/bar"))); EXPECT_FALSE(StorageMatch(origin1_, "foo", GURL("http://example.com/bar")));
EXPECT_EQ(ServiceWorkerCache::ErrorTypeNotFound, callback_cache_error_); EXPECT_EQ(ServiceWorkerCache::ERROR_TYPE_NOT_FOUND, callback_cache_error_);
} }
TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchNoCache) { TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchNoCache) {
EXPECT_TRUE(Open(origin1_, "foo")); EXPECT_TRUE(Open(origin1_, "foo"));
EXPECT_TRUE(CachePut(callback_cache_, GURL("http://example.com/foo"))); EXPECT_TRUE(CachePut(callback_cache_, GURL("http://example.com/foo")));
EXPECT_FALSE(StorageMatch(origin1_, "bar", GURL("http://example.com/foo"))); EXPECT_FALSE(StorageMatch(origin1_, "bar", GURL("http://example.com/foo")));
EXPECT_EQ(ServiceWorkerCache::ErrorTypeNotFound, callback_cache_error_); EXPECT_EQ(ServiceWorkerCache::ERROR_TYPE_NOT_FOUND, callback_cache_error_);
} }
TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchAllEntryExists) { TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchAllEntryExists) {
...@@ -397,12 +397,12 @@ TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchAllNoEntry) { ...@@ -397,12 +397,12 @@ TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchAllNoEntry) {
EXPECT_TRUE(Open(origin1_, "foo")); EXPECT_TRUE(Open(origin1_, "foo"));
EXPECT_TRUE(CachePut(callback_cache_, GURL("http://example.com/foo"))); EXPECT_TRUE(CachePut(callback_cache_, GURL("http://example.com/foo")));
EXPECT_FALSE(StorageMatchAll(origin1_, GURL("http://example.com/bar"))); EXPECT_FALSE(StorageMatchAll(origin1_, GURL("http://example.com/bar")));
EXPECT_EQ(ServiceWorkerCache::ErrorTypeNotFound, callback_cache_error_); EXPECT_EQ(ServiceWorkerCache::ERROR_TYPE_NOT_FOUND, callback_cache_error_);
} }
TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchAllNoCaches) { TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchAllNoCaches) {
EXPECT_FALSE(StorageMatchAll(origin1_, GURL("http://example.com/foo"))); EXPECT_FALSE(StorageMatchAll(origin1_, GURL("http://example.com/foo")));
EXPECT_EQ(ServiceWorkerCache::ErrorTypeNotFound, callback_cache_error_); EXPECT_EQ(ServiceWorkerCache::ERROR_TYPE_NOT_FOUND, callback_cache_error_);
} }
TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchAllEntryExistsTwice) { TEST_P(ServiceWorkerCacheStorageManagerTestP, StorageMatchAllEntryExistsTwice) {
......
...@@ -174,7 +174,7 @@ class ServiceWorkerCacheTest : public testing::Test { ...@@ -174,7 +174,7 @@ class ServiceWorkerCacheTest : public testing::Test {
public: public:
ServiceWorkerCacheTest() ServiceWorkerCacheTest()
: browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP), : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP),
callback_error_(ServiceWorkerCache::ErrorTypeOK), callback_error_(ServiceWorkerCache::ERROR_TYPE_OK),
callback_closed_(false) {} callback_closed_(false) {}
void SetUp() override { void SetUp() override {
...@@ -295,7 +295,7 @@ class ServiceWorkerCacheTest : public testing::Test { ...@@ -295,7 +295,7 @@ class ServiceWorkerCacheTest : public testing::Test {
// thread. // thread.
loop->Run(); loop->Run();
return callback_error_ == ServiceWorkerCache::ErrorTypeOK; return callback_error_ == ServiceWorkerCache::ERROR_TYPE_OK;
} }
bool Match(const ServiceWorkerFetchRequest& request) { bool Match(const ServiceWorkerFetchRequest& request) {
...@@ -307,7 +307,7 @@ class ServiceWorkerCacheTest : public testing::Test { ...@@ -307,7 +307,7 @@ class ServiceWorkerCacheTest : public testing::Test {
base::Unretained(loop.get()))); base::Unretained(loop.get())));
loop->Run(); loop->Run();
return callback_error_ == ServiceWorkerCache::ErrorTypeOK; return callback_error_ == ServiceWorkerCache::ERROR_TYPE_OK;
} }
bool Delete(const ServiceWorkerFetchRequest& request) { bool Delete(const ServiceWorkerFetchRequest& request) {
...@@ -319,7 +319,7 @@ class ServiceWorkerCacheTest : public testing::Test { ...@@ -319,7 +319,7 @@ class ServiceWorkerCacheTest : public testing::Test {
base::Unretained(loop.get()))); base::Unretained(loop.get())));
loop->Run(); loop->Run();
return callback_error_ == ServiceWorkerCache::ErrorTypeOK; return callback_error_ == ServiceWorkerCache::ERROR_TYPE_OK;
} }
bool Keys() { bool Keys() {
...@@ -330,7 +330,7 @@ class ServiceWorkerCacheTest : public testing::Test { ...@@ -330,7 +330,7 @@ class ServiceWorkerCacheTest : public testing::Test {
base::Unretained(loop.get()))); base::Unretained(loop.get())));
loop->Run(); loop->Run();
return callback_error_ == ServiceWorkerCache::ErrorTypeOK; return callback_error_ == ServiceWorkerCache::ERROR_TYPE_OK;
} }
bool Close() { bool Close() {
...@@ -371,7 +371,7 @@ class ServiceWorkerCacheTest : public testing::Test { ...@@ -371,7 +371,7 @@ class ServiceWorkerCacheTest : public testing::Test {
callback_error_ = error; callback_error_ = error;
callback_response_ = response.Pass(); callback_response_ = response.Pass();
callback_response_data_.reset(); callback_response_data_.reset();
if (error == ServiceWorkerCache::ErrorTypeOK && if (error == ServiceWorkerCache::ERROR_TYPE_OK &&
!callback_response_->blob_uuid.empty()) { !callback_response_->blob_uuid.empty()) {
callback_response_data_ = body_handle.Pass(); callback_response_data_ = body_handle.Pass();
} }
...@@ -516,7 +516,7 @@ TEST_F(ServiceWorkerCacheTest, PutBodyDropBlobRef) { ...@@ -516,7 +516,7 @@ TEST_F(ServiceWorkerCacheTest, PutBodyDropBlobRef) {
blob_handle_.reset(); blob_handle_.reset();
loop->Run(); loop->Run();
EXPECT_EQ(ServiceWorkerCache::ErrorTypeOK, callback_error_); EXPECT_EQ(ServiceWorkerCache::ERROR_TYPE_OK, callback_error_);
} }
TEST_P(ServiceWorkerCacheTestP, PutReplace) { TEST_P(ServiceWorkerCacheTestP, PutReplace) {
......
...@@ -33707,6 +33707,23 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -33707,6 +33707,23 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary> </summary>
</histogram> </histogram>
<histogram name="ServiceWorkerCache.CreateCacheStorageResult"
enum="BooleanCreated">
<owner>jkarlin@chromium.org</owner>
<summary>
Whether a new ServiceWorkerCacheStorage and its directory were successfully
created on disk.
</summary>
</histogram>
<histogram name="ServiceWorkerCache.InitBackendResult"
enum="ServiceWorkerCacheErrorType">
<owner>jkarlin@chromium.org</owner>
<summary>
The result of opening the backend in the ServiceWorker Cache API.
</summary>
</histogram>
<histogram name="Session.TotalDuration" units="milliseconds"> <histogram name="Session.TotalDuration" units="milliseconds">
<owner>mariakhomenko@chromium.org</owner> <owner>mariakhomenko@chromium.org</owner>
<owner>fqian@chromium.org</owner> <owner>fqian@chromium.org</owner>
...@@ -44986,6 +45003,11 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -44986,6 +45003,11 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="1" label="Covered"/> <int value="1" label="Covered"/>
</enum> </enum>
<enum name="BooleanCreated" type="int">
<int value="0" label="Not created"/>
<int value="1" label="Created"/>
</enum>
<enum name="BooleanCredentialsLost" type="int"> <enum name="BooleanCredentialsLost" type="int">
<int value="0" label="Found Credentials"/> <int value="0" label="Found Credentials"/>
<int value="1" label="Missing Credentials"/> <int value="1" label="Missing Credentials"/>
...@@ -58633,6 +58655,13 @@ To add a new entry, add it with any value and run test to compute valid value. ...@@ -58633,6 +58655,13 @@ To add a new entry, add it with any value and run test to compute valid value.
<int value="11" label="SERVICE_UTILITY_FAILED_TO_START"/> <int value="11" label="SERVICE_UTILITY_FAILED_TO_START"/>
</enum> </enum>
<enum name="ServiceWorkerCacheErrorType" type="int">
<int value="0" label="OK"/>
<int value="1" label="Exists Error"/>
<int value="2" label="Storage Error"/>
<int value="3" label="Not Found Error"/>
</enum>
<enum name="ServiceWorkerDatabaseStatus" type="int"> <enum name="ServiceWorkerDatabaseStatus" type="int">
<int value="0" label="OK"/> <int value="0" label="OK"/>
<int value="1" label="Not Found Error"/> <int value="1" label="Not Found Error"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment