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

Unified Diff: ppapi/proxy/serialized_structs.cc

Issue 11437038: Revert 171408 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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
« no previous file with comments | « ppapi/proxy/serialized_structs.h ('k') | ppapi/shared_impl/file_path.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/serialized_structs.cc
diff --git a/ppapi/proxy/serialized_structs.cc b/ppapi/proxy/serialized_structs.cc
index 2ddf32599424f354f8bf3ed79c7b6cc348928c25..f83ae0b95c67e92ac42493c5fbd713235276e34c 100644
--- a/ppapi/proxy/serialized_structs.cc
+++ b/ppapi/proxy/serialized_structs.cc
@@ -107,17 +107,10 @@ SerializedHandle::SerializedHandle(
}
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 @@ void SerializedHandle::Close() {
break;
case SOCKET:
case CHANNEL_HANDLE:
- case FILE:
base::PlatformFile file =
IPC::PlatformFileForTransitToPlatformFile(descriptor_);
#if !defined(OS_NACL)
@@ -176,7 +168,6 @@ bool SerializedHandle::ReadHeader(PickleIterator* iter, Header* hdr) {
}
case SOCKET:
case CHANNEL_HANDLE:
- case FILE:
case INVALID:
valid_type = true;
break;
« no previous file with comments | « ppapi/proxy/serialized_structs.h ('k') | ppapi/shared_impl/file_path.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698