| 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/nullable_string16.h" | 10 #include "base/nullable_string16.h" |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 bool ParamTraits<LOGFONT>::Read(const Message* m, PickleIterator* iter, | 782 bool ParamTraits<LOGFONT>::Read(const Message* m, PickleIterator* iter, |
| 783 param_type* r) { | 783 param_type* r) { |
| 784 const char *data; | 784 const char *data; |
| 785 int data_size = 0; | 785 int data_size = 0; |
| 786 if (m->ReadData(iter, &data, &data_size) && data_size == sizeof(LOGFONT)) { | 786 if (m->ReadData(iter, &data, &data_size) && data_size == sizeof(LOGFONT)) { |
| 787 const LOGFONT *font = reinterpret_cast<LOGFONT*>(const_cast<char*>(data)); | 787 const LOGFONT *font = reinterpret_cast<LOGFONT*>(const_cast<char*>(data)); |
| 788 if (_tcsnlen(font->lfFaceName, LF_FACESIZE) < LF_FACESIZE) { | 788 if (_tcsnlen(font->lfFaceName, LF_FACESIZE) < LF_FACESIZE) { |
| 789 memcpy(r, data, sizeof(LOGFONT)); | 789 memcpy(r, data, sizeof(LOGFONT)); |
| 790 return true; | 790 return true; |
| 791 } | 791 } |
| 792 std::wstring font_name(font->lfFaceName, LF_FACESIZE); |
| 793 LOG(ERROR) << "Invalid LOGFONT '" << WideToUTF8(font_name) << "'"; |
| 792 } | 794 } |
| 793 | 795 |
| 794 NOTREACHED(); | 796 NOTREACHED(); |
| 795 return false; | 797 return false; |
| 796 } | 798 } |
| 797 | 799 |
| 798 void ParamTraits<LOGFONT>::Log(const param_type& p, std::string* l) { | 800 void ParamTraits<LOGFONT>::Log(const param_type& p, std::string* l) { |
| 799 l->append(base::StringPrintf("<LOGFONT>")); | 801 l->append(base::StringPrintf("<LOGFONT>")); |
| 800 } | 802 } |
| 801 | 803 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 818 return result; | 820 return result; |
| 819 } | 821 } |
| 820 | 822 |
| 821 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 823 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
| 822 l->append("<MSG>"); | 824 l->append("<MSG>"); |
| 823 } | 825 } |
| 824 | 826 |
| 825 #endif // OS_WIN | 827 #endif // OS_WIN |
| 826 | 828 |
| 827 } // namespace IPC | 829 } // namespace IPC |
| OLD | NEW |