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

Unified Diff: content/common/resource_messages.cc

Issue 1108083002: Create blobs from Disk Cache entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: omg, fix the correct base::Unretained... Created 5 years, 6 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
Index: content/common/resource_messages.cc
diff --git a/content/common/resource_messages.cc b/content/common/resource_messages.cc
index 2f86ae2ecd750dd7e144a5a9ebd8ed55e986c748..9cadbfffd7f2cec29e134f80a85c27d49d851b96 100644
--- a/content/common/resource_messages.cc
+++ b/content/common/resource_messages.cc
@@ -56,13 +56,20 @@ void ParamTraits<storage::DataElement>::Write(Message* m, const param_type& p) {
WriteParam(m, p.expected_modification_time());
break;
}
- default: {
- DCHECK(p.type() == storage::DataElement::TYPE_BLOB);
+ case storage::DataElement::TYPE_BLOB: {
WriteParam(m, p.blob_uuid());
WriteParam(m, p.offset());
WriteParam(m, p.length());
break;
}
+ case storage::DataElement::TYPE_DISK_CACHE_ENTRY: {
+ NOTREACHED() << "Can't be sent by IPC.";
+ break;
+ }
+ case storage::DataElement::TYPE_UNKNOWN: {
+ NOTREACHED();
+ break;
+ }
}
}
@@ -113,8 +120,7 @@ bool ParamTraits<storage::DataElement>::Read(const Message* m,
expected_modification_time);
break;
}
- default: {
- DCHECK(type == storage::DataElement::TYPE_BLOB);
+ case storage::DataElement::TYPE_BLOB: {
std::string blob_uuid;
uint64 offset, length;
if (!ReadParam(m, iter, &blob_uuid))
@@ -126,6 +132,14 @@ bool ParamTraits<storage::DataElement>::Read(const Message* m,
r->SetToBlobRange(blob_uuid, offset, length);
break;
}
+ case storage::DataElement::TYPE_DISK_CACHE_ENTRY: {
+ NOTREACHED() << "Can't be sent by IPC.";
+ break;
+ }
+ case storage::DataElement::TYPE_UNKNOWN: {
+ NOTREACHED();
+ break;
+ }
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698