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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 void ParamTraits<double>::Log(const param_type& p, std::string* l) { | 333 void ParamTraits<double>::Log(const param_type& p, std::string* l) { |
334 l->append(base::StringPrintf("%e", p)); | 334 l->append(base::StringPrintf("%e", p)); |
335 } | 335 } |
336 | 336 |
337 | 337 |
338 void ParamTraits<std::string>::Log(const param_type& p, std::string* l) { | 338 void ParamTraits<std::string>::Log(const param_type& p, std::string* l) { |
339 l->append(p); | 339 l->append(p); |
340 } | 340 } |
341 | 341 |
342 void ParamTraits<std::wstring>::Log(const param_type& p, std::string* l) { | 342 void ParamTraits<std::wstring>::Log(const param_type& p, std::string* l) { |
343 l->append(WideToUTF8(p)); | 343 l->append(base::WideToUTF8(p)); |
344 } | 344 } |
345 | 345 |
346 #if !defined(WCHAR_T_IS_UTF16) | 346 #if !defined(WCHAR_T_IS_UTF16) |
347 void ParamTraits<base::string16>::Log(const param_type& p, std::string* l) { | 347 void ParamTraits<base::string16>::Log(const param_type& p, std::string* l) { |
348 l->append(UTF16ToUTF8(p)); | 348 l->append(base::UTF16ToUTF8(p)); |
349 } | 349 } |
350 #endif | 350 #endif |
351 | 351 |
352 void ParamTraits<std::vector<char> >::Write(Message* m, const param_type& p) { | 352 void ParamTraits<std::vector<char> >::Write(Message* m, const param_type& p) { |
353 if (p.empty()) { | 353 if (p.empty()) { |
354 m->WriteData(NULL, 0); | 354 m->WriteData(NULL, 0); |
355 } else { | 355 } else { |
356 m->WriteData(&p.front(), static_cast<int>(p.size())); | 356 m->WriteData(&p.front(), static_cast<int>(p.size())); |
357 } | 357 } |
358 } | 358 } |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 return result; | 823 return result; |
824 } | 824 } |
825 | 825 |
826 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 826 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
827 l->append("<MSG>"); | 827 l->append("<MSG>"); |
828 } | 828 } |
829 | 829 |
830 #endif // OS_WIN | 830 #endif // OS_WIN |
831 | 831 |
832 } // namespace IPC | 832 } // namespace IPC |
OLD | NEW |