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

Unified Diff: content/common/gpu/gpu_channel_manager.cc

Issue 621613002: Refactoring: Make IPC::Channel::TakeClientFileDescriptor() a ScopedFD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing Mac build Created 6 years, 2 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: content/common/gpu/gpu_channel_manager.cc
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index b1ddad005fe1bece6ab5672aa6ac90acfc25d306..9a8a0f4f8f08976b70d0e80b356fa08a34abde1e 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -197,9 +197,9 @@ void GpuChannelManager::OnEstablishChannel(int client_id,
#if defined(OS_POSIX)
// On POSIX, pass the renderer-side FD. Also mark it as auto-close so
// that it gets closed after it has been sent.
- int renderer_fd = channel->TakeRendererFileDescriptor();
- DCHECK_NE(-1, renderer_fd);
- channel_handle.socket = base::FileDescriptor(renderer_fd, true);
+ base::ScopedFD renderer_fd = channel->TakeRendererFileDescriptor();
+ DCHECK(renderer_fd.is_valid());
+ channel_handle.socket = base::FileDescriptor(renderer_fd.Pass());
#endif
gpu_channels_.set(client_id, channel.Pass());

Powered by Google App Engine
This is Rietveld 408576698