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

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

Issue 10272018: Move IndexedDBKey, IndexedDBKeyRange into content namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use "using content::*" aliasing for IDB/SSV types Created 8 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
Index: content/common/indexed_db/indexed_db_param_traits.cc
diff --git a/content/common/indexed_db/indexed_db_param_traits.cc b/content/common/indexed_db/indexed_db_param_traits.cc
index 101cd8221b0608876dc7162e368bab1eeb3a5d65..65107ea1891a8ce58074523fdfe74d73d3f8f2ce 100644
--- a/content/common/indexed_db/indexed_db_param_traits.cc
+++ b/content/common/indexed_db/indexed_db_param_traits.cc
@@ -10,18 +10,23 @@
#include "content/public/common/serialized_script_value.h"
#include "ipc/ipc_message_utils.h"
+using content::IndexedDBKey;
+using content::IndexedDBKeyPath;
+using content::IndexedDBKeyRange;
+using content::SerializedScriptValue;
+
namespace IPC {
-void ParamTraits<content::SerializedScriptValue>::Write(Message* m,
- const param_type& p) {
+void ParamTraits<SerializedScriptValue>::Write(Message* m,
+ const param_type& p) {
WriteParam(m, p.is_null());
WriteParam(m, p.is_invalid());
WriteParam(m, p.data());
}
-bool ParamTraits<content::SerializedScriptValue>::Read(const Message* m,
- PickleIterator* iter,
- param_type* r) {
+bool ParamTraits<SerializedScriptValue>::Read(const Message* m,
+ PickleIterator* iter,
+ param_type* r) {
bool is_null;
bool is_invalid;
string16 data;
@@ -37,8 +42,8 @@ bool ParamTraits<content::SerializedScriptValue>::Read(const Message* m,
return true;
}
-void ParamTraits<content::SerializedScriptValue>::Log(const param_type& p,
- std::string* l) {
+void ParamTraits<SerializedScriptValue>::Log(const param_type& p,
+ std::string* l) {
l->append("<SerializedScriptValue>(");
LogParam(p.is_null(), l);
l->append(", ");
@@ -48,7 +53,8 @@ void ParamTraits<content::SerializedScriptValue>::Log(const param_type& p,
l->append(")");
}
-void ParamTraits<IndexedDBKey>::Write(Message* m, const param_type& p) {
+void ParamTraits<IndexedDBKey>::Write(Message* m,
+ const param_type& p) {
WriteParam(m, int(p.type()));
switch (p.type()) {
case WebKit::WebIDBKey::ArrayType:
@@ -78,38 +84,34 @@ bool ParamTraits<IndexedDBKey>::Read(const Message* m,
return false;
switch (type) {
- case WebKit::WebIDBKey::ArrayType:
- {
- std::vector<IndexedDBKey> array;
- if (!ReadParam(m, iter, &array))
- return false;
- r->SetArray(array);
- return true;
- }
- case WebKit::WebIDBKey::StringType:
- {
- string16 string;
- if (!ReadParam(m, iter, &string))
- return false;
- r->SetString(string);
- return true;
- }
- case WebKit::WebIDBKey::DateType:
- {
- double date;
- if (!ReadParam(m, iter, &date))
- return false;
- r->SetDate(date);
- return true;
- }
- case WebKit::WebIDBKey::NumberType:
- {
- double number;
- if (!ReadParam(m, iter, &number))
- return false;
- r->SetNumber(number);
- return true;
- }
+ case WebKit::WebIDBKey::ArrayType: {
+ std::vector<IndexedDBKey> array;
+ if (!ReadParam(m, iter, &array))
+ return false;
+ r->SetArray(array);
+ return true;
+ }
+ case WebKit::WebIDBKey::StringType: {
+ string16 string;
+ if (!ReadParam(m, iter, &string))
+ return false;
+ r->SetString(string);
+ return true;
+ }
+ case WebKit::WebIDBKey::DateType: {
+ double date;
+ if (!ReadParam(m, iter, &date))
+ return false;
+ r->SetDate(date);
+ return true;
+ }
+ case WebKit::WebIDBKey::NumberType: {
+ double number;
+ if (!ReadParam(m, iter, &number))
+ return false;
+ r->SetNumber(number);
+ return true;
+ }
case WebKit::WebIDBKey::InvalidType:
r->SetInvalid();
return true;
@@ -121,7 +123,8 @@ bool ParamTraits<IndexedDBKey>::Read(const Message* m,
return false;
}
-void ParamTraits<IndexedDBKey>::Log(const param_type& p, std::string* l) {
+void ParamTraits<IndexedDBKey>::Log(const param_type& p,
+ std::string* l) {
l->append("<IndexedDBKey>(");
LogParam(int(p.type()), l);
l->append(", ");
@@ -142,8 +145,8 @@ void ParamTraits<IndexedDBKey>::Log(const param_type& p, std::string* l) {
l->append(")");
}
-void ParamTraits<content::IndexedDBKeyPath>::Write(Message* m,
- const param_type& p) {
+void ParamTraits<IndexedDBKeyPath>::Write(Message* m,
+ const param_type& p) {
WriteParam(m, int(p.type()));
switch (p.type()) {
case WebKit::WebIDBKeyPath::ArrayType:
@@ -158,9 +161,9 @@ void ParamTraits<content::IndexedDBKeyPath>::Write(Message* m,
NOTREACHED();
}
-bool ParamTraits<content::IndexedDBKeyPath>::Read(const Message* m,
- PickleIterator* iter,
- param_type* r) {
+bool ParamTraits<IndexedDBKeyPath>::Read(const Message* m,
+ PickleIterator* iter,
+ param_type* r) {
int type;
if (!ReadParam(m, iter, &type))
return false;
@@ -188,8 +191,8 @@ bool ParamTraits<content::IndexedDBKeyPath>::Read(const Message* m,
return false;
}
-void ParamTraits<content::IndexedDBKeyPath>::Log(const param_type& p,
- std::string* l) {
+void ParamTraits<IndexedDBKeyPath>::Log(const param_type& p,
+ std::string* l) {
l->append("<IndexedDBKeyPath>(");
LogParam(int(p.type()), l);
l->append(", ");
@@ -206,7 +209,8 @@ void ParamTraits<content::IndexedDBKeyPath>::Log(const param_type& p,
l->append("])");
}
-void ParamTraits<IndexedDBKeyRange>::Write(Message* m, const param_type& p) {
+void ParamTraits<IndexedDBKeyRange>::Write(Message* m,
+ const param_type& p) {
WriteParam(m, p.lower());
WriteParam(m, p.upper());
WriteParam(m, p.lowerOpen());
@@ -216,7 +220,6 @@ void ParamTraits<IndexedDBKeyRange>::Write(Message* m, const param_type& p) {
bool ParamTraits<IndexedDBKeyRange>::Read(const Message* m,
PickleIterator* iter,
param_type* r) {
-
IndexedDBKey lower;
if (!ReadParam(m, iter, &lower))
return false;
@@ -237,7 +240,8 @@ bool ParamTraits<IndexedDBKeyRange>::Read(const Message* m,
return true;
}
-void ParamTraits<IndexedDBKeyRange>::Log(const param_type& p, std::string* l) {
+void ParamTraits<IndexedDBKeyRange>::Log(const param_type& p,
+ std::string* l) {
l->append("<IndexedDBKeyRange>(lower=");
LogParam(p.lower(), l);
l->append(", upper=");
« no previous file with comments | « content/common/indexed_db/indexed_db_param_traits.h ('k') | content/common/indexed_db/proxy_webidbcursor_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698