OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/gpu/gpu_channel.h" | 5 #include "chrome/gpu/gpu_channel.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 #if defined(OS_POSIX) | 248 #if defined(OS_POSIX) |
249 // This gets called when the GpuChannel is initially created. At this | 249 // This gets called when the GpuChannel is initially created. At this |
250 // point, create the socketpair and assign the GPU side FD to the channel | 250 // point, create the socketpair and assign the GPU side FD to the channel |
251 // name. Keep the renderer side FD as a member variable in the PluginChannel | 251 // name. Keep the renderer side FD as a member variable in the PluginChannel |
252 // to be able to transmit it through IPC. | 252 // to be able to transmit it through IPC. |
253 int gpu_fd; | 253 int gpu_fd; |
254 IPC::SocketPair(&gpu_fd, &renderer_fd_); | 254 IPC::SocketPair(&gpu_fd, &renderer_fd_); |
255 IPC::AddChannelSocket(channel_name, gpu_fd); | 255 IPC::AddChannelSocket(channel_name, gpu_fd); |
256 #endif | 256 #endif |
257 channel_.reset(new IPC::SyncChannel( | 257 channel_.reset(new IPC::SyncChannel( |
258 channel_name, IPC::Channel::MODE_SERVER, this, NULL, | 258 channel_name, IPC::Channel::MODE_SERVER, this, |
259 ChildProcess::current()->io_message_loop(), false, | 259 ChildProcess::current()->io_message_loop(), false, |
260 ChildProcess::current()->GetShutDownEvent())); | 260 ChildProcess::current()->GetShutDownEvent())); |
261 | 261 |
262 return true; | 262 return true; |
263 } | 263 } |
264 | 264 |
265 std::string GpuChannel::GetChannelName() { | 265 std::string GpuChannel::GetChannelName() { |
266 return StringPrintf("%d.r%d", base::GetCurrentProcId(), renderer_id_); | 266 return StringPrintf("%d.r%d", base::GetCurrentProcId(), renderer_id_); |
267 } | 267 } |
OLD | NEW |