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

Side by Side Diff: tools/ipc_fuzzer/message_lib/message_cracker.h

Issue 1549203002: Switch to standard integer types in tools/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_CRACKER_H_ 5 #ifndef TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_CRACKER_H_
6 #define TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_CRACKER_H_ 6 #define TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_CRACKER_H_
7 7
8 #include <stdint.h>
8 #include <string.h> 9 #include <string.h>
10 #include "base/macros.h"
9 #include "ipc/ipc_message.h" 11 #include "ipc/ipc_message.h"
10 12
11 // Means for updating protected message fields. 13 // Means for updating protected message fields.
12 class MessageCracker : public IPC::Message { 14 class MessageCracker : public IPC::Message {
13 public: 15 public:
14 static void CopyMessageID(IPC::Message* dst, IPC::Message* src) { 16 static void CopyMessageID(IPC::Message* dst, IPC::Message* src) {
15 memcpy(ToCracker(dst)->mutable_payload(), 17 memcpy(ToCracker(dst)->mutable_payload(),
16 ToCracker(src)->payload(), 18 ToCracker(src)->payload(),
17 sizeof(int)); 19 sizeof(int));
18 } 20 }
19 21
20 static void SetMessageType(IPC::Message* message, uint32 type) { 22 static void SetMessageType(IPC::Message* message, uint32_t type) {
21 ToCracker(message)->header()->type = type; 23 ToCracker(message)->header()->type = type;
22 } 24 }
23 25
24 private: 26 private:
25 static MessageCracker* ToCracker(IPC::Message* message) { 27 static MessageCracker* ToCracker(IPC::Message* message) {
26 return reinterpret_cast<MessageCracker*>(message); 28 return reinterpret_cast<MessageCracker*>(message);
27 } 29 }
28 30
29 DISALLOW_COPY_AND_ASSIGN(MessageCracker); 31 DISALLOW_COPY_AND_ASSIGN(MessageCracker);
30 }; 32 };
31 33
32 #endif // TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_CRACKER_H_ 34 #endif // TOOLS_IPC_FUZZER_MESSAGE_LIB_MESSAGE_CRACKER_H_
OLDNEW
« no previous file with comments | « tools/ipc_fuzzer/message_dump/message_dump.cc ('k') | tools/ipc_fuzzer/message_lib/message_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698