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 "ipc/ipc_message_utils.h" | 5 #include "ipc/ipc_message_utils.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/nullable_string16.h" | 10 #include "base/nullable_string16.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return false; | 171 return false; |
172 | 172 |
173 switch (type) { | 173 switch (type) { |
174 case Value::TYPE_NULL: | 174 case Value::TYPE_NULL: |
175 *value = Value::CreateNullValue(); | 175 *value = Value::CreateNullValue(); |
176 break; | 176 break; |
177 case Value::TYPE_BOOLEAN: { | 177 case Value::TYPE_BOOLEAN: { |
178 bool val; | 178 bool val; |
179 if (!ReadParam(m, iter, &val)) | 179 if (!ReadParam(m, iter, &val)) |
180 return false; | 180 return false; |
181 *value = Value::CreateBooleanValue(val); | 181 *value = new base::FundamentalValue(val); |
182 break; | 182 break; |
183 } | 183 } |
184 case Value::TYPE_INTEGER: { | 184 case Value::TYPE_INTEGER: { |
185 int val; | 185 int val; |
186 if (!ReadParam(m, iter, &val)) | 186 if (!ReadParam(m, iter, &val)) |
187 return false; | 187 return false; |
188 *value = Value::CreateIntegerValue(val); | 188 *value = new base::FundamentalValue(val); |
189 break; | 189 break; |
190 } | 190 } |
191 case Value::TYPE_DOUBLE: { | 191 case Value::TYPE_DOUBLE: { |
192 double val; | 192 double val; |
193 if (!ReadParam(m, iter, &val)) | 193 if (!ReadParam(m, iter, &val)) |
194 return false; | 194 return false; |
195 *value = Value::CreateDoubleValue(val); | 195 *value = new base::FundamentalValue(val); |
196 break; | 196 break; |
197 } | 197 } |
198 case Value::TYPE_STRING: { | 198 case Value::TYPE_STRING: { |
199 std::string val; | 199 std::string val; |
200 if (!ReadParam(m, iter, &val)) | 200 if (!ReadParam(m, iter, &val)) |
201 return false; | 201 return false; |
202 *value = Value::CreateStringValue(val); | 202 *value = new base::StringValue(val); |
203 break; | 203 break; |
204 } | 204 } |
205 case Value::TYPE_BINARY: { | 205 case Value::TYPE_BINARY: { |
206 const char* data; | 206 const char* data; |
207 int length; | 207 int length; |
208 if (!m->ReadData(iter, &data, &length)) | 208 if (!m->ReadData(iter, &data, &length)) |
209 return false; | 209 return false; |
210 *value = base::BinaryValue::CreateWithCopiedBuffer(data, length); | 210 *value = base::BinaryValue::CreateWithCopiedBuffer(data, length); |
211 break; | 211 break; |
212 } | 212 } |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 return result; | 821 return result; |
822 } | 822 } |
823 | 823 |
824 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 824 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
825 l->append("<MSG>"); | 825 l->append("<MSG>"); |
826 } | 826 } |
827 | 827 |
828 #endif // OS_WIN | 828 #endif // OS_WIN |
829 | 829 |
830 } // namespace IPC | 830 } // namespace IPC |
OLD | NEW |