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

Unified Diff: content/common/indexed_db/indexed_db_param_traits.cc

Issue 202863004: Fix "unreachable code" warnings (MSVC warning 4702) in content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 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/indexed_db/indexed_db_param_traits.cc
===================================================================
--- content/common/indexed_db/indexed_db_param_traits.cc (revision 257734)
+++ content/common/indexed_db/indexed_db_param_traits.cc (working copy)
@@ -36,21 +36,28 @@
case WebIDBKeyTypeArray:
WriteParam(m, p.array());
return;
+
jam 2014/03/19 16:44:36 ditto
Peter Kasting 2014/03/19 21:10:57 Done.
case WebIDBKeyTypeBinary:
WriteParam(m, p.binary());
return;
+
case WebIDBKeyTypeString:
WriteParam(m, p.string());
return;
+
+
case WebIDBKeyTypeDate:
WriteParam(m, p.date());
return;
+
case WebIDBKeyTypeNumber:
WriteParam(m, p.number());
return;
+
case WebIDBKeyTypeInvalid:
case WebIDBKeyTypeNull:
return;
+
case WebIDBKeyTypeMin:
default:
NOTREACHED();
@@ -65,7 +72,6 @@
if (!ReadParam(m, iter, &type))
return false;
WebIDBKeyType web_type = static_cast<WebIDBKeyType>(type);
-
switch (web_type) {
case WebIDBKeyTypeArray: {
std::vector<IndexedDBKey> array;
@@ -74,6 +80,7 @@
*r = IndexedDBKey(array);
return true;
}
+
case WebIDBKeyTypeBinary: {
std::string binary;
if (!ReadParam(m, iter, &binary))
@@ -81,6 +88,7 @@
*r = IndexedDBKey(binary);
return true;
}
+
case WebIDBKeyTypeString: {
base::string16 string;
if (!ReadParam(m, iter, &string))
@@ -88,6 +96,7 @@
*r = IndexedDBKey(string);
return true;
}
+
case WebIDBKeyTypeDate:
case WebIDBKeyTypeNumber: {
double number;
@@ -96,17 +105,17 @@
*r = IndexedDBKey(number, web_type);
return true;
}
+
case WebIDBKeyTypeInvalid:
case WebIDBKeyTypeNull:
*r = IndexedDBKey(web_type);
return true;
+
case WebIDBKeyTypeMin:
default:
NOTREACHED();
return false;
}
- NOTREACHED();
- return false;
}
void ParamTraits<IndexedDBKey>::Log(const param_type& p, std::string* l) {
@@ -138,13 +147,18 @@
case WebIDBKeyPathTypeArray:
WriteParam(m, p.array());
return;
+
case WebIDBKeyPathTypeString:
WriteParam(m, p.string());
return;
+
case WebIDBKeyPathTypeNull:
return;
+
+ default:
+ NOTREACHED();
+ return;
}
- NOTREACHED();
}
bool ParamTraits<IndexedDBKeyPath>::Read(const Message* m,
@@ -153,7 +167,6 @@
int type;
if (!ReadParam(m, iter, &type))
return false;
-
switch (type) {
case WebIDBKeyPathTypeArray: {
std::vector<base::string16> array;
@@ -162,6 +175,7 @@
*r = IndexedDBKeyPath(array);
return true;
}
+
case WebIDBKeyPathTypeString: {
base::string16 string;
if (!ReadParam(m, iter, &string))
@@ -169,12 +183,15 @@
*r = IndexedDBKeyPath(string);
return true;
}
+
case WebIDBKeyPathTypeNull:
*r = IndexedDBKeyPath();
return true;
+
+ default:
+ NOTREACHED();
+ return false;
}
- NOTREACHED();
- return false;
}
void ParamTraits<IndexedDBKeyPath>::Log(const param_type& p, std::string* l) {

Powered by Google App Engine
This is Rietveld 408576698