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
...@@ -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