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

Unified Diff: content/common/resource_messages.cc

Issue 2378253002: BlobDispatcherHost: don't rely on NOTREACHED() checks in ParamTraits::Read (Closed)
Patch Set: notreached Created 4 years, 2 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/blob_storage/blob_dispatcher_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/resource_messages.cc
diff --git a/content/common/resource_messages.cc b/content/common/resource_messages.cc
index 3b738693c742e7ab2238391fff24e07a634625cb..31330a7e2080c3b3be15f73fb19970becba02885 100644
--- a/content/common/resource_messages.cc
+++ b/content/common/resource_messages.cc
@@ -145,14 +145,14 @@ bool ParamTraits<storage::DataElement>::Read(const base::Pickle* m,
if (!iter->ReadData(&data, &len))
return false;
r->SetToBytes(data, len);
- break;
+ return true;
}
case storage::DataElement::TYPE_BYTES_DESCRIPTION: {
uint64_t length;
if (!ReadParam(m, iter, &length))
return false;
r->SetToBytesDescription(length);
- break;
+ return true;
}
case storage::DataElement::TYPE_FILE: {
base::FilePath file_path;
@@ -168,7 +168,7 @@ bool ParamTraits<storage::DataElement>::Read(const base::Pickle* m,
return false;
r->SetToFilePathRange(file_path, offset, length,
expected_modification_time);
- break;
+ return true;
}
case storage::DataElement::TYPE_FILE_FILESYSTEM: {
GURL file_system_url;
@@ -184,7 +184,7 @@ bool ParamTraits<storage::DataElement>::Read(const base::Pickle* m,
return false;
r->SetToFileSystemUrlRange(file_system_url, offset, length,
expected_modification_time);
- break;
+ return true;
}
case storage::DataElement::TYPE_BLOB: {
std::string blob_uuid;
@@ -196,18 +196,18 @@ bool ParamTraits<storage::DataElement>::Read(const base::Pickle* m,
if (!ReadParam(m, iter, &length))
return false;
r->SetToBlobRange(blob_uuid, offset, length);
- break;
+ return true;
}
case storage::DataElement::TYPE_DISK_CACHE_ENTRY: {
NOTREACHED() << "Can't be sent by IPC.";
- break;
+ return false;
}
case storage::DataElement::TYPE_UNKNOWN: {
NOTREACHED();
- break;
+ return false;
}
}
- return true;
+ return false;
}
void ParamTraits<storage::DataElement>::Log(const param_type& p,
« no previous file with comments | « content/browser/blob_storage/blob_dispatcher_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698