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

Unified Diff: content/browser/blob_storage/blob_dispatcher_host.cc

Issue 1888453005: [Blob] Better error reporting and histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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
« no previous file with comments | « content/browser/bad_message.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/blob_storage/blob_dispatcher_host.cc
diff --git a/content/browser/blob_storage/blob_dispatcher_host.cc b/content/browser/blob_storage/blob_dispatcher_host.cc
index 8b3741b13d71fdeae281213f9e389dd111e7d5f9..b96ccd048e3d96eb8be499d3d038b1480a4fe692 100644
--- a/content/browser/blob_storage/blob_dispatcher_host.cc
+++ b/content/browser/blob_storage/blob_dispatcher_host.cc
@@ -63,7 +63,8 @@ void BlobDispatcherHost::OnRegisterBlobUUID(
const std::set<std::string>& referenced_blob_uuids) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
BlobStorageContext* context = this->context();
- if (uuid.empty() || context->registry().HasEntry(uuid)) {
+ if (uuid.empty() || context->registry().HasEntry(uuid) ||
+ async_builder_.IsBeingBuilt(uuid)) {
bad_message::ReceivedBadMessage(this, bad_message::BDH_UUID_REGISTERED);
return;
}
@@ -73,9 +74,9 @@ void BlobDispatcherHost::OnRegisterBlobUUID(
switch (result) {
case BlobTransportResult::BAD_IPC:
blobs_inuse_map_.erase(uuid);
- bad_message::ReceivedBadMessage(this, bad_message::BDH_INVALID_OPERATION);
+ bad_message::ReceivedBadMessage(this,
+ bad_message::BDH_CONSTRUCTION_FAILED);
break;
- ;
case BlobTransportResult::CANCEL_REFERENCED_BLOB_BROKEN:
// The async builder builds the blob as broken, and we just need to send
// the cancel message back to the renderer.
@@ -208,7 +209,8 @@ void BlobDispatcherHost::OnIncrementBlobRefCount(const std::string& uuid) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
BlobStorageContext* context = this->context();
if (uuid.empty() || !context->registry().HasEntry(uuid)) {
- bad_message::ReceivedBadMessage(this, bad_message::BDH_INVALID_OPERATION);
+ bad_message::ReceivedBadMessage(
+ this, bad_message::BDH_INVALID_REFCOUNT_OPERATION);
return;
}
context->IncrementBlobRefCount(uuid);
@@ -218,7 +220,8 @@ void BlobDispatcherHost::OnIncrementBlobRefCount(const std::string& uuid) {
void BlobDispatcherHost::OnDecrementBlobRefCount(const std::string& uuid) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (uuid.empty() || !IsInUseInHost(uuid)) {
- bad_message::ReceivedBadMessage(this, bad_message::BDH_INVALID_OPERATION);
+ bad_message::ReceivedBadMessage(
+ this, bad_message::BDH_INVALID_REFCOUNT_OPERATION);
return;
}
BlobStorageContext* context = this->context();
@@ -246,7 +249,8 @@ void BlobDispatcherHost::OnRegisterPublicBlobURL(const GURL& public_url,
BlobStorageContext* context = this->context();
if (uuid.empty() || !IsInUseInHost(uuid) ||
context->registry().IsURLMapped(public_url)) {
- bad_message::ReceivedBadMessage(this, bad_message::BDH_INVALID_OPERATION);
+ bad_message::ReceivedBadMessage(this,
+ bad_message::BDH_INVALID_URL_OPERATION);
return;
}
context->RegisterPublicBlobURL(public_url, uuid);
@@ -256,7 +260,8 @@ void BlobDispatcherHost::OnRegisterPublicBlobURL(const GURL& public_url,
void BlobDispatcherHost::OnRevokePublicBlobURL(const GURL& public_url) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!IsUrlRegisteredInHost(public_url)) {
- bad_message::ReceivedBadMessage(this, bad_message::BDH_INVALID_OPERATION);
+ bad_message::ReceivedBadMessage(this,
+ bad_message::BDH_INVALID_URL_OPERATION);
return;
}
context()->RevokePublicBlobURL(public_url);
« no previous file with comments | « content/browser/bad_message.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698