| 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/files/file_path.h" | 7 #include "base/files/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/strings/nullable_string16.h" | 10 #include "base/strings/nullable_string16.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 336 |
| 337 void ParamTraits<double>::Log(const param_type& p, std::string* l) { | 337 void ParamTraits<double>::Log(const param_type& p, std::string* l) { |
| 338 l->append(base::StringPrintf("%e", p)); | 338 l->append(base::StringPrintf("%e", p)); |
| 339 } | 339 } |
| 340 | 340 |
| 341 | 341 |
| 342 void ParamTraits<std::string>::Log(const param_type& p, std::string* l) { | 342 void ParamTraits<std::string>::Log(const param_type& p, std::string* l) { |
| 343 l->append(p); | 343 l->append(p); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void ParamTraits<std::wstring>::Log(const param_type& p, std::string* l) { | |
| 347 l->append(base::WideToUTF8(p)); | |
| 348 } | |
| 349 | |
| 350 #if !defined(WCHAR_T_IS_UTF16) | |
| 351 void ParamTraits<base::string16>::Log(const param_type& p, std::string* l) { | 346 void ParamTraits<base::string16>::Log(const param_type& p, std::string* l) { |
| 352 l->append(base::UTF16ToUTF8(p)); | 347 l->append(base::UTF16ToUTF8(p)); |
| 353 } | 348 } |
| 354 #endif | |
| 355 | 349 |
| 356 void ParamTraits<std::vector<char> >::Write(Message* m, const param_type& p) { | 350 void ParamTraits<std::vector<char> >::Write(Message* m, const param_type& p) { |
| 357 if (p.empty()) { | 351 if (p.empty()) { |
| 358 m->WriteData(NULL, 0); | 352 m->WriteData(NULL, 0); |
| 359 } else { | 353 } else { |
| 360 m->WriteData(&p.front(), static_cast<int>(p.size())); | 354 m->WriteData(&p.front(), static_cast<int>(p.size())); |
| 361 } | 355 } |
| 362 } | 356 } |
| 363 | 357 |
| 364 bool ParamTraits<std::vector<char> >::Read(const Message* m, | 358 bool ParamTraits<std::vector<char> >::Read(const Message* m, |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 return result; | 829 return result; |
| 836 } | 830 } |
| 837 | 831 |
| 838 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 832 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
| 839 l->append("<MSG>"); | 833 l->append("<MSG>"); |
| 840 } | 834 } |
| 841 | 835 |
| 842 #endif // OS_WIN | 836 #endif // OS_WIN |
| 843 | 837 |
| 844 } // namespace IPC | 838 } // namespace IPC |
| OLD | NEW |