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

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

Issue 6076005: Mac: Don't hang gpu process on popup close under certain conditions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: final touches Created 10 years 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) 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 73
74 #if defined(OS_MACOSX) 74 #if defined(OS_MACOSX)
75 void GpuChannel::AcceleratedSurfaceBuffersSwapped( 75 void GpuChannel::AcceleratedSurfaceBuffersSwapped(
76 int32 route_id, uint64 swap_buffers_count) { 76 int32 route_id, uint64 swap_buffers_count) {
77 GpuCommandBufferStub* stub = stubs_.Lookup(route_id); 77 GpuCommandBufferStub* stub = stubs_.Lookup(route_id);
78 if (stub == NULL) 78 if (stub == NULL)
79 return; 79 return;
80 stub->AcceleratedSurfaceBuffersSwapped(swap_buffers_count); 80 stub->AcceleratedSurfaceBuffersSwapped(swap_buffers_count);
81 } 81 }
82
83 void GpuChannel::DidDestroySurface(int32 renderer_route_id) {
84 // Since acclerated views are created in the renderer process and then sent
85 // to the browser process during GPU channel construction, it is possible that
86 // this is called before a GpuCommandBufferStub for |renderer_route_id| was
87 // put into |stubs_|. Hence, do not walk |stubs_| here but instead remember
88 // all |renderer_route_id|s this was called for and use them later.
89 destroyed_renderer_routes_.insert(renderer_route_id);
90 }
91
92 bool GpuChannel::IsRenderViewGone(int32 renderer_route_id) {
93 return destroyed_renderer_routes_.count(renderer_route_id) > 0;
94 }
82 #endif 95 #endif
83 96
84 void GpuChannel::OnControlMessageReceived(const IPC::Message& msg) { 97 void GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
85 IPC_BEGIN_MESSAGE_MAP(GpuChannel, msg) 98 IPC_BEGIN_MESSAGE_MAP(GpuChannel, msg)
86 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateViewCommandBuffer, 99 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateViewCommandBuffer,
87 OnCreateViewCommandBuffer) 100 OnCreateViewCommandBuffer)
88 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateOffscreenCommandBuffer, 101 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateOffscreenCommandBuffer,
89 OnCreateOffscreenCommandBuffer) 102 OnCreateOffscreenCommandBuffer)
90 IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer, 103 IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer,
91 OnDestroyCommandBuffer) 104 OnDestroyCommandBuffer)
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 #if defined(OS_POSIX) 258 #if defined(OS_POSIX)
246 int GpuChannel::GetRendererFileDescriptor() { 259 int GpuChannel::GetRendererFileDescriptor() {
247 int fd = -1; 260 int fd = -1;
248 if (channel_.get()) { 261 if (channel_.get()) {
249 fd = channel_->GetClientFileDescriptor(); 262 fd = channel_->GetClientFileDescriptor();
250 } 263 }
251 return fd; 264 return fd;
252 } 265 }
253 #endif // defined(OS_POSIX) 266 #endif // defined(OS_POSIX)
254 267
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698