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) << "'"; | |
794 } | 792 } |
795 | 793 |
796 NOTREACHED(); | 794 NOTREACHED(); |
797 return false; | 795 return false; |
798 } | 796 } |
799 | 797 |
800 void ParamTraits<LOGFONT>::Log(const param_type& p, std::string* l) { | 798 void ParamTraits<LOGFONT>::Log(const param_type& p, std::string* l) { |
801 l->append(base::StringPrintf("<LOGFONT>")); | 799 l->append(base::StringPrintf("<LOGFONT>")); |
802 } | 800 } |
803 | 801 |
(...skipping 16 matching lines...) Expand all Loading... |
820 return result; | 818 return result; |
821 } | 819 } |
822 | 820 |
823 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 821 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
824 l->append("<MSG>"); | 822 l->append("<MSG>"); |
825 } | 823 } |
826 | 824 |
827 #endif // OS_WIN | 825 #endif // OS_WIN |
828 | 826 |
829 } // namespace IPC | 827 } // namespace IPC |
OLD | NEW |