| Index: ppapi/proxy/serialized_structs.cc
|
| diff --git a/ppapi/proxy/serialized_structs.cc b/ppapi/proxy/serialized_structs.cc
|
| index f83ae0b95c67e92ac42493c5fbd713235276e34c..2ddf32599424f354f8bf3ed79c7b6cc348928c25 100644
|
| --- a/ppapi/proxy/serialized_structs.cc
|
| +++ b/ppapi/proxy/serialized_structs.cc
|
| @@ -107,10 +107,17 @@ SerializedHandle::SerializedHandle(
|
| }
|
|
|
| bool SerializedHandle::IsHandleValid() const {
|
| - if (type_ == SHARED_MEMORY)
|
| - return base::SharedMemory::IsHandleValid(shm_handle_);
|
| - else if (type_ == SOCKET || type_ == CHANNEL_HANDLE)
|
| - return !(IPC::InvalidPlatformFileForTransit() == descriptor_);
|
| + 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.
|
| + }
|
| return false;
|
| }
|
|
|
| @@ -125,6 +132,7 @@ void SerializedHandle::Close() {
|
| break;
|
| case SOCKET:
|
| case CHANNEL_HANDLE:
|
| + case FILE:
|
| base::PlatformFile file =
|
| IPC::PlatformFileForTransitToPlatformFile(descriptor_);
|
| #if !defined(OS_NACL)
|
| @@ -168,6 +176,7 @@ bool SerializedHandle::ReadHeader(PickleIterator* iter, Header* hdr) {
|
| }
|
| case SOCKET:
|
| case CHANNEL_HANDLE:
|
| + case FILE:
|
| case INVALID:
|
| valid_type = true;
|
| break;
|
|
|