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 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lock.h" | 8 #include "base/lock.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 #if defined(ENABLE_GPU) | 170 #if defined(ENABLE_GPU) |
171 StubMap::iterator it = stubs_.find(route_id); | 171 StubMap::iterator it = stubs_.find(route_id); |
172 DCHECK(it != stubs_.end()); | 172 DCHECK(it != stubs_.end()); |
173 stubs_.erase(it); | 173 stubs_.erase(it); |
174 router_.RemoveRoute(route_id); | 174 router_.RemoveRoute(route_id); |
175 #endif | 175 #endif |
176 } | 176 } |
177 | 177 |
178 bool GpuChannel::Init(const std::string& channel_name) { | 178 bool GpuChannel::Init(const std::string& channel_name) { |
179 channel_name_ = channel_name; | 179 channel_name_ = channel_name; |
| 180 #if defined(OS_POSIX) |
| 181 // This gets called when the GpuChannel is initially created. At this |
| 182 // point, create the socketpair and assign the GPU side FD to the channel |
| 183 // name. Keep the renderer side FD as a member variable in the PluginChannel |
| 184 // to be able to transmit it through IPC. |
| 185 int gpu_fd; |
| 186 IPC::SocketPair(&gpu_fd, &renderer_fd_); |
| 187 IPC::AddChannelSocket(channel_name, gpu_fd); |
| 188 #endif |
180 channel_.reset(new IPC::SyncChannel( | 189 channel_.reset(new IPC::SyncChannel( |
181 channel_name, IPC::Channel::MODE_SERVER, this, NULL, | 190 channel_name, IPC::Channel::MODE_SERVER, this, NULL, |
182 ChildProcess::current()->io_message_loop(), false, | 191 ChildProcess::current()->io_message_loop(), false, |
183 ChildProcess::current()->GetShutDownEvent())); | 192 ChildProcess::current()->GetShutDownEvent())); |
184 return true; | 193 return true; |
185 } | 194 } |
OLD | NEW |