| Index: ipc/ipc_platform_file.cc
|
| diff --git a/ipc/ipc_platform_file.cc b/ipc/ipc_platform_file.cc
|
| index dbcfddcc779e69ff8fab92b1523c1551ada522e9..db5f8e523463731a1c0d03c0a40bdba271d73bb9 100644
|
| --- a/ipc/ipc_platform_file.cc
|
| +++ b/ipc/ipc_platform_file.cc
|
| @@ -11,6 +11,32 @@
|
|
|
| namespace IPC {
|
|
|
| +#if defined(OS_WIN)
|
| +PlatformFileForTransit::PlatformFileForTransit() : handle_(nullptr) {}
|
| +
|
| +PlatformFileForTransit::PlatformFileForTransit(HANDLE handle)
|
| + : handle_(handle) {}
|
| +
|
| +bool PlatformFileForTransit::operator==(
|
| + const PlatformFileForTransit& platform_file) const {
|
| + return handle_ == platform_file.handle_;
|
| +}
|
| +
|
| +bool PlatformFileForTransit::operator!=(
|
| + const PlatformFileForTransit& platform_file) const {
|
| + return !(*this == platform_file);
|
| +}
|
| +
|
| +HANDLE PlatformFileForTransit::GetHandle() const {
|
| + return handle_;
|
| +}
|
| +
|
| +bool PlatformFileForTransit::IsValid() const {
|
| + return handle_ != nullptr;
|
| +}
|
| +
|
| +#endif // defined(OS_WIN)
|
| +
|
| PlatformFileForTransit GetPlatformFileForTransit(base::PlatformFile handle,
|
| bool close_source_handle) {
|
| #if defined(OS_WIN)
|
| @@ -24,10 +50,7 @@ PlatformFileForTransit GetPlatformFileForTransit(base::PlatformFile handle,
|
| return IPC::InvalidPlatformFileForTransit();
|
| }
|
|
|
| - IPC::PlatformFileForTransit out_handle = IPC::PlatformFileForTransit(
|
| - raw_handle, base::GetCurrentProcId());
|
| - out_handle.SetOwnershipPassesToIPC(true);
|
| - return out_handle;
|
| + return IPC::PlatformFileForTransit(raw_handle);
|
| #elif defined(OS_POSIX)
|
| // If asked to close the source, we can simply re-use the source fd instead of
|
| // dup()ing and close()ing.
|
|
|