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

Side by Side Diff: chrome/common/ipc_message_utils.h

Issue 147154: Use C99 standard format macros for 64-bit values. (Closed)
Patch Set: ... Created 11 years, 6 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_COMMON_IPC_MESSAGE_UTILS_H_ 5 #ifndef CHROME_COMMON_IPC_MESSAGE_UTILS_H_
6 #define CHROME_COMMON_IPC_MESSAGE_UTILS_H_ 6 #define CHROME_COMMON_IPC_MESSAGE_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include <map> 10 #include <map>
11 11
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/format_macros.h"
14 #include "base/string16.h"
13 #include "base/string_util.h" 15 #include "base/string_util.h"
14 #include "base/string16.h"
15 #include "base/tuple.h" 16 #include "base/tuple.h"
16 #if defined(OS_POSIX) 17 #if defined(OS_POSIX)
17 #include "chrome/common/file_descriptor_set_posix.h" 18 #include "chrome/common/file_descriptor_set_posix.h"
18 #endif 19 #endif
19 #include "chrome/common/ipc_channel_handle.h" 20 #include "chrome/common/ipc_channel_handle.h"
20 #include "chrome/common/ipc_sync_message.h" 21 #include "chrome/common/ipc_sync_message.h"
21 #include "chrome/common/thumbnail_score.h" 22 #include "chrome/common/thumbnail_score.h"
22 #include "chrome/common/transport_dib.h" 23 #include "chrome/common/transport_dib.h"
23 #include "webkit/glue/webcursor.h" 24 #include "webkit/glue/webcursor.h"
24 #include "webkit/glue/window_open_disposition.h" 25 #include "webkit/glue/window_open_disposition.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 template <> 212 template <>
212 struct ParamTraits<int64> { 213 struct ParamTraits<int64> {
213 typedef int64 param_type; 214 typedef int64 param_type;
214 static void Write(Message* m, const param_type& p) { 215 static void Write(Message* m, const param_type& p) {
215 m->WriteInt64(p); 216 m->WriteInt64(p);
216 } 217 }
217 static bool Read(const Message* m, void** iter, param_type* r) { 218 static bool Read(const Message* m, void** iter, param_type* r) {
218 return m->ReadInt64(iter, r); 219 return m->ReadInt64(iter, r);
219 } 220 }
220 static void Log(const param_type& p, std::wstring* l) { 221 static void Log(const param_type& p, std::wstring* l) {
221 l->append(StringPrintf(L"%I64d", p)); 222 l->append(StringPrintf(L"%" WidePRId64, p));
222 } 223 }
223 }; 224 };
224 225
225 template <> 226 template <>
226 struct ParamTraits<uint64> { 227 struct ParamTraits<uint64> {
227 typedef uint64 param_type; 228 typedef uint64 param_type;
228 static void Write(Message* m, const param_type& p) { 229 static void Write(Message* m, const param_type& p) {
229 m->WriteInt64(static_cast<int64>(p)); 230 m->WriteInt64(static_cast<int64>(p));
230 } 231 }
231 static bool Read(const Message* m, void** iter, param_type* r) { 232 static bool Read(const Message* m, void** iter, param_type* r) {
232 return m->ReadInt64(iter, reinterpret_cast<int64*>(r)); 233 return m->ReadInt64(iter, reinterpret_cast<int64*>(r));
233 } 234 }
234 static void Log(const param_type& p, std::wstring* l) { 235 static void Log(const param_type& p, std::wstring* l) {
235 l->append(StringPrintf(L"%I64u", p)); 236 l->append(StringPrintf(L"%" WidePRId64, p));
236 } 237 }
237 }; 238 };
238 239
239 template <> 240 template <>
240 struct ParamTraits<double> { 241 struct ParamTraits<double> {
241 typedef double param_type; 242 typedef double param_type;
242 static void Write(Message* m, const param_type& p) { 243 static void Write(Message* m, const param_type& p) {
243 m->WriteData(reinterpret_cast<const char*>(&p), sizeof(param_type)); 244 m->WriteData(reinterpret_cast<const char*>(&p), sizeof(param_type));
244 } 245 }
245 static bool Read(const Message* m, void** iter, param_type* r) { 246 static bool Read(const Message* m, void** iter, param_type* r) {
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 ReplyParam p(a, b, c, d, e); 1393 ReplyParam p(a, b, c, d, e);
1393 WriteParam(reply, p); 1394 WriteParam(reply, p);
1394 } 1395 }
1395 }; 1396 };
1396 1397
1397 //----------------------------------------------------------------------------- 1398 //-----------------------------------------------------------------------------
1398 1399
1399 } // namespace IPC 1400 } // namespace IPC
1400 1401
1401 #endif // CHROME_COMMON_IPC_MESSAGE_UTILS_H_ 1402 #endif // CHROME_COMMON_IPC_MESSAGE_UTILS_H_
OLDNEW
« chrome/chrome.gyp ('K') | « chrome/chrome.gyp ('k') | net/base/cookie_monster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698