OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/indexed_db_param_traits.h" | 5 #include "chrome/common/indexed_db_param_traits.h" |
6 | 6 |
7 #include "chrome/common/indexed_db_key.h" | 7 #include "chrome/common/indexed_db_key.h" |
8 #include "chrome/common/serialized_script_value.h" | 8 #include "chrome/common/serialized_script_value.h" |
9 #include "ipc/ipc_message_utils.h" | 9 #include "ipc/ipc_message_utils.h" |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // TODO(jorlow): Technically, we only need to pack the type being used. | 51 // TODO(jorlow): Technically, we only need to pack the type being used. |
52 WriteParam(m, p.string()); | 52 WriteParam(m, p.string()); |
53 WriteParam(m, p.number()); | 53 WriteParam(m, p.number()); |
54 } | 54 } |
55 | 55 |
56 bool ParamTraits<IndexedDBKey>::Read(const Message* m, | 56 bool ParamTraits<IndexedDBKey>::Read(const Message* m, |
57 void** iter, | 57 void** iter, |
58 param_type* r) { | 58 param_type* r) { |
59 int type; | 59 int type; |
60 string16 string; | 60 string16 string; |
61 int32 number; | 61 double number; |
62 bool ok = | 62 bool ok = |
63 ReadParam(m, iter, &type) && | 63 ReadParam(m, iter, &type) && |
64 ReadParam(m, iter, &string) && | 64 ReadParam(m, iter, &string) && |
65 ReadParam(m, iter, &number); | 65 ReadParam(m, iter, &number); |
66 if (!ok) | 66 if (!ok) |
67 return false; | 67 return false; |
68 switch (type) { | 68 switch (type) { |
69 case WebKit::WebIDBKey::NullType: | 69 case WebKit::WebIDBKey::NullType: |
70 r->SetNull(); | 70 r->SetNull(); |
71 return true; | 71 return true; |
(...skipping 15 matching lines...) Expand all Loading... |
87 l->append("<IndexedDBKey>("); | 87 l->append("<IndexedDBKey>("); |
88 LogParam(int(p.type()), l); | 88 LogParam(int(p.type()), l); |
89 l->append(", "); | 89 l->append(", "); |
90 LogParam(p.string(), l); | 90 LogParam(p.string(), l); |
91 l->append(", "); | 91 l->append(", "); |
92 LogParam(p.number(), l); | 92 LogParam(p.number(), l); |
93 l->append(")"); | 93 l->append(")"); |
94 } | 94 } |
95 | 95 |
96 } // namespace IPC | 96 } // namespace IPC |
OLD | NEW |