"typedef Foo Bar" -> "using Bar = Foo" in //mojo/edk/....
The latter is now standard, and to be consistent (with new things I'll
add), I guess I should convert everything.
R=jamesr@chromium.org
Review URL: https://codereview.chromium.org/1154903003
diff --git a/mojo/edk/embedder/embedder.h b/mojo/edk/embedder/embedder.h
index 50ec184..2e43475 100644
--- a/mojo/edk/embedder/embedder.h
+++ b/mojo/edk/embedder/embedder.h
@@ -23,7 +23,7 @@
struct Configuration;
class PlatformSupport;
class ProcessDelegate;
-typedef void* SlaveInfo;
+using SlaveInfo = void*;
// Basic configuration/initialization ------------------------------------------
@@ -191,7 +191,7 @@
CreateChannelOnIOThread(ScopedPlatformHandle platform_handle,
ChannelInfo** channel_info);
-typedef base::Callback<void(ChannelInfo*)> DidCreateChannelCallback;
+using DidCreateChannelCallback = base::Callback<void(ChannelInfo*)>;
// Creates a channel asynchronously; may be called from any thread.
// |platform_handle| should be a handle to a connected OS "pipe".
// |io_thread_task_runner| should be the |TaskRunner| for the I/O thread.
@@ -214,7 +214,7 @@
MOJO_SYSTEM_IMPL_EXPORT void DestroyChannelOnIOThread(
ChannelInfo* channel_info);
-typedef base::Closure DidDestroyChannelCallback;
+using DidDestroyChannelCallback = base::Closure;
// Like |DestroyChannelOnIOThread()|, but asynchronous and may be called from
// any thread. The callback will be called using |callback_thread_task_runner|
// if that is non-null, or otherwise it will be called on the "channel thread".
diff --git a/mojo/edk/embedder/embedder_internal.h b/mojo/edk/embedder/embedder_internal.h
index 833e66b..752d366 100644
--- a/mojo/edk/embedder/embedder_internal.h
+++ b/mojo/edk/embedder/embedder_internal.h
@@ -24,8 +24,8 @@
class ChannelManager;
class Core;
-// Repeat a typedef in mojo/edk/system/channel_manager.h, to avoid including it.
-typedef uint64_t ChannelId;
+// Duplicate from mojo/edk/system/channel_manager.h, to avoid including it.
+using ChannelId = uint64_t;
} // namespace system
diff --git a/mojo/edk/embedder/master_process_delegate.h b/mojo/edk/embedder/master_process_delegate.h
index bc3c909..22ac435 100644
--- a/mojo/edk/embedder/master_process_delegate.h
+++ b/mojo/edk/embedder/master_process_delegate.h
@@ -13,7 +13,7 @@
namespace mojo {
namespace embedder {
-typedef void* SlaveInfo;
+using SlaveInfo = void*;
// An interface for the master process delegate (which lives in the master
// process).
diff --git a/mojo/edk/embedder/platform_channel_pair.h b/mojo/edk/embedder/platform_channel_pair.h
index d77c100..ff8aabd 100644
--- a/mojo/edk/embedder/platform_channel_pair.h
+++ b/mojo/edk/embedder/platform_channel_pair.h
@@ -22,9 +22,9 @@
// It would be nice to refactor base/process/launch.h to have a more platform-
// independent way of representing handles that are passed to child processes.
#if defined(OS_WIN)
-typedef base::HandlesToInheritVector HandlePassingInformation;
+using HandlePassingInformation = base::HandlesToInheritVector;
#elif defined(OS_POSIX)
-typedef base::FileHandleMappingVector HandlePassingInformation;
+using HandlePassingInformation = base::FileHandleMappingVector;
#else
#error "Unsupported."
#endif
diff --git a/mojo/edk/embedder/platform_handle_vector.h b/mojo/edk/embedder/platform_handle_vector.h
index 96356b7..771df4f 100644
--- a/mojo/edk/embedder/platform_handle_vector.h
+++ b/mojo/edk/embedder/platform_handle_vector.h
@@ -15,7 +15,7 @@
namespace mojo {
namespace embedder {
-typedef std::vector<PlatformHandle> PlatformHandleVector;
+using PlatformHandleVector = std::vector<PlatformHandle>;
// A deleter (for use with |scoped_ptr|) which closes all handles and then
// |delete|s the |PlatformHandleVector|.
@@ -26,8 +26,8 @@
}
};
-typedef scoped_ptr<PlatformHandleVector, PlatformHandleVectorDeleter>
- ScopedPlatformHandleVectorPtr;
+using ScopedPlatformHandleVectorPtr =
+ scoped_ptr<PlatformHandleVector, PlatformHandleVectorDeleter>;
} // namespace embedder
} // namespace mojo
diff --git a/mojo/edk/js/drain_data.h b/mojo/edk/js/drain_data.h
index 48f1de2..3c066dc 100644
--- a/mojo/edk/js/drain_data.h
+++ b/mojo/edk/js/drain_data.h
@@ -48,7 +48,7 @@
// all of the buffered data to the JS Promise and then delete this.
void DeliverData(MojoResult result);
- typedef std::vector<char> DataBuffer;
+ using DataBuffer = std::vector<char>;
v8::Isolate* isolate_;
ScopedDataPipeConsumerHandle handle_;
diff --git a/mojo/edk/system/async_waiter.h b/mojo/edk/system/async_waiter.h
index df3b482..be228e5 100644
--- a/mojo/edk/system/async_waiter.h
+++ b/mojo/edk/system/async_waiter.h
@@ -17,7 +17,7 @@
// An |Awakable| implementation that just calls a given callback object.
class MOJO_SYSTEM_IMPL_EXPORT AsyncWaiter final : public Awakable {
public:
- typedef base::Callback<void(MojoResult)> AwakeCallback;
+ using AwakeCallback = base::Callback<void(MojoResult)>;
// |callback| must satisfy the same contract as |Awakable::Awake()|.
explicit AsyncWaiter(const AwakeCallback& callback);
diff --git a/mojo/edk/system/awakable_list.h b/mojo/edk/system/awakable_list.h
index 19c03c8..2d8101e 100644
--- a/mojo/edk/system/awakable_list.h
+++ b/mojo/edk/system/awakable_list.h
@@ -45,7 +45,7 @@
MojoHandleSignals signals;
uint32_t context;
};
- typedef std::list<AwakeInfo> AwakeInfoList;
+ using AwakeInfoList = std::list<AwakeInfo>;
AwakeInfoList awakables_;
diff --git a/mojo/edk/system/channel.h b/mojo/edk/system/channel.h
index 93ba87a..a22d506 100644
--- a/mojo/edk/system/channel.h
+++ b/mojo/edk/system/channel.h
@@ -235,16 +235,16 @@
// Has a reference to us.
ChannelManager* channel_manager_;
- typedef base::hash_map<ChannelEndpointId, scoped_refptr<ChannelEndpoint>>
- IdToEndpointMap;
+ using IdToEndpointMap =
+ base::hash_map<ChannelEndpointId, scoped_refptr<ChannelEndpoint>>;
// Map from local IDs to endpoints. If the endpoint is null, this means that
// we're just waiting for the remove ack before removing the entry.
IdToEndpointMap local_id_to_endpoint_map_;
// Note: The IDs generated by this should be checked for existence before use.
LocalChannelEndpointIdGenerator local_id_generator_;
- typedef base::hash_map<ChannelEndpointId, scoped_refptr<IncomingEndpoint>>
- IdToIncomingEndpointMap;
+ using IdToIncomingEndpointMap =
+ base::hash_map<ChannelEndpointId, scoped_refptr<IncomingEndpoint>>;
// Map from local IDs to incoming endpoints (i.e., those received inside other
// messages, but not yet claimed via |DeserializeEndpoint()|).
IdToIncomingEndpointMap incoming_endpoints_;
diff --git a/mojo/edk/system/channel_manager.h b/mojo/edk/system/channel_manager.h
index 77ff953..19c3b42 100644
--- a/mojo/edk/system/channel_manager.h
+++ b/mojo/edk/system/channel_manager.h
@@ -34,7 +34,7 @@
// IDs for |Channel|s managed by a |ChannelManager|. (IDs should be thought of
// as specific to a given |ChannelManager|.) 0 is never a valid ID.
-typedef uint64_t ChannelId;
+using ChannelId = uint64_t;
const ChannelId kInvalidChannelId = 0;
diff --git a/mojo/edk/system/connection_manager.h b/mojo/edk/system/connection_manager.h
index 8820dd5..bc2769f 100644
--- a/mojo/edk/system/connection_manager.h
+++ b/mojo/edk/system/connection_manager.h
@@ -20,10 +20,10 @@
// (Temporary, unique) identifiers for connections, used as they are being
// brought up:
-typedef UniqueIdentifier ConnectionIdentifier;
+using ConnectionIdentifier = UniqueIdentifier;
// Identifiers for processes (note that these are not OS process IDs):
-typedef uint64_t ProcessIdentifier;
+using ProcessIdentifier = uint64_t;
const ProcessIdentifier kInvalidProcessIdentifier = 0;
// |ConnectionManager| is an interface for the system that allows "connections"
diff --git a/mojo/edk/system/core_test_base.h b/mojo/edk/system/core_test_base.h
index 26b7925..3eb2364 100644
--- a/mojo/edk/system/core_test_base.h
+++ b/mojo/edk/system/core_test_base.h
@@ -23,7 +23,7 @@
class CoreTestBase : public testing::Test {
public:
- typedef CoreTestBase_MockHandleInfo MockHandleInfo;
+ using MockHandleInfo = CoreTestBase_MockHandleInfo;
CoreTestBase();
~CoreTestBase() override;
diff --git a/mojo/edk/system/core_unittest.cc b/mojo/edk/system/core_unittest.cc
index b789301..c562097 100644
--- a/mojo/edk/system/core_unittest.cc
+++ b/mojo/edk/system/core_unittest.cc
@@ -24,7 +24,7 @@
MOJO_HANDLE_SIGNAL_WRITABLE |
MOJO_HANDLE_SIGNAL_PEER_CLOSED;
-typedef test::CoreTestBase CoreTest;
+using CoreTest = test::CoreTestBase;
TEST_F(CoreTest, GetTimeTicksNow) {
const MojoTimeTicks start = core()->GetTimeTicksNow();
diff --git a/mojo/edk/system/data_pipe_impl_unittest.cc b/mojo/edk/system/data_pipe_impl_unittest.cc
index 17021f3..3a77488 100644
--- a/mojo/edk/system/data_pipe_impl_unittest.cc
+++ b/mojo/edk/system/data_pipe_impl_unittest.cc
@@ -549,11 +549,11 @@
// Test case instantiation -----------------------------------------------------
-typedef testing::Types<LocalDataPipeImplTestHelper,
- RemoteProducerDataPipeImplTestHelper,
- RemoteConsumerDataPipeImplTestHelper,
- RemoteProducerDataPipeImplTestHelper2,
- RemoteConsumerDataPipeImplTestHelper2> HelperTypes;
+using HelperTypes = testing::Types<LocalDataPipeImplTestHelper,
+ RemoteProducerDataPipeImplTestHelper,
+ RemoteConsumerDataPipeImplTestHelper,
+ RemoteProducerDataPipeImplTestHelper2,
+ RemoteConsumerDataPipeImplTestHelper2>;
TYPED_TEST_CASE(DataPipeImplTest, HelperTypes);
diff --git a/mojo/edk/system/dispatcher.h b/mojo/edk/system/dispatcher.h
index 4bbc5ed..8d7e1cb 100644
--- a/mojo/edk/system/dispatcher.h
+++ b/mojo/edk/system/dispatcher.h
@@ -41,7 +41,7 @@
class TransportData;
class Awakable;
-typedef std::vector<scoped_refptr<Dispatcher>> DispatcherVector;
+using DispatcherVector = std::vector<scoped_refptr<Dispatcher>>;
namespace test {
diff --git a/mojo/edk/system/handle_table.h b/mojo/edk/system/handle_table.h
index 9385643..64ad183 100644
--- a/mojo/edk/system/handle_table.h
+++ b/mojo/edk/system/handle_table.h
@@ -21,7 +21,7 @@
class Dispatcher;
class DispatcherTransport;
-typedef std::vector<scoped_refptr<Dispatcher>> DispatcherVector;
+using DispatcherVector = std::vector<scoped_refptr<Dispatcher>>;
// Test-only function (defined/used in embedder/test_embedder.cc). Declared here
// so it can be friended.
@@ -126,7 +126,7 @@
scoped_refptr<Dispatcher> dispatcher;
bool busy;
};
- typedef base::hash_map<MojoHandle, Entry> HandleToEntryMap;
+ using HandleToEntryMap = base::hash_map<MojoHandle, Entry>;
// Adds the given dispatcher to the handle table, not doing any size checks.
MojoHandle AddDispatcherNoSizeCheck(
diff --git a/mojo/edk/system/mapping_table.h b/mojo/edk/system/mapping_table.h
index d2812d8..ed1732d 100644
--- a/mojo/edk/system/mapping_table.h
+++ b/mojo/edk/system/mapping_table.h
@@ -49,8 +49,8 @@
private:
friend bool internal::ShutdownCheckNoLeaks(Core*);
- typedef base::hash_map<uintptr_t, embedder::PlatformSharedBufferMapping*>
- AddressToMappingMap;
+ using AddressToMappingMap =
+ base::hash_map<uintptr_t, embedder::PlatformSharedBufferMapping*>;
AddressToMappingMap address_to_mapping_map_;
DISALLOW_COPY_AND_ASSIGN(MappingTable);
diff --git a/mojo/edk/system/master_connection_manager.h b/mojo/edk/system/master_connection_manager.h
index 3210361..d7f06b5 100644
--- a/mojo/edk/system/master_connection_manager.h
+++ b/mojo/edk/system/master_connection_manager.h
@@ -25,7 +25,7 @@
namespace embedder {
class MasterProcessDelegate;
-typedef void* SlaveInfo;
+using SlaveInfo = void*;
}
namespace system {
diff --git a/mojo/edk/system/memory.h b/mojo/edk/system/memory.h
index 96cf219..2f1bde4 100644
--- a/mojo/edk/system/memory.h
+++ b/mojo/edk/system/memory.h
@@ -23,25 +23,25 @@
// TODO(vtl): Remove these once we have the C++11 |remove_const|.
template <typename T>
struct remove_const {
- typedef T type;
+ using type = T;
};
template <typename T>
struct remove_const<const T> {
- typedef T type;
+ using type = T;
};
// Yields |(const) char| if |T| is |(const) void|, else |T|:
template <typename T>
struct VoidToChar {
- typedef T type;
+ using type = T;
};
template <>
struct VoidToChar<void> {
- typedef char type;
+ using type = char;
};
template <>
struct VoidToChar<const void> {
- typedef const char type;
+ using type = const char;
};
// Checks (insofar as appropriate/possible) that |pointer| is a valid pointer to
@@ -84,7 +84,7 @@
template <typename Type>
class UserPointer {
private:
- typedef typename internal::VoidToChar<Type>::type NonVoidType;
+ using NonVoidType = typename internal::VoidToChar<Type>::type;
public:
// Instead of explicitly using these constructors, you can often use
@@ -243,9 +243,9 @@
//
// TODO(vtl): Possibly, since we're not really being safe, we should just not
// copy for Release builds.
- typedef UserPointerReader<Type> Reader;
- typedef UserPointerWriter<Type> Writer;
- typedef UserPointerReaderWriter<Type> ReaderWriter;
+ using Reader = UserPointerReader<Type>;
+ using Writer = UserPointerWriter<Type>;
+ using ReaderWriter = UserPointerReaderWriter<Type>;
private:
friend class UserPointerReader<Type>;
@@ -269,7 +269,7 @@
template <typename Type>
class UserPointerReader {
private:
- typedef typename internal::remove_const<Type>::type TypeNoConst;
+ using TypeNoConst = typename internal::remove_const<Type>::type;
public:
// Note: If |count| is zero, |GetPointer()| will always return null.
diff --git a/mojo/edk/system/message_in_transit.h b/mojo/edk/system/message_in_transit.h
index 038a292..3ade44b 100644
--- a/mojo/edk/system/message_in_transit.h
+++ b/mojo/edk/system/message_in_transit.h
@@ -43,7 +43,7 @@
// buffer.
class MOJO_SYSTEM_IMPL_EXPORT MessageInTransit {
public:
- typedef uint16_t Type;
+ using Type = uint16_t;
// Messages that are forwarded to endpoint clients.
static const Type kTypeEndpointClient = 0;
// Messages that are consumed by the |ChannelEndpoint|.
@@ -58,7 +58,7 @@
// Messages sent by a |MasterConnectionManager| (all responses).
static const Type kTypeConnectionManagerAck = 5;
- typedef uint16_t Subtype;
+ using Subtype = uint16_t;
// Subtypes for type |kTypeEndpointClient|:
// Message pipe or data pipe data (etc.).
static const Subtype kSubtypeEndpointClientData = 0;
diff --git a/mojo/edk/system/options_validation_unittest.cc b/mojo/edk/system/options_validation_unittest.cc
index 89c4e60..298355c 100644
--- a/mojo/edk/system/options_validation_unittest.cc
+++ b/mojo/edk/system/options_validation_unittest.cc
@@ -16,7 +16,7 @@
// Declare a test options struct just as we do in actual public headers.
-typedef uint32_t TestOptionsFlags;
+using TestOptionsFlags = uint32_t;
static_assert(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
struct MOJO_ALIGNAS(8) TestOptions {
diff --git a/mojo/edk/system/raw_channel_win.cc b/mojo/edk/system/raw_channel_win.cc
index a422c9e..cd9bfdf 100644
--- a/mojo/edk/system/raw_channel_win.cc
+++ b/mojo/edk/system/raw_channel_win.cc
@@ -40,8 +40,8 @@
}
private:
- typedef BOOL(WINAPI* SetFileCompletionNotificationModesFunc)(HANDLE, UCHAR);
- typedef BOOL(WINAPI* CancelIoExFunc)(HANDLE, LPOVERLAPPED);
+ using SetFileCompletionNotificationModesFunc = BOOL(WINAPI*)(HANDLE, UCHAR);
+ using CancelIoExFunc = BOOL(WINAPI*)(HANDLE, LPOVERLAPPED);
bool is_vista_or_higher_;
SetFileCompletionNotificationModesFunc
diff --git a/mojo/edk/test/multiprocess_test_helper_unittest.cc b/mojo/edk/test/multiprocess_test_helper_unittest.cc
index 93496fb..4fe170c 100644
--- a/mojo/edk/test/multiprocess_test_helper_unittest.cc
+++ b/mojo/edk/test/multiprocess_test_helper_unittest.cc
@@ -40,7 +40,7 @@
return bytes_read == 1;
}
-typedef testing::Test MultiprocessTestHelperTest;
+using MultiprocessTestHelperTest = testing::Test;
#if defined(OS_ANDROID)
// Android multi-process tests are not executing the new process. This is flaky.