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 |
11 namespace IPC { | 11 namespace IPC { |
12 | 12 |
13 void ParamTraits<SerializedScriptValue>::Write(Message* m, | 13 void ParamTraits<SerializedScriptValue>::Write(Message* m, |
14 const param_type& p) { | 14 const param_type& p) { |
15 WriteParam(m, p.is_null()); | 15 WriteParam(m, p.is_null()); |
16 WriteParam(m, p.is_invalid()); | 16 WriteParam(m, p.is_invalid()); |
17 WriteParam(m, p.data()); | 17 WriteParam(m, p.data()); |
18 } | 18 } |
19 | 19 |
20 bool ParamTraits<SerializedScriptValue>::Read(const Message* m, | 20 bool ParamTraits<SerializedScriptValue>::Read(const Message* m, |
21 void** iter, | 21 void** iter, |
22 param_type* r) { | 22 param_type* r) { |
23 bool is_null; | 23 bool is_null = false; // clang pr9122 |
24 bool is_invalid; | 24 bool is_invalid = false; // clang pr9122 |
25 string16 data; | 25 string16 data; |
26 bool ok = | 26 bool ok = |
27 ReadParam(m, iter, &is_null) && | 27 ReadParam(m, iter, &is_null) && |
28 ReadParam(m, iter, &is_invalid) && | 28 ReadParam(m, iter, &is_invalid) && |
29 ReadParam(m, iter, &data); | 29 ReadParam(m, iter, &data); |
30 if (!ok) | 30 if (!ok) |
31 return false; | 31 return false; |
32 r->set_is_null(is_null); | 32 r->set_is_null(is_null); |
33 r->set_is_invalid(is_invalid); | 33 r->set_is_invalid(is_invalid); |
34 r->set_data(data); | 34 r->set_data(data); |
(...skipping 17 matching lines...) Expand all Loading... |
52 WriteParam(m, p.string()); | 52 WriteParam(m, p.string()); |
53 WriteParam(m, p.date()); | 53 WriteParam(m, p.date()); |
54 WriteParam(m, p.number()); | 54 WriteParam(m, p.number()); |
55 } | 55 } |
56 | 56 |
57 bool ParamTraits<IndexedDBKey>::Read(const Message* m, | 57 bool ParamTraits<IndexedDBKey>::Read(const Message* m, |
58 void** iter, | 58 void** iter, |
59 param_type* r) { | 59 param_type* r) { |
60 int type; | 60 int type; |
61 string16 string; | 61 string16 string; |
62 double date; | 62 double date = 0; // clang pr9122 |
63 double number; | 63 double number = 0; // clang pr9122 |
64 bool ok = | 64 bool ok = |
65 ReadParam(m, iter, &type) && | 65 ReadParam(m, iter, &type) && |
66 ReadParam(m, iter, &string) && | 66 ReadParam(m, iter, &string) && |
67 ReadParam(m, iter, &date) && | 67 ReadParam(m, iter, &date) && |
68 ReadParam(m, iter, &number); | 68 ReadParam(m, iter, &number); |
69 | 69 |
70 if (!ok) | 70 if (!ok) |
71 return false; | 71 return false; |
72 switch (type) { | 72 switch (type) { |
73 case WebKit::WebIDBKey::NullType: | 73 case WebKit::WebIDBKey::NullType: |
(...skipping 22 matching lines...) Expand all Loading... |
96 l->append(", "); | 96 l->append(", "); |
97 LogParam(p.string(), l); | 97 LogParam(p.string(), l); |
98 l->append(", "); | 98 l->append(", "); |
99 LogParam(p.date(), l); | 99 LogParam(p.date(), l); |
100 l->append(", "); | 100 l->append(", "); |
101 LogParam(p.number(), l); | 101 LogParam(p.number(), l); |
102 l->append(")"); | 102 l->append(")"); |
103 } | 103 } |
104 | 104 |
105 } // namespace IPC | 105 } // namespace IPC |
OLD | NEW |