| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/indexed_db/indexed_db_param_traits.h" | 5 #include "content/common/indexed_db/indexed_db_param_traits.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 #include "content/common/indexed_db/indexed_db_key.h" | 9 #include "content/common/indexed_db/indexed_db_key.h" |
| 10 #include "content/common/indexed_db/indexed_db_key_path.h" | 10 #include "content/common/indexed_db/indexed_db_key_path.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 case WebIDBKeyTypeNull: | 52 case WebIDBKeyTypeNull: |
| 53 return; | 53 return; |
| 54 case WebIDBKeyTypeMin: | 54 case WebIDBKeyTypeMin: |
| 55 default: | 55 default: |
| 56 NOTREACHED(); | 56 NOTREACHED(); |
| 57 return; | 57 return; |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool ParamTraits<IndexedDBKey>::Read(const Message* m, | 61 bool ParamTraits<IndexedDBKey>::Read(const Message* m, |
| 62 PickleIterator* iter, | 62 base::PickleIterator* iter, |
| 63 param_type* r) { | 63 param_type* r) { |
| 64 int type; | 64 int type; |
| 65 if (!ReadParam(m, iter, &type)) | 65 if (!ReadParam(m, iter, &type)) |
| 66 return false; | 66 return false; |
| 67 WebIDBKeyType web_type = static_cast<WebIDBKeyType>(type); | 67 WebIDBKeyType web_type = static_cast<WebIDBKeyType>(type); |
| 68 | 68 |
| 69 switch (web_type) { | 69 switch (web_type) { |
| 70 case WebIDBKeyTypeArray: { | 70 case WebIDBKeyTypeArray: { |
| 71 std::vector<IndexedDBKey> array; | 71 std::vector<IndexedDBKey> array; |
| 72 if (!ReadParam(m, iter, &array)) | 72 if (!ReadParam(m, iter, &array)) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 return; | 164 return; |
| 165 case WebIDBKeyPathTypeNull: | 165 case WebIDBKeyPathTypeNull: |
| 166 return; | 166 return; |
| 167 default: | 167 default: |
| 168 NOTREACHED(); | 168 NOTREACHED(); |
| 169 return; | 169 return; |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| 173 bool ParamTraits<IndexedDBKeyPath>::Read(const Message* m, | 173 bool ParamTraits<IndexedDBKeyPath>::Read(const Message* m, |
| 174 PickleIterator* iter, | 174 base::PickleIterator* iter, |
| 175 param_type* r) { | 175 param_type* r) { |
| 176 int type; | 176 int type; |
| 177 if (!ReadParam(m, iter, &type)) | 177 if (!ReadParam(m, iter, &type)) |
| 178 return false; | 178 return false; |
| 179 | 179 |
| 180 switch (type) { | 180 switch (type) { |
| 181 case WebIDBKeyPathTypeArray: { | 181 case WebIDBKeyPathTypeArray: { |
| 182 std::vector<base::string16> array; | 182 std::vector<base::string16> array; |
| 183 if (!ReadParam(m, iter, &array)) | 183 if (!ReadParam(m, iter, &array)) |
| 184 return false; | 184 return false; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 | 232 |
| 233 void ParamTraits<IndexedDBKeyRange>::Write(Message* m, const param_type& p) { | 233 void ParamTraits<IndexedDBKeyRange>::Write(Message* m, const param_type& p) { |
| 234 WriteParam(m, p.lower()); | 234 WriteParam(m, p.lower()); |
| 235 WriteParam(m, p.upper()); | 235 WriteParam(m, p.upper()); |
| 236 WriteParam(m, p.lower_open()); | 236 WriteParam(m, p.lower_open()); |
| 237 WriteParam(m, p.upper_open()); | 237 WriteParam(m, p.upper_open()); |
| 238 } | 238 } |
| 239 | 239 |
| 240 bool ParamTraits<IndexedDBKeyRange>::Read(const Message* m, | 240 bool ParamTraits<IndexedDBKeyRange>::Read(const Message* m, |
| 241 PickleIterator* iter, | 241 base::PickleIterator* iter, |
| 242 param_type* r) { | 242 param_type* r) { |
| 243 IndexedDBKey lower; | 243 IndexedDBKey lower; |
| 244 if (!ReadParam(m, iter, &lower)) | 244 if (!ReadParam(m, iter, &lower)) |
| 245 return false; | 245 return false; |
| 246 | 246 |
| 247 IndexedDBKey upper; | 247 IndexedDBKey upper; |
| 248 if (!ReadParam(m, iter, &upper)) | 248 if (!ReadParam(m, iter, &upper)) |
| 249 return false; | 249 return false; |
| 250 | 250 |
| 251 bool lower_open; | 251 bool lower_open; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 266 l->append(", upper="); | 266 l->append(", upper="); |
| 267 LogParam(p.upper(), l); | 267 LogParam(p.upper(), l); |
| 268 l->append(", lower_open="); | 268 l->append(", lower_open="); |
| 269 LogParam(p.lower_open(), l); | 269 LogParam(p.lower_open(), l); |
| 270 l->append(", upper_open="); | 270 l->append(", upper_open="); |
| 271 LogParam(p.upper_open(), l); | 271 LogParam(p.upper_open(), l); |
| 272 l->append(")"); | 272 l->append(")"); |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace IPC | 275 } // namespace IPC |
| OLD | NEW |