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

Unified Diff: mojo/edk/system/dispatcher.cc

Issue 1160203002: Make Dispatcher::Type an enum class. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: mojo/edk/system/dispatcher.cc
diff --git a/mojo/edk/system/dispatcher.cc b/mojo/edk/system/dispatcher.cc
index e8695e8eff1a71f567253986a74fb707cb714768..24f2c264a24a5e41f380e9724f1492655d550a80 100644
--- a/mojo/edk/system/dispatcher.cc
+++ b/mojo/edk/system/dispatcher.cc
@@ -71,23 +71,23 @@ scoped_refptr<Dispatcher> Dispatcher::TransportDataAccess::Deserialize(
const void* source,
size_t size,
embedder::PlatformHandleVector* platform_handles) {
- switch (static_cast<int32_t>(type)) {
- case kTypeUnknown:
+ switch (static_cast<Dispatcher::Type>(type)) {
+ case Type::UNKNOWN:
DVLOG(2) << "Deserializing invalid handle";
return nullptr;
- case kTypeMessagePipe:
+ case Type::MESSAGE_PIPE:
return scoped_refptr<Dispatcher>(
MessagePipeDispatcher::Deserialize(channel, source, size));
- case kTypeDataPipeProducer:
+ case Type::DATA_PIPE_PRODUCER:
return scoped_refptr<Dispatcher>(
DataPipeProducerDispatcher::Deserialize(channel, source, size));
- case kTypeDataPipeConsumer:
+ case Type::DATA_PIPE_CONSUMER:
return scoped_refptr<Dispatcher>(
DataPipeConsumerDispatcher::Deserialize(channel, source, size));
- case kTypeSharedBuffer:
+ case Type::SHARED_BUFFER:
return scoped_refptr<Dispatcher>(SharedBufferDispatcher::Deserialize(
channel, source, size, platform_handles));
- case kTypePlatformHandle:
+ case Type::PLATFORM_HANDLE:
return scoped_refptr<Dispatcher>(PlatformHandleDispatcher::Deserialize(
channel, source, size, platform_handles));
}

Powered by Google App Engine
This is Rietveld 408576698