Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 1372153002: Detecting and fixing stringprintf.h format bugs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Separate #if defined blocks. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/handle_win.cc ('k') | mojo/fetcher/network_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 base::PickleIterator* iter, 942 base::PickleIterator* iter,
943 param_type* r) { 943 param_type* r) {
944 int32_t temp; 944 int32_t temp;
945 if (!iter->ReadInt(&temp)) 945 if (!iter->ReadInt(&temp))
946 return false; 946 return false;
947 *r = LongToHandle(temp); 947 *r = LongToHandle(temp);
948 return true; 948 return true;
949 } 949 }
950 950
951 void ParamTraits<HANDLE>::Log(const param_type& p, std::string* l) { 951 void ParamTraits<HANDLE>::Log(const param_type& p, std::string* l) {
952 l->append(base::StringPrintf("0x%X", p)); 952 l->append(base::StringPrintf("0x%p", p));
953 } 953 }
954 954
955 void ParamTraits<LOGFONT>::Write(Message* m, const param_type& p) { 955 void ParamTraits<LOGFONT>::Write(Message* m, const param_type& p) {
956 m->WriteData(reinterpret_cast<const char*>(&p), sizeof(LOGFONT)); 956 m->WriteData(reinterpret_cast<const char*>(&p), sizeof(LOGFONT));
957 } 957 }
958 958
959 bool ParamTraits<LOGFONT>::Read(const Message* m, 959 bool ParamTraits<LOGFONT>::Read(const Message* m,
960 base::PickleIterator* iter, 960 base::PickleIterator* iter,
961 param_type* r) { 961 param_type* r) {
962 const char *data; 962 const char *data;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 return result; 997 return result;
998 } 998 }
999 999
1000 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { 1000 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) {
1001 l->append("<MSG>"); 1001 l->append("<MSG>");
1002 } 1002 }
1003 1003
1004 #endif // OS_WIN 1004 #endif // OS_WIN
1005 1005
1006 } // namespace IPC 1006 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/handle_win.cc ('k') | mojo/fetcher/network_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698