| Index: ppapi/proxy/serialized_structs.cc
|
| ===================================================================
|
| --- ppapi/proxy/serialized_structs.cc (revision 171259)
|
| +++ ppapi/proxy/serialized_structs.cc (working copy)
|
| @@ -107,17 +107,10 @@
|
| }
|
|
|
| bool SerializedHandle::IsHandleValid() const {
|
| - switch (type_) {
|
| - case SHARED_MEMORY:
|
| - return base::SharedMemory::IsHandleValid(shm_handle_);
|
| - case SOCKET:
|
| - case CHANNEL_HANDLE:
|
| - case FILE:
|
| - return !(IPC::InvalidPlatformFileForTransit() == descriptor_);
|
| - case INVALID:
|
| - return false;
|
| - // No default so the compiler will warn us if a new type is added.
|
| - }
|
| + if (type_ == SHARED_MEMORY)
|
| + return base::SharedMemory::IsHandleValid(shm_handle_);
|
| + else if (type_ == SOCKET || type_ == CHANNEL_HANDLE)
|
| + return !(IPC::InvalidPlatformFileForTransit() == descriptor_);
|
| return false;
|
| }
|
|
|
| @@ -132,7 +125,6 @@
|
| break;
|
| case SOCKET:
|
| case CHANNEL_HANDLE:
|
| - case FILE:
|
| base::PlatformFile file =
|
| IPC::PlatformFileForTransitToPlatformFile(descriptor_);
|
| #if !defined(OS_NACL)
|
| @@ -176,7 +168,6 @@
|
| }
|
| case SOCKET:
|
| case CHANNEL_HANDLE:
|
| - case FILE:
|
| case INVALID:
|
| valid_type = true;
|
| break;
|
|
|