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

Side by Side Diff: chrome/gpu/gpu_channel.cc

Issue 4979005: Gpu: Unregister channel name in the gpu process when a channel closes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698