ipc: Convert int types from basictypes.h to the ones from stdint.h

Now that the supported toolchain has stdint.h, use the integer types
from this standard header file.

BUG=138542
TEST=ipc_tests
[email protected]
[email protected] # for ui/

Review URL: https://codereview.chromium.org/1322253003

Cr-Commit-Position: refs/heads/master@{#347457}
diff --git a/ipc/ipc_channel.cc b/ipc/ipc_channel.cc
index ac09c5a..e659205a 100644
--- a/ipc/ipc_channel.cc
+++ b/ipc/ipc_channel.cc
@@ -4,6 +4,8 @@
 
 #include "ipc/ipc_channel.h"
 
+#include <stdint.h>
+
 #include <limits>
 
 #include "base/atomic_sequence_num.h"
@@ -38,7 +40,7 @@
   return base::StringPrintf("%d.%u.%d",
       process_id,
       g_last_id.GetNext(),
-      base::RandInt(0, std::numeric_limits<int32>::max()));
+      base::RandInt(0, std::numeric_limits<int32_t>::max()));
 }
 
 }  // namespace IPC
diff --git a/ipc/ipc_channel_nacl.cc b/ipc/ipc_channel_nacl.cc
index 2e5f8b3..2c63b81 100644
--- a/ipc/ipc_channel_nacl.cc
+++ b/ipc/ipc_channel_nacl.cc
@@ -6,6 +6,7 @@
 
 #include <errno.h>
 #include <stddef.h>
+#include <stdint.h>
 #include <sys/types.h>
 
 #include <algorithm>
