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

Side by Side Diff: content/common/gpu/gpu_channel_manager.cc

Issue 7870008: Wait properly for renderer crashes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/common/gpu/gpu_channel_manager.h" 5 #include "content/common/gpu/gpu_channel_manager.h"
6 6
7 #include "content/common/child_thread.h" 7 #include "content/common/child_thread.h"
8 #include "content/common/gpu/gpu_channel.h" 8 #include "content/common/gpu/gpu_channel.h"
9 #include "content/common/gpu/gpu_messages.h" 9 #include "content/common/gpu/gpu_messages.h"
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (channel->Init(io_message_loop_, shutdown_event_)) 95 if (channel->Init(io_message_loop_, shutdown_event_))
96 gpu_channels_[renderer_id] = channel; 96 gpu_channels_[renderer_id] = channel;
97 else 97 else
98 channel = NULL; 98 channel = NULL;
99 99
100 if (channel.get()) { 100 if (channel.get()) {
101 channel_handle.name = channel->GetChannelName(); 101 channel_handle.name = channel->GetChannelName();
102 #if defined(OS_POSIX) 102 #if defined(OS_POSIX)
103 // On POSIX, pass the renderer-side FD. Also mark it as auto-close so 103 // On POSIX, pass the renderer-side FD. Also mark it as auto-close so
104 // that it gets closed after it has been sent. 104 // that it gets closed after it has been sent.
105 int renderer_fd = channel->GetRendererFileDescriptor(); 105 int renderer_fd = channel->TakeRendererFileDescriptor();
106 DCHECK_NE(-1, renderer_fd); 106 DCHECK_NE(-1, renderer_fd);
107 channel_handle.socket = base::FileDescriptor(dup(renderer_fd), true); 107 channel_handle.socket = base::FileDescriptor(renderer_fd, true);
108 #endif 108 #endif
109 } 109 }
110 110
111 Send(new GpuHostMsg_ChannelEstablished(channel_handle)); 111 Send(new GpuHostMsg_ChannelEstablished(channel_handle));
112 } 112 }
113 113
114 void GpuChannelManager::OnCloseChannel( 114 void GpuChannelManager::OnCloseChannel(
115 const IPC::ChannelHandle& channel_handle) { 115 const IPC::ChannelHandle& channel_handle) {
116 for (GpuChannelMap::iterator iter = gpu_channels_.begin(); 116 for (GpuChannelMap::iterator iter = gpu_channels_.begin();
117 iter != gpu_channels_.end(); ++iter) { 117 iter != gpu_channels_.end(); ++iter) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 void GpuChannelManager::LoseAllContexts() { 176 void GpuChannelManager::LoseAllContexts() {
177 MessageLoop::current()->PostTask( 177 MessageLoop::current()->PostTask(
178 FROM_HERE, method_factory_.NewRunnableMethod( 178 FROM_HERE, method_factory_.NewRunnableMethod(
179 &GpuChannelManager::OnLoseAllContexts)); 179 &GpuChannelManager::OnLoseAllContexts));
180 } 180 }
181 181
182 void GpuChannelManager::OnLoseAllContexts() { 182 void GpuChannelManager::OnLoseAllContexts() {
183 gpu_channels_.clear(); 183 gpu_channels_.clear();
184 } 184 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698