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 "content/common/indexed_db/indexed_db_key.h" | 7 #include "content/common/indexed_db/indexed_db_key.h" |
8 #include "content/common/indexed_db/indexed_db_key_path.h" | 8 #include "content/common/indexed_db/indexed_db_key_path.h" |
9 #include "content/common/indexed_db/indexed_db_key_range.h" | 9 #include "content/common/indexed_db/indexed_db_key_range.h" |
10 #include "ipc/ipc_message_utils.h" | 10 #include "ipc/ipc_message_utils.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 return; | 29 return; |
30 case WebIDBKey::DateType: | 30 case WebIDBKey::DateType: |
31 WriteParam(m, p.date()); | 31 WriteParam(m, p.date()); |
32 return; | 32 return; |
33 case WebIDBKey::NumberType: | 33 case WebIDBKey::NumberType: |
34 WriteParam(m, p.number()); | 34 WriteParam(m, p.number()); |
35 return; | 35 return; |
36 case WebIDBKey::InvalidType: | 36 case WebIDBKey::InvalidType: |
37 case WebIDBKey::NullType: | 37 case WebIDBKey::NullType: |
38 return; | 38 return; |
39 default: | 39 case WebIDBKey::MinType: |
40 // This is a placeholder for WebKit::WebIDBKey::MinType | |
41 NOTREACHED(); | 40 NOTREACHED(); |
42 return; | 41 return; |
43 } | 42 } |
44 } | 43 } |
45 | 44 |
46 bool ParamTraits<IndexedDBKey>::Read(const Message* m, | 45 bool ParamTraits<IndexedDBKey>::Read(const Message* m, |
47 PickleIterator* iter, | 46 PickleIterator* iter, |
48 param_type* r) { | 47 param_type* r) { |
49 int type; | 48 int type; |
50 if (!ReadParam(m, iter, &type)) | 49 if (!ReadParam(m, iter, &type)) |
(...skipping 20 matching lines...) Expand all Loading... |
71 double number; | 70 double number; |
72 if (!ReadParam(m, iter, &number)) | 71 if (!ReadParam(m, iter, &number)) |
73 return false; | 72 return false; |
74 *r = IndexedDBKey(number, web_type); | 73 *r = IndexedDBKey(number, web_type); |
75 return true; | 74 return true; |
76 } | 75 } |
77 case WebIDBKey::InvalidType: | 76 case WebIDBKey::InvalidType: |
78 case WebIDBKey::NullType: | 77 case WebIDBKey::NullType: |
79 *r = IndexedDBKey(web_type); | 78 *r = IndexedDBKey(web_type); |
80 return true; | 79 return true; |
81 default: | 80 case WebIDBKey::MinType: |
82 // This is a placeholder for WebKit::WebIDBKey::MinType | |
83 NOTREACHED(); | 81 NOTREACHED(); |
84 return false; | 82 return false; |
85 } | 83 } |
86 } | 84 } |
87 | 85 |
88 void ParamTraits<IndexedDBKey>::Log(const param_type& p, std::string* l) { | 86 void ParamTraits<IndexedDBKey>::Log(const param_type& p, std::string* l) { |
89 l->append("<IndexedDBKey>("); | 87 l->append("<IndexedDBKey>("); |
90 LogParam(int(p.type()), l); | 88 LogParam(int(p.type()), l); |
91 l->append(", "); | 89 l->append(", "); |
92 l->append("["); | 90 l->append("["); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 l->append(", upper="); | 202 l->append(", upper="); |
205 LogParam(p.upper(), l); | 203 LogParam(p.upper(), l); |
206 l->append(", lower_open="); | 204 l->append(", lower_open="); |
207 LogParam(p.lowerOpen(), l); | 205 LogParam(p.lowerOpen(), l); |
208 l->append(", upper_open="); | 206 l->append(", upper_open="); |
209 LogParam(p.upperOpen(), l); | 207 LogParam(p.upperOpen(), l); |
210 l->append(")"); | 208 l->append(")"); |
211 } | 209 } |
212 | 210 |
213 } // namespace IPC | 211 } // namespace IPC |
OLD | NEW |