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 17 matching lines...) Expand all Loading... |
28 #if defined(OS_POSIX) | 28 #if defined(OS_POSIX) |
29 , renderer_fd_(-1) | 29 , renderer_fd_(-1) |
30 #endif | 30 #endif |
31 { | 31 { |
32 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 32 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
33 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); | 33 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); |
34 } | 34 } |
35 | 35 |
36 GpuChannel::~GpuChannel() { | 36 GpuChannel::~GpuChannel() { |
37 #if defined(OS_POSIX) | 37 #if defined(OS_POSIX) |
| 38 IPC::RemoveAndCloseChannelSocket(GetChannelName()); |
| 39 |
38 // If we still have the renderer FD, close it. | 40 // If we still have the renderer FD, close it. |
39 if (renderer_fd_ != -1) { | 41 if (renderer_fd_ != -1) { |
40 close(renderer_fd_); | 42 close(renderer_fd_); |
41 } | 43 } |
42 #endif | 44 #endif |
43 } | 45 } |
44 | 46 |
45 void GpuChannel::OnChannelConnected(int32 peer_pid) { | 47 void GpuChannel::OnChannelConnected(int32 peer_pid) { |
46 if (!renderer_process_.Open(peer_pid)) { | 48 if (!renderer_process_.Open(peer_pid)) { |
47 NOTREACHED(); | 49 NOTREACHED(); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 channel_name, IPC::Channel::MODE_SERVER, this, NULL, | 244 channel_name, IPC::Channel::MODE_SERVER, this, NULL, |
243 ChildProcess::current()->io_message_loop(), false, | 245 ChildProcess::current()->io_message_loop(), false, |
244 ChildProcess::current()->GetShutDownEvent())); | 246 ChildProcess::current()->GetShutDownEvent())); |
245 | 247 |
246 return true; | 248 return true; |
247 } | 249 } |
248 | 250 |
249 std::string GpuChannel::GetChannelName() { | 251 std::string GpuChannel::GetChannelName() { |
250 return StringPrintf("%d.r%d", base::GetCurrentProcId(), renderer_id_); | 252 return StringPrintf("%d.r%d", base::GetCurrentProcId(), renderer_id_); |
251 } | 253 } |
OLD | NEW |