@@ -358,7 +359,7 @@
 }
 
 bool ChannelNacl::GetNonBrokeredAttachments(Message* msg) {
-  uint16 header_fds = msg->header()->num_fds;
+  uint16_t header_fds = msg->header()->num_fds;
   CHECK(header_fds == input_fds_.size());
   if (header_fds == 0)
     return true;  // Nothing to do.
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index b5e23328..a3b5ae1 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -7,6 +7,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <stddef.h>
+#include <stdint.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -440,7 +441,7 @@
 
       // DCHECK_LE above already checks that
       // num_fds < kMaxDescriptorsPerMessage so no danger of overflow.
-      msg->header()->num_fds = static_cast<uint16>(num_fds);
+      msg->header()->num_fds = static_cast<uint16_t>(num_fds);
     }
 
     if (bytes_written == 1) {
@@ -812,7 +813,7 @@
 // This will read from the input_fds_ (READWRITE mode only) and read more
 // handles from the FD pipe if necessary.
 bool ChannelPosix::GetNonBrokeredAttachments(Message* msg) {
-  uint16 header_fds = msg->header()->num_fds;
+  uint16_t header_fds = msg->header()->num_fds;
   if (!header_fds)
     return true;  // Nothing to do.
 
diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc
index d545e60..eb78b7c 100644
--- a/ipc/ipc_channel_posix_unittest.cc
+++ b/ipc/ipc_channel_posix_unittest.cc
@@ -7,6 +7,7 @@
 #include "ipc/ipc_channel_posix.h"
 
 #include <fcntl.h>
+#include <stdint.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
@@ -28,7 +29,7 @@
 
 namespace {
 
-static const uint32 kQuitMessage = 47;
+static const uint32_t kQuitMessage = 47;
 
 class IPCChannelPosixTestListener : public IPC::Listener {
  public:
@@ -55,7 +56,7 @@
     return true;
   }
 
-  void OnChannelConnected(int32 peer_pid) override {
+  void OnChannelConnected(int32_t peer_pid) override {
     status_ = CONNECTED;
     if (!quit_only_on_message_) {
       QuitRunLoop();
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 5a9c3e3..e48a71cc 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -100,7 +100,7 @@
 }
 
 // Called on the IPC::Channel thread
-void ChannelProxy::Context::OnChannelConnected(int32 peer_pid) {
+void ChannelProxy::Context::OnChannelConnected(int32_t peer_pid) {
   // We cache off the peer_pid so it can be safely accessed from both threads.
   peer_pid_ = channel_->GetPeerPID();
 
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index 714bafd..935aa772 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -195,7 +195,7 @@
 
     // IPC::Listener methods:
     bool OnMessageReceived(const Message& message) override;
-    void OnChannelConnected(int32 peer_pid) override;
+    void OnChannelConnected(int32_t peer_pid) override;
     void OnChannelError() override;
 
     // Like OnMessageReceived but doesn't try the filters.
diff --git a/ipc/ipc_channel_proxy_unittest.cc b/ipc/ipc_channel_proxy_unittest.cc
index 3ec4c43..954857e 100644
--- a/ipc/ipc_channel_proxy_unittest.cc
+++ b/ipc/ipc_channel_proxy_unittest.cc
@@ -133,7 +133,7 @@
         last_filter_event_(NONE),
         message_filtering_enabled_(false) {}
 
-  MessageCountFilter(uint32 supported_message_class)
+  MessageCountFilter(uint32_t supported_message_class)
       : messages_received_(0),
         supported_message_class_(supported_message_class),
         is_global_filter_(false),
@@ -201,7 +201,7 @@
   }
 
   bool GetSupportedMessageClasses(
-      std::vector<uint32>* supported_message_classes) const override {
+      std::vector<uint32_t>* supported_message_classes) const override {
     if (is_global_filter_)
       return false;
     supported_message_classes->push_back(supported_message_class_);
@@ -219,7 +219,7 @@
   ~MessageCountFilter() override {}
 
   size_t messages_received_;
-  uint32 supported_message_class_;
+  uint32_t supported_message_class_;
   bool is_global_filter_;
 
   FilterEvent last_filter_event_;
diff --git a/ipc/ipc_channel_unittest.cc b/ipc/ipc_channel_unittest.cc
index 3127af7..10023bc 100644
--- a/ipc/ipc_channel_unittest.cc
+++ b/ipc/ipc_channel_unittest.cc
@@ -126,7 +126,7 @@
   ChannelListenerWithOnConnectedSend() {}
   ~ChannelListenerWithOnConnectedSend() override {}
 
-  void OnChannelConnected(int32 peer_pid) override {
+  void OnChannelConnected(int32_t peer_pid) override {
     SendNextMessage();
   }
 };
diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
index ad7ffb5..8428150 100644
--- a/ipc/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -4,6 +4,7 @@
 
 #include "ipc/ipc_channel_win.h"
 
+#include <stdint.h>
 #include <windows.h>
 
 #include "base/auto_reset.h"
@@ -222,11 +223,11 @@
   DCHECK_EQ(msg.type(), static_cast<unsigned>(Channel::HELLO_MESSAGE_TYPE));
   // The hello message contains one parameter containing the PID.
   base::PickleIterator it(msg);
-  int32 claimed_pid;
+  int32_t claimed_pid;
   bool failed = !it.ReadInt(&claimed_pid);
 
   if (!failed && validate_client_) {
-    int32 secret;
+    int32_t secret;
     failed = it.ReadInt(&secret) ? (secret != client_secret_) : true;
   }
 
@@ -260,8 +261,8 @@
 }
 
 // static
-const base::string16 ChannelWin::PipeName(
-    const std::string& channel_id, int32* secret) {
+const base::string16 ChannelWin::PipeName(const std::string& channel_id,
+                                          int32_t* secret) {
   std::string name("\\\\.\\pipe\\chrome.");
 
   // Prevent the shared secret from ending up in the pipe name.
@@ -356,7 +357,7 @@
 
   // Don't send the secret to the untrusted process, and don't send a secret
   // if the value is zero (for IPC backwards compatability).
-  int32 secret = validate_client_ ? 0 : client_secret_;
+  int32_t secret = validate_client_ ? 0 : client_secret_;
   if (!m->WriteInt(GetCurrentProcessId()) ||
       (secret && !m->WriteUInt32(secret))) {
     pipe_.Close();
@@ -469,7 +470,7 @@
   DCHECK(m->size() <= INT_MAX);
   BOOL ok = WriteFile(pipe_.Get(),
                       m->data(),
-                      static_cast<uint32>(m->size()),
+                      static_cast<uint32_t>(m->size()),
                       NULL,
                       &output_state_.context.overlapped);
   if (!ok) {
diff --git a/ipc/ipc_channel_win.h b/ipc/ipc_channel_win.h
index d905297..b3df4f34 100644
--- a/ipc/ipc_channel_win.h
+++ b/ipc/ipc_channel_win.h
@@ -7,6 +7,8 @@
 
 #include "ipc/ipc_channel.h"
 
+#include <stdint.h>
+
 #include <queue>
 #include <string>
 
@@ -56,7 +58,7 @@
   bool IsAttachmentBrokerEndpoint() override;
 
   static const base::string16 PipeName(const std::string& channel_id,
-                                       int32* secret);
+                                       int32_t* secret);
   bool CreatePipe(const IPC::ChannelHandle &channel_handle, Mode mode);
 
   bool ProcessConnection();
@@ -121,13 +123,13 @@
   bool validate_client_;
 
   // Tracks the lifetime of this object, for debugging purposes.
-  uint32 debug_flags_;
+  uint32_t debug_flags_;
 
   // This is a unique per-channel value used to authenticate the client end of
   // a connection. If the value is non-zero, the client passes it in the hello
   // and the host validates. (We don't send the zero value fto preserve IPC
   // compatability with existing clients that don't validate the channel.)
-  int32 client_secret_;
+  int32_t client_secret_;
 
   scoped_ptr<base::ThreadChecker> thread_check_;
 
diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc
index 5dfddba..efaed2c 100644
--- a/ipc/ipc_fuzzing_tests.cc
+++ b/ipc/ipc_fuzzing_tests.cc
@@ -2,9 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include <stdint.h>
 #include <stdio.h>
-#include <string>
+
 #include <sstream>
+#include <string>
 
 #include "base/message_loop/message_loop.h"
 #include "base/strings/string16.h"
@@ -38,7 +40,7 @@
 
 TEST(IPCMessageIntegrity, ReadBeyondBufferStr) {
   // This was BUG 984408.
-  uint32 v1 = kuint32max - 1;
+  uint32_t v1 = kuint32max - 1;
   int v2 = 666;
   IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL);
   EXPECT_TRUE(m.WriteInt(v1));
@@ -51,7 +53,7 @@
 
 TEST(IPCMessageIntegrity, ReadBeyondBufferStr16) {
   // This was BUG 984408.
-  uint32 v1 = kuint32max - 1;
+  uint32_t v1 = kuint32max - 1;
   int v2 = 777;
   IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL);
   EXPECT_TRUE(m.WriteInt(v1));
@@ -101,7 +103,7 @@
   EXPECT_TRUE(m.WriteInt64(1));
   EXPECT_TRUE(m.WriteInt64(2));
 
-  std::vector<int64> vec;
+  std::vector<int64_t> vec;
   base::PickleIterator iter(m);
   EXPECT_FALSE(ReadParam(&m, &iter, &vec));
 }
@@ -115,7 +117,7 @@
   EXPECT_TRUE(m.WriteInt64(1));
   EXPECT_TRUE(m.WriteInt64(2));
 
-  std::vector<int64> vec;
+  std::vector<int64_t> vec;
   base::PickleIterator iter(m);
   EXPECT_FALSE(ReadParam(&m, &iter, &vec));
 }
@@ -170,7 +172,7 @@
     Cleanup();
   }
 
-  bool RoundtripAckReply(int routing, uint32 type_id, int reply) {
+  bool RoundtripAckReply(int routing, uint32_t type_id, int reply) {
     IPC::Message* message = new IPC::Message(routing, type_id,
                                              IPC::Message::PRIORITY_NORMAL);
     message->WriteInt(reply + 1);
@@ -185,7 +187,7 @@
       base::MessageLoop::current()->Quit();
   }
 
-  void ReplyMsgNotHandled(uint32 type_id) {
+  void ReplyMsgNotHandled(uint32_t type_id) {
     RoundtripAckReply(FUZZER_ROUTING_ID, MsgUnhandled::ID, type_id);
     Cleanup();
   }
@@ -213,7 +215,7 @@
     return true;
   }
 
-  bool ExpectMessage(int value, uint32 type_id) {
+  bool ExpectMessage(int value, uint32_t type_id) {
     if (!MsgHandlerInternal(type_id))
       return false;
     int msg_value1 = 0;
@@ -233,12 +235,12 @@
     return true;
   }
 
-  bool ExpectMsgNotHandled(uint32 type_id) {
+  bool ExpectMsgNotHandled(uint32_t type_id) {
     return ExpectMessage(type_id, MsgUnhandled::ID);
   }
 
  private:
-  bool MsgHandlerInternal(uint32 type_id) {
+  bool MsgHandlerInternal(uint32_t type_id) {
     base::MessageLoop::current()->Run();
     if (NULL == last_msg_)
       return false;
diff --git a/ipc/ipc_listener.h b/ipc/ipc_listener.h
index 733bc46..02770862 100644
--- a/ipc/ipc_listener.h
+++ b/ipc/ipc_listener.h
@@ -5,7 +5,8 @@
 #ifndef IPC_IPC_LISTENER_H_
 #define IPC_IPC_LISTENER_H_
 
-#include "base/basictypes.h"
+#include <stdint.h>
+
 #include "build/build_config.h"
 #include "ipc/ipc_export.h"
 
@@ -22,7 +23,7 @@
 
   // Called when the channel is connected and we have received the internal
   // Hello message from the peer.
-  virtual void OnChannelConnected(int32 peer_pid) {}
+  virtual void OnChannelConnected(int32_t peer_pid) {}
 
   // Called when an error is detected that causes the channel to close.
   // This method is not called when a channel is closed normally.
diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc
index da80b14d..20a1a13e 100644
--- a/ipc/ipc_logging.cc
+++ b/ipc/ipc_logging.cc
@@ -167,7 +167,7 @@
   }
 }
 
-void Logging::GetMessageText(uint32 type, std::string* name,
+void Logging::GetMessageText(uint32_t type, std::string* name,
                              const Message* message,
                              std::string* params) {
   if (!log_function_map_)
diff --git a/ipc/ipc_logging.h b/ipc/ipc_logging.h
index f730b6a..81315f7 100644
--- a/ipc/ipc_logging.h
+++ b/ipc/ipc_logging.h
@@ -5,6 +5,8 @@
 #ifndef IPC_IPC_LOGGING_H_
 #define IPC_IPC_LOGGING_H_
 
+#include <stdint.h>
+
 #include "ipc/ipc_message.h"  // For IPC_MESSAGE_LOG_ENABLED.
 
 #ifdef IPC_MESSAGE_LOG_ENABLED
@@ -23,7 +25,7 @@
                             const IPC::Message* msg,
                             std::string* params);
 
-typedef base::hash_map<uint32, LogFunction > LogFunctionMap;
+typedef base::hash_map<uint32_t, LogFunction > LogFunctionMap;
 
 namespace IPC {
 
@@ -73,7 +75,7 @@
   // Like the *MsgLog functions declared for each message class, except this
   // calls the correct one based on the message type automatically.  Defined in
   // ipc_logging.cc.
-  static void GetMessageText(uint32 type, std::string* name,
+  static void GetMessageText(uint32_t type, std::string* name,
                              const Message* message, std::string* params);
 
   static void set_log_function_map(LogFunctionMap* functions) {
diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc
index 07d5d25..2229cdd 100644
--- a/ipc/ipc_message.cc
+++ b/ipc/ipc_message.cc
@@ -22,11 +22,11 @@
 // Create a reference number for identifying IPC messages in traces. The return
 // values has the reference number stored in the upper 24 bits, leaving the low
 // 8 bits set to 0 for use as flags.
-inline uint32 GetRefNumUpper24() {
+inline uint32_t GetRefNumUpper24() {
   base::trace_event::TraceLog* trace_log =
       base::trace_event::TraceLog::GetInstance();
-  uint32 pid = trace_log ? trace_log->process_id() : 0;
-  uint32 count = g_ref_num.GetNext();
+  uint32_t pid = trace_log ? trace_log->process_id() : 0;
+  uint32_t count = g_ref_num.GetNext();
   // The 24 bit hash is composed of 14 bits of the count and 10 bits of the
   // Process ID. With the current trace event buffer cap, the 14-bit count did
   // not appear to wrap during a trace. Note that it is not a big deal if
@@ -53,7 +53,7 @@
   Init();
 }
 
-Message::Message(int32 routing_id, uint32 type, PriorityValue priority)
+Message::Message(int32_t routing_id, uint32_t type, PriorityValue priority)
     : base::Pickle(sizeof(Header)) {
   header()->routing = routing_id;
   header()->type = type;
@@ -92,7 +92,7 @@
   return *this;
 }
 
-void Message::SetHeaderValues(int32 routing, uint32 type, uint32 flags) {
+void Message::SetHeaderValues(int32_t routing, uint32_t type, uint32_t flags) {
   // This should only be called when the message is already empty.
   DCHECK(payload_size() == 0);
 
@@ -107,22 +107,22 @@
 }
 
 #ifdef IPC_MESSAGE_LOG_ENABLED
-void Message::set_sent_time(int64 time) {
+void Message::set_sent_time(int64_t time) {
   DCHECK((header()->flags & HAS_SENT_TIME_BIT) == 0);
   header()->flags |= HAS_SENT_TIME_BIT;
   WriteInt64(time);
 }
 
-int64 Message::sent_time() const {
+int64_t Message::sent_time() const {
   if ((header()->flags & HAS_SENT_TIME_BIT) == 0)
     return 0;
 
   const char* data = end_of_payload();
-  data -= sizeof(int64);
-  return *(reinterpret_cast<const int64*>(data));
+  data -= sizeof(int64_t);
+  return *(reinterpret_cast<const int64_t*>(data));
 }
 
-void Message::set_received_time(int64 time) const {
+void Message::set_received_time(int64_t time) const {
   received_time_ = time;
 }
 #endif
diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h
index d12f6a3..cc7ebb3 100644
--- a/ipc/ipc_message.h
+++ b/ipc/ipc_message.h
@@ -5,6 +5,8 @@
 #ifndef IPC_IPC_MESSAGE_H_
 #define IPC_IPC_MESSAGE_H_
 
+#include <stdint.h>
+
 #include <string>
 
 #include "base/basictypes.h"
@@ -56,7 +58,7 @@
 
   // Initialize a message with a user-defined type, priority value, and
   // destination WebView ID.
-  Message(int32 routing_id, uint32 type, PriorityValue priority);
+  Message(int32_t routing_id, uint32_t type, PriorityValue priority);
 
   // Initializes a message from a const block of data.  The data is not copied;
   // instead the data is merely referenced by this message.  Only const methods
@@ -126,25 +128,25 @@
     return dispatch_error_;
   }
 
-  uint32 type() const {
+  uint32_t type() const {
     return header()->type;
   }
 
-  int32 routing_id() const {
+  int32_t routing_id() const {
     return header()->routing;
   }
 
-  void set_routing_id(int32 new_id) {
+  void set_routing_id(int32_t new_id) {
     header()->routing = new_id;
   }
 
-  uint32 flags() const {
+  uint32_t flags() const {
     return header()->flags;
   }
 
   // Sets all the given header values. The message should be empty at this
   // call.
-  void SetHeaderValues(int32 routing, uint32 type, uint32 flags);
+  void SetHeaderValues(int32_t routing, uint32_t type, uint32_t flags);
 
   template<class T, class S, class P>
   static bool Dispatch(const Message* msg, T* obj, S* sender, P* parameter,
@@ -190,11 +192,11 @@
 #ifdef IPC_MESSAGE_LOG_ENABLED
   // Adds the outgoing time from Time::Now() at the end of the message and sets
   // a bit to indicate that it's been added.
-  void set_sent_time(int64 time);
-  int64 sent_time() const;
+  void set_sent_time(int64_t time);
+  int64_t sent_time() const;
 
-  void set_received_time(int64 time) const;
-  int64 received_time() const { return received_time_; }
+  void set_received_time(int64_t time) const;
+  int64_t received_time() const { return received_time_; }
   void set_output_params(const std::string& op) const { output_params_ = op; }
   const std::string& output_params() const { return output_params_; }
   // The following four functions are needed so we can log sync messages with
@@ -219,12 +221,12 @@
 
 #pragma pack(push, 4)
   struct Header : base::Pickle::Header {
-    int32 routing;  // ID of the view that this message is destined for
-    uint32 type;    // specifies the user-defined message type
-    uint32 flags;   // specifies control flags for the message
+    int32_t routing;  // ID of the view that this message is destined for
+    uint32_t type;    // specifies the user-defined message type
+    uint32_t flags;   // specifies control flags for the message
 #if defined(OS_POSIX)
-    uint16 num_fds; // the number of descriptors included with this message
-    uint16 pad;     // explicitly initialize this to appease valgrind
+    uint16_t num_fds; // the number of descriptors included with this message
+    uint16_t pad;     // explicitly initialize this to appease valgrind
 #endif
   };
 #pragma pack(pop)
@@ -261,7 +263,7 @@
 
 #ifdef IPC_MESSAGE_LOG_ENABLED
   // Used for logging.
-  mutable int64 received_time_;
+  mutable int64_t received_time_;
   mutable std::string output_params_;
   mutable LogData* log_data_;
   mutable bool dont_log_;
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h
index 4938292..daeb617c 100644
--- a/ipc/ipc_message_macros.h
+++ b/ipc/ipc_message_macros.h
@@ -194,6 +194,8 @@
 #ifndef IPC_IPC_MESSAGE_MACROS_H_
 #define IPC_IPC_MESSAGE_MACROS_H_
 
+#include <stdint.h>
+
 #include "base/profiler/scoped_profile.h"
 #include "ipc/ipc_message_utils.h"
 #include "ipc/param_traits_macros.h"
@@ -591,7 +593,7 @@
    public:                                                                    \
     typedef IPC::Message Schema;                                              \
     enum { ID = IPC_MESSAGE_ID() };                                           \
-    msg_class(int32 routing_id)                                               \
+    msg_class(int32_t routing_id)                                             \
         : IPC::Message(routing_id, ID, PRIORITY_NORMAL) {}                    \
     static void Log(std::string* name, const Message* msg, std::string* l);   \
   };
@@ -615,7 +617,7 @@
     typedef IPC::MessageSchema<IPC_TUPLE_IN_##in_cnt in_list> Schema;         \
     typedef Schema::Param Param;                                              \
     enum { ID = IPC_MESSAGE_ID() };                                           \
-    msg_class(int32 routing_id IPC_COMMA_##in_cnt                             \
+    msg_class(int32_t routing_id IPC_COMMA_##in_cnt                           \
               IPC_TYPE_IN_##in_cnt in_list);                                  \
     ~msg_class() override;                                                    \
     static bool Read(const Message* msg, Schema::Param* p);                   \
@@ -651,7 +653,7 @@
     typedef Schema::ReplyParam ReplyParam;                                    \
     typedef Schema::SendParam SendParam;                                      \
     enum { ID = IPC_MESSAGE_ID() };                                           \
-    msg_class(int32 routing_id                                                \
+    msg_class(int32_t routing_id                                              \
               IPC_COMMA_OR_##in_cnt(IPC_COMMA_##out_cnt)                      \
               IPC_TYPE_IN_##in_cnt in_list                                    \
               IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt)                     \
@@ -690,7 +692,7 @@
   }
 
 #define IPC_ASYNC_ROUTED_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list)  \
-  msg_class::msg_class(int32 routing_id IPC_COMMA_##in_cnt                    \
+  msg_class::msg_class(int32_t routing_id IPC_COMMA_##in_cnt                  \
                        IPC_TYPE_IN_##in_cnt in_list) :                        \
       IPC::Message(routing_id, ID, PRIORITY_NORMAL) {                         \
         Schema::Write(this, IPC_NAME_IN_##in_cnt in_list);                    \
@@ -720,7 +722,7 @@
   }
 
 #define IPC_SYNC_ROUTED_IMPL(msg_class, in_cnt, out_cnt, in_list, out_list)   \
-  msg_class::msg_class(int32 routing_id                                       \
+  msg_class::msg_class(int32_t routing_id                                     \
                        IPC_COMMA_OR_##in_cnt(IPC_COMMA_##out_cnt)             \
                        IPC_TYPE_IN_##in_cnt in_list                           \
                        IPC_COMMA_AND_##in_cnt(IPC_COMMA_##out_cnt)            \
@@ -793,7 +795,7 @@
   class LoggerRegisterHelper##msg_class {                               \
  public:                                                                \
     LoggerRegisterHelper##msg_class() {                                 \
-      const uint32 msg_id = static_cast<uint32>(msg_class::ID);         \
+      const uint32_t msg_id = static_cast<uint32_t>(msg_class::ID);     \
       IPC_LOG_TABLE_ADD_ENTRY(msg_id, msg_class::Log);                  \
     }                                                                   \
   };                                                                    \
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index dbb2572..5e615c3 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -314,15 +314,15 @@
 }
 
 void ParamTraits<long>::Log(const param_type& p, std::string* l) {
-  l->append(base::Int64ToString(static_cast<int64>(p)));
+  l->append(base::Int64ToString(static_cast<int64_t>(p)));
 }
 
 void ParamTraits<unsigned long>::Log(const param_type& p, std::string* l) {
-  l->append(base::Uint64ToString(static_cast<uint64>(p)));
+  l->append(base::Uint64ToString(static_cast<uint64_t>(p)));
 }
 
 void ParamTraits<long long>::Log(const param_type& p, std::string* l) {
-  l->append(base::Int64ToString(static_cast<int64>(p)));
+  l->append(base::Int64ToString(static_cast<int64_t>(p)));
 }
 
 void ParamTraits<unsigned long long>::Log(const param_type& p, std::string* l) {
@@ -697,32 +697,32 @@
 }
 
 void ParamTraits<base::Time>::Write(Message* m, const param_type& p) {
-  ParamTraits<int64>::Write(m, p.ToInternalValue());
+  ParamTraits<int64_t>::Write(m, p.ToInternalValue());
 }
 
 bool ParamTraits<base::Time>::Read(const Message* m,
                                    base::PickleIterator* iter,
                                    param_type* r) {
-  int64 value;
-  if (!ParamTraits<int64>::Read(m, iter, &value))
+  int64_t value;
+  if (!ParamTraits<int64_t>::Read(m, iter, &value))
     return false;
   *r = base::Time::FromInternalValue(value);
   return true;
 }
 
 void ParamTraits<base::Time>::Log(const param_type& p, std::string* l) {
-  ParamTraits<int64>::Log(p.ToInternalValue(), l);
+  ParamTraits<int64_t>::Log(p.ToInternalValue(), l);
 }
 
 void ParamTraits<base::TimeDelta>::Write(Message* m, const param_type& p) {
-  ParamTraits<int64>::Write(m, p.ToInternalValue());
+  ParamTraits<int64_t>::Write(m, p.ToInternalValue());
 }
 
 bool ParamTraits<base::TimeDelta>::Read(const Message* m,
                                         base::PickleIterator* iter,
                                         param_type* r) {
-  int64 value;
-  bool ret = ParamTraits<int64>::Read(m, iter, &value);
+  int64_t value;
+  bool ret = ParamTraits<int64_t>::Read(m, iter, &value);
   if (ret)
     *r = base::TimeDelta::FromInternalValue(value);
 
@@ -730,18 +730,18 @@
 }
 
 void ParamTraits<base::TimeDelta>::Log(const param_type& p, std::string* l) {
-  ParamTraits<int64>::Log(p.ToInternalValue(), l);
+  ParamTraits<int64_t>::Log(p.ToInternalValue(), l);
 }
 
 void ParamTraits<base::TimeTicks>::Write(Message* m, const param_type& p) {
-  ParamTraits<int64>::Write(m, p.ToInternalValue());
+  ParamTraits<int64_t>::Write(m, p.ToInternalValue());
 }
 
 bool ParamTraits<base::TimeTicks>::Read(const Message* m,
                                         base::PickleIterator* iter,
                                         param_type* r) {
-  int64 value;
-  bool ret = ParamTraits<int64>::Read(m, iter, &value);
+  int64_t value;
+  bool ret = ParamTraits<int64_t>::Read(m, iter, &value);
   if (ret)
     *r = base::TimeTicks::FromInternalValue(value);
 
@@ -749,18 +749,18 @@
 }
 
 void ParamTraits<base::TimeTicks>::Log(const param_type& p, std::string* l) {
-  ParamTraits<int64>::Log(p.ToInternalValue(), l);
+  ParamTraits<int64_t>::Log(p.ToInternalValue(), l);
 }
 
 void ParamTraits<base::TraceTicks>::Write(Message* m, const param_type& p) {
-  ParamTraits<int64>::Write(m, p.ToInternalValue());
+  ParamTraits<int64_t>::Write(m, p.ToInternalValue());
 }
 
 bool ParamTraits<base::TraceTicks>::Read(const Message* m,
                                          base::PickleIterator* iter,
                                          param_type* r) {
-  int64 value;
-  bool ret = ParamTraits<int64>::Read(m, iter, &value);
+  int64_t value;
+  bool ret = ParamTraits<int64_t>::Read(m, iter, &value);
   if (ret)
     *r = base::TraceTicks::FromInternalValue(value);
 
@@ -768,7 +768,7 @@
 }
 
 void ParamTraits<base::TraceTicks>::Log(const param_type& p, std::string* l) {
-  ParamTraits<int64>::Log(p.ToInternalValue(), l);
+  ParamTraits<int64_t>::Log(p.ToInternalValue(), l);
 }
 
 void ParamTraits<IPC::ChannelHandle>::Write(Message* m, const param_type& p) {
@@ -850,16 +850,16 @@
   // could be 64-bit and the host browser could be 32-bits. The nested message
   // may or may not be safe to send between 32-bit and 64-bit systems, but we
   // leave that up to the code sending the message to ensure.
-  m->WriteUInt32(static_cast<uint32>(p.routing_id()));
+  m->WriteUInt32(static_cast<uint32_t>(p.routing_id()));
   m->WriteUInt32(p.type());
   m->WriteUInt32(p.flags());
-  m->WriteData(p.payload(), static_cast<uint32>(p.payload_size()));
+  m->WriteData(p.payload(), static_cast<uint32_t>(p.payload_size()));
 }
 
 bool ParamTraits<Message>::Read(const Message* m,
                                 base::PickleIterator* iter,
                                 Message* r) {
-  uint32 routing_id, type, flags;
+  uint32_t routing_id, type, flags;
   if (!iter->ReadUInt32(&routing_id) ||
       !iter->ReadUInt32(&type) ||
       !iter->ReadUInt32(&flags))
@@ -870,7 +870,7 @@
   if (!iter->ReadData(&payload, &payload_size))
     return false;
 
-  r->SetHeaderValues(static_cast<int32>(routing_id), type, flags);
+  r->SetHeaderValues(static_cast<int32_t>(routing_id), type, flags);
   return r->WriteBytes(payload, payload_size);
 }
 
@@ -888,7 +888,7 @@
 bool ParamTraits<HANDLE>::Read(const Message* m,
                                base::PickleIterator* iter,
                                param_type* r) {
-  int32 temp;
+  int32_t temp;
   if (!iter->ReadInt(&temp))
     return false;
   *r = LongToHandle(temp);
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index 9d70aff5..d0c1f72 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -5,6 +5,8 @@
 #ifndef IPC_IPC_MESSAGE_UTILS_H_
 #define IPC_IPC_MESSAGE_UTILS_H_
 
+#include <stdint.h>
+
 #include <algorithm>
 #include <map>
 #include <set>
@@ -76,14 +78,14 @@
   ~LogData();
 
   std::string channel;
-  int32 routing_id;
-  uint32 type;  // "User-defined" message type, from ipc_message.h.
+  int32_t routing_id;
+  uint32_t type;  // "User-defined" message type, from ipc_message.h.
   std::string flags;
-  int64 sent;  // Time that the message was sent (i.e. at Send()).
-  int64 receive;  // Time before it was dispatched (i.e. before calling
-                  // OnMessageReceived).
-  int64 dispatch;  // Time after it was dispatched (i.e. after calling
-                   // OnMessageReceived).
+  int64_t sent;  // Time that the message was sent (i.e. at Send()).
+  int64_t receive;  // Time before it was dispatched (i.e. before calling
+                    // OnMessageReceived).
+  int64_t dispatch;  // Time after it was dispatched (i.e. after calling
+                     // OnMessageReceived).
   std::string message_name;
   std::string params;
 };
@@ -208,12 +210,12 @@
 struct ParamTraits<long long> {
   typedef long long param_type;
   static void Write(Message* m, const param_type& p) {
-    m->WriteInt64(static_cast<int64>(p));
+    m->WriteInt64(static_cast<int64_t>(p));
   }
   static bool Read(const Message* m,
                    base::PickleIterator* iter,
                    param_type* r) {
-    return iter->ReadInt64(reinterpret_cast<int64*>(r));
+    return iter->ReadInt64(reinterpret_cast<int64_t*>(r));
   }
   IPC_EXPORT static void Log(const param_type& p, std::string* l);
 };
@@ -227,7 +229,7 @@
   static bool Read(const Message* m,
                    base::PickleIterator* iter,
                    param_type* r) {
-    return iter->ReadInt64(reinterpret_cast<int64*>(r));
+    return iter->ReadInt64(reinterpret_cast<int64_t*>(r));
   }
   IPC_EXPORT static void Log(const param_type& p, std::string* l);
 };
diff --git a/ipc/ipc_message_utils_unittest.cc b/ipc/ipc_message_utils_unittest.cc
index 88d670d..35a3e66 100644
--- a/ipc/ipc_message_utils_unittest.cc
+++ b/ipc/ipc_message_utils_unittest.cc
@@ -4,6 +4,8 @@
 
 #include "ipc/ipc_message_utils.h"
 
+#include <stdint.h>
+
 #include "base/files/file_path.h"
 #include "ipc/ipc_message.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -13,8 +15,8 @@
 
 // Tests nesting of messages as parameters to other messages.
 TEST(IPCMessageUtilsTest, NestedMessages) {
-  int32 nested_routing = 12;
-  uint32 nested_type = 78;
+  int32_t nested_routing = 12;
+  uint32_t nested_type = 78;
   int nested_content = 456789;
   Message::PriorityValue nested_priority = Message::PRIORITY_HIGH;
   Message nested_msg(nested_routing, nested_type, nested_priority);
@@ -22,8 +24,8 @@
   ParamTraits<int>::Write(&nested_msg, nested_content);
 
   // Outer message contains the nested one as its parameter.
-  int32 outer_routing = 91;
-  uint32 outer_type = 88;
+  int32_t outer_routing = 91;
+  uint32_t outer_type = 88;
   Message::PriorityValue outer_priority = Message::PRIORITY_NORMAL;
   Message outer_msg(outer_routing, outer_type, outer_priority);
   ParamTraits<Message>::Write(&outer_msg, nested_msg);
diff --git a/ipc/ipc_perftest_support.cc b/ipc/ipc_perftest_support.cc
index 31a37a7a..5248cc84 100644
--- a/ipc/ipc_perftest_support.cc
+++ b/ipc/ipc_perftest_support.cc
@@ -67,7 +67,7 @@
  private:
   const std::string name_;
 
-  uint64 count_;
+  uint64_t count_;
   base::TimeDelta total_duration_;
   base::TimeDelta max_duration_;
 
@@ -99,7 +99,7 @@
     CHECK(channel_);
 
     base::PickleIterator iter(message);
-    int64 time_internal;
+    int64_t time_internal;
     EXPECT_TRUE(iter.ReadInt64(&time_internal));
     int msgid;
     EXPECT_TRUE(iter.ReadInt(&msgid));
@@ -168,7 +168,7 @@
     CHECK(sender_);
 
     base::PickleIterator iter(message);
-    int64 time_internal;
+    int64_t time_internal;
     EXPECT_TRUE(iter.ReadInt64(&time_internal));
     int msgid;
     EXPECT_TRUE(iter.ReadInt(&msgid));
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index 04ebd41..3cab9ad 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -96,7 +96,7 @@
 
   void DispatchMessages(SyncContext* dispatching_context) {
     bool first_time = true;
-    uint32 expected_version = 0;
+    uint32_t expected_version = 0;
     SyncMessageQueue::iterator it;
     while (true) {
       Message* message = NULL;
@@ -204,7 +204,7 @@
 
   typedef std::list<QueuedMessage> SyncMessageQueue;
   SyncMessageQueue message_queue_;
-  uint32 message_queue_version_;  // Used to signal DispatchMessages to rescan
+  uint32_t message_queue_version_;  // Used to signal DispatchMessages to rescan
 
   std::vector<QueuedMessage> received_replies_;
 
diff --git a/ipc/ipc_sync_message.cc b/ipc/ipc_sync_message.cc
index 6b59e11b..8a770b1 100644
--- a/ipc/ipc_sync_message.cc
+++ b/ipc/ipc_sync_message.cc
@@ -2,18 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "build/build_config.h"
+#include "ipc/ipc_sync_message.h"
 
-#if defined(OS_WIN)
-#include <windows.h>
-#endif
 #include <stack>
 
 #include "base/atomic_sequence_num.h"
 #include "base/lazy_instance.h"
 #include "base/logging.h"
 #include "base/synchronization/waitable_event.h"
-#include "ipc/ipc_sync_message.h"
+#include "build/build_config.h"
 
 namespace {
 
@@ -36,15 +33,13 @@
 
 #define kSyncMessageHeaderSize 4
 
-SyncMessage::SyncMessage(
-    int32 routing_id,
-    uint32 type,
-    PriorityValue priority,
-    MessageReplyDeserializer* deserializer)
+SyncMessage::SyncMessage(int32_t routing_id,
+                         uint32_t type,
+                         PriorityValue priority,
+                         MessageReplyDeserializer* deserializer)
     : Message(routing_id, type, priority),
       deserializer_(deserializer),
-      pump_messages_event_(NULL)
-      {
+      pump_messages_event_(NULL) {
   set_sync();
   set_unblock(true);
 
diff --git a/ipc/ipc_sync_message.h b/ipc/ipc_sync_message.h
index 44d0f4f..70d6f4b2 100644
--- a/ipc/ipc_sync_message.h
+++ b/ipc/ipc_sync_message.h
@@ -5,6 +5,7 @@
 #ifndef IPC_IPC_SYNC_MESSAGE_H_
 #define IPC_IPC_SYNC_MESSAGE_H_
 
+#include <stdint.h>
 #if defined(OS_WIN)
 #include <windows.h>
 #endif
@@ -23,7 +24,9 @@
 
 class IPC_EXPORT SyncMessage : public Message {
  public:
-  SyncMessage(int32 routing_id, uint32 type, PriorityValue priority,
+  SyncMessage(int32_t routing_id,
+              uint32_t type,
+              PriorityValue priority,
               MessageReplyDeserializer* deserializer);
   ~SyncMessage() override;
 
diff --git a/ipc/ipc_test_channel_listener.h b/ipc/ipc_test_channel_listener.h
index ae5288d..75635f7d 100644
--- a/ipc/ipc_test_channel_listener.h
+++ b/ipc/ipc_test_channel_listener.h
@@ -5,6 +5,8 @@
 #ifndef IPC_IPC_TEST_CHANNEL_LISTENER_H_
 #define IPC_IPC_TEST_CHANNEL_LISTENER_H_
 
+#include <stddef.h>
+
 #include "ipc/ipc_listener.h"
 
 namespace IPC {
diff --git a/ipc/ipc_test_sink.cc b/ipc/ipc_test_sink.cc
index f0c7a5f5..ab95a19 100644
--- a/ipc/ipc_test_sink.cc
+++ b/ipc/ipc_test_sink.cc
@@ -63,7 +63,7 @@
   return &messages_[index];
 }
 
-const Message* TestSink::GetFirstMessageMatching(uint32 id) const {
+const Message* TestSink::GetFirstMessageMatching(uint32_t id) const {
   for (size_t i = 0; i < messages_.size(); i++) {
     if (messages_[i].type() == id)
       return &messages_[i];
@@ -71,7 +71,7 @@
   return NULL;
 }
 
-const Message* TestSink::GetUniqueMessageMatching(uint32 id) const {
+const Message* TestSink::GetUniqueMessageMatching(uint32_t id) const {
   size_t found_index = 0;
   size_t found_count = 0;
   for (size_t i = 0; i < messages_.size(); i++) {
diff --git a/ipc/ipc_test_sink.h b/ipc/ipc_test_sink.h
index a802686..1a11f40 100644
--- a/ipc/ipc_test_sink.h
+++ b/ipc/ipc_test_sink.h
@@ -5,6 +5,8 @@
 #ifndef IPC_IPC_TEST_SINK_H_
 #define IPC_IPC_TEST_SINK_H_
 
+#include <stdint.h>
+
 #include <utility>
 #include <vector>
 
@@ -106,14 +108,14 @@
   // Returns the first message with the given ID in the queue. If there is no
   // message with the given ID, returns NULL. The returned pointer will only be
   // valid until another message is received or the list is cleared.
-  const Message* GetFirstMessageMatching(uint32 id) const;
+  const Message* GetFirstMessageMatching(uint32_t id) const;
 
   // Returns the message with the given ID in the queue. If there is no such
   // message or there is more than one of that message, this will return NULL
   // (with the expectation that you'll do an ASSERT_TRUE() on the result).
   // The returned pointer will only be valid until another message is received
   // or the list is cleared.
-  const Message* GetUniqueMessageMatching(uint32 id) const;
+  const Message* GetUniqueMessageMatching(uint32_t id) const;
 
   // Adds the given listener as a filter to the TestSink.
   // When a message is received by the TestSink, it will be dispatched to
diff --git a/ipc/message_filter.cc b/ipc/message_filter.cc
index ffde0f0..b9436e23 100644
--- a/ipc/message_filter.cc
+++ b/ipc/message_filter.cc
@@ -15,7 +15,7 @@
 
 void MessageFilter::OnFilterRemoved() {}
 
-void MessageFilter::OnChannelConnected(int32 peer_pid) {}
+void MessageFilter::OnChannelConnected(int32_t peer_pid) {}
 
 void MessageFilter::OnChannelError() {}
 
@@ -26,7 +26,7 @@
 }
 
 bool MessageFilter::GetSupportedMessageClasses(
-    std::vector<uint32>* /*supported_message_classes*/) const {
+    std::vector<uint32_t>* /*supported_message_classes*/) const {
   return false;
 }
 
diff --git a/ipc/message_filter.h b/ipc/message_filter.h
index c9ba4e8..f70ee06 100644
--- a/ipc/message_filter.h
+++ b/ipc/message_filter.h
@@ -5,6 +5,8 @@
 #ifndef IPC_MESSAGE_FILTER_H_
 #define IPC_MESSAGE_FILTER_H_
 
+#include <stdint.h>
+
 #include <vector>
 
 #include "base/memory/ref_counted.h"
@@ -34,7 +36,7 @@
 
   // Called to inform the filter that the IPC channel is connected and we
   // have received the internal Hello message from the peer.
-  virtual void OnChannelConnected(int32 peer_pid);
+  virtual void OnChannelConnected(int32_t peer_pid);
 
   // Called when there is an error on the channel, typically that the channel
   // has been closed.
@@ -53,7 +55,7 @@
   // if the resulting contents of |supported_message_classes| may be used to
   // selectively offer messages of a particular class to the filter.
   virtual bool GetSupportedMessageClasses(
-      std::vector<uint32>* supported_message_classes) const;
+      std::vector<uint32_t>* supported_message_classes) const;
 
  protected:
   virtual ~MessageFilter();
diff --git a/ipc/message_filter_router.cc b/ipc/message_filter_router.cc
index 81e4028..35209b09 100644
--- a/ipc/message_filter_router.cc
+++ b/ipc/message_filter_router.cc
@@ -4,6 +4,8 @@
 
 #include "ipc/message_filter_router.h"
 
+#include <stdint.h>
+
 #include "ipc/ipc_message_macros.h"
 #include "ipc/ipc_message_utils.h"
 #include "ipc/message_filter.h"
@@ -45,7 +47,7 @@
 void MessageFilterRouter::AddFilter(MessageFilter* filter) {
   // Determine if the filter should be applied to all messages, or only
   // messages of a certain class.
-  std::vector<uint32> supported_message_classes;
+  std::vector<uint32_t> supported_message_classes;
   if (filter->GetSupportedMessageClasses(&supported_message_classes)) {
     DCHECK(!supported_message_classes.empty());
     for (size_t i = 0; i < supported_message_classes.size(); ++i) {
diff --git a/ipc/mojo/ipc_channel_mojo_unittest.cc b/ipc/mojo/ipc_channel_mojo_unittest.cc
index c82e0119..02bdcf1 100644
--- a/ipc/mojo/ipc_channel_mojo_unittest.cc
+++ b/ipc/mojo/ipc_channel_mojo_unittest.cc
@@ -4,6 +4,8 @@
 
 #include "ipc/mojo/ipc_channel_mojo.h"
 
+#include <stdint.h>
+
 #include "base/base_paths.h"
 #include "base/files/file.h"
 #include "base/location.h"
@@ -133,7 +135,7 @@
       : is_connected_called_(false) {
   }
 
-  void OnChannelConnected(int32 peer_pid) override {
+  void OnChannelConnected(int32_t peer_pid) override {
     IPC::TestChannelListener::OnChannelConnected(peer_pid);
     EXPECT_TRUE(base::kNullProcessId != peer_pid);
     is_connected_called_ = true;
@@ -200,7 +202,7 @@
       : has_error_(false) {
   }
 
-  void OnChannelConnected(int32 peer_pid) override {
+  void OnChannelConnected(int32_t peer_pid) override {
     base::MessageLoop::current()->Quit();
   }
 
@@ -243,7 +245,7 @@
     return true;
   }
 
-  void OnChannelConnected(int32 peer_pid) override {
+  void OnChannelConnected(int32_t peer_pid) override {
     base::MessageLoop::current()->Quit();
   }
 };
@@ -595,7 +597,7 @@
     return true;
   }
 
-  void OnChannelConnected(int32 peer_pid) override {
+  void OnChannelConnected(int32_t peer_pid) override {
     ListenerThatExpectsOK::SendOK(sender_);
     base::MessageLoop::current()->Quit();
   }
@@ -815,7 +817,7 @@
 
 class ListenerThatVerifiesPeerPid : public IPC::Listener {
  public:
-  void OnChannelConnected(int32 peer_pid) override {
+  void OnChannelConnected(int32_t peer_pid) override {
     EXPECT_EQ(peer_pid, kMagicChildId);
     base::MessageLoop::current()->Quit();
   }
diff --git a/ipc/mojo/ipc_message_pipe_reader.cc b/ipc/mojo/ipc_message_pipe_reader.cc
index 6609f26..11aab8d 100644
--- a/ipc/mojo/ipc_message_pipe_reader.cc
+++ b/ipc/mojo/ipc_message_pipe_reader.cc
@@ -4,6 +4,8 @@
 
 #include "ipc/mojo/ipc_message_pipe_reader.h"
 
+#include <stdint.h>
+
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/location.h"
@@ -77,9 +79,9 @@
   if (result == MOJO_RESULT_OK) {
     result = MojoWriteMessage(handle(),
                               message->data(),
-                              static_cast<uint32>(message->size()),
+                              static_cast<uint32_t>(message->size()),
                               handles.empty() ? nullptr : &handles[0],
-                              static_cast<uint32>(handles.size()),
+                              static_cast<uint32_t>(handles.size()),
                               MOJO_WRITE_MESSAGE_FLAG_NONE);
   }
 
@@ -98,7 +100,7 @@
 
 void MessagePipeReader::OnMessageReceived() {
   Message message(data_buffer().empty() ? "" : &data_buffer()[0],
-                  static_cast<uint32>(data_buffer().size()));
+                  static_cast<uint32_t>(data_buffer().size()));
 
   std::vector<MojoHandle> handle_buffer;
   TakeHandleBuffer(&handle_buffer);
diff --git a/ipc/mojo/ipc_mojo_bootstrap.cc b/ipc/mojo/ipc_mojo_bootstrap.cc
index 91f3940..1b13082 100644
--- a/ipc/mojo/ipc_mojo_bootstrap.cc
+++ b/ipc/mojo/ipc_mojo_bootstrap.cc
@@ -4,6 +4,8 @@
 
 #include "ipc/mojo/ipc_mojo_bootstrap.h"
 
+#include <stdint.h>
+
 #include "base/logging.h"
 #include "base/process/process_handle.h"
 #include "ipc/ipc_message_utils.h"
@@ -21,11 +23,11 @@
   MojoServerBootstrap();
 
  private:
-  void SendClientPipe(int32 peer_pid);
+  void SendClientPipe(int32_t peer_pid);
 
   // Listener implementations
   bool OnMessageReceived(const Message& message) override;
-  void OnChannelConnected(int32 peer_pid) override;
+  void OnChannelConnected(int32_t peer_pid) override;
 
   mojo::embedder::ScopedPlatformHandle server_pipe_;
   bool connected_;
@@ -36,7 +38,7 @@
 MojoServerBootstrap::MojoServerBootstrap() : connected_(false) {
 }
 
-void MojoServerBootstrap::SendClientPipe(int32 peer_pid) {
+void MojoServerBootstrap::SendClientPipe(int32_t peer_pid) {
   DCHECK_EQ(state(), STATE_INITIALIZED);
   DCHECK(connected_);
 
@@ -73,7 +75,7 @@
   set_state(STATE_WAITING_ACK);
 }
 
-void MojoServerBootstrap::OnChannelConnected(int32 peer_pid) {
+void MojoServerBootstrap::OnChannelConnected(int32_t peer_pid) {
   DCHECK_EQ(state(), STATE_INITIALIZED);
   connected_ = true;
   SendClientPipe(peer_pid);
@@ -103,7 +105,7 @@
  private:
   // Listener implementations
   bool OnMessageReceived(const Message& message) override;
-  void OnChannelConnected(int32 peer_pid) override;
+  void OnChannelConnected(int32_t peer_pid) override;
 
   DISALLOW_COPY_AND_ASSIGN(MojoClientBootstrap);
 };
@@ -136,7 +138,7 @@
   return true;
 }
 
-void MojoClientBootstrap::OnChannelConnected(int32 peer_pid) {
+void MojoClientBootstrap::OnChannelConnected(int32_t peer_pid) {
 }
 
 }  // namespace
diff --git a/ui/ozone/platform/cast/gpu_platform_support_cast.h b/ui/ozone/platform/cast/gpu_platform_support_cast.h
index 5994f84..bc56024 100644
--- a/ui/ozone/platform/cast/gpu_platform_support_cast.h
+++ b/ui/ozone/platform/cast/gpu_platform_support_cast.h
@@ -5,6 +5,7 @@
 #ifndef UI_OZONE_PLATFORM_CAST_GPU_PLATFORM_SUPPORT_CAST_H_
 #define UI_OZONE_PLATFORM_CAST_GPU_PLATFORM_SUPPORT_CAST_H_
 
+#include "base/macros.h"
 #include "ui/ozone/public/gpu_platform_support.h"
 
 namespace ui {