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

Side by Side Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

Issue 8548014: Get rid of last gpu_messages.h dependency in chrome by having chrome ask the GPUProcessHostUIShim... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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
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/browser/gpu/gpu_process_host_ui_shim.h" 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/id_map.h" 10 #include "base/id_map.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) { 141 bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) {
142 DCHECK(CalledOnValidThread()); 142 DCHECK(CalledOnValidThread());
143 143
144 if (message.routing_id() != MSG_ROUTING_CONTROL) 144 if (message.routing_id() != MSG_ROUTING_CONTROL)
145 return false; 145 return false;
146 146
147 return OnControlMessageReceived(message); 147 return OnControlMessageReceived(message);
148 } 148 }
149 149
150 void GpuProcessHostUIShim::SimulateRemoveAllContext() {
151 Send(new GpuMsg_Clean());
152 }
153
154 void GpuProcessHostUIShim::SimulateCrash() {
155 Send(new GpuMsg_Crash());
156 }
157
158 void GpuProcessHostUIShim::SimulateHang() {
159 Send(new GpuMsg_Hang());
160 }
161
150 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) 162 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
151 163
152 void GpuProcessHostUIShim::SendToGpuHost(int host_id, IPC::Message* msg) { 164 void GpuProcessHostUIShim::SendToGpuHost(int host_id, IPC::Message* msg) {
153 GpuProcessHostUIShim* ui_shim = FromID(host_id); 165 GpuProcessHostUIShim* ui_shim = FromID(host_id);
154 if (!ui_shim) { 166 if (!ui_shim) {
155 delete msg; 167 delete msg;
156 return; 168 return;
157 } 169 }
158 170
159 ui_shim->Send(msg); 171 ui_shim->Send(msg);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 params.render_view_id); 372 params.render_view_id);
361 if (!host) 373 if (!host)
362 return; 374 return;
363 RenderWidgetHostView* view = host->view(); 375 RenderWidgetHostView* view = host->view();
364 if (!view) 376 if (!view)
365 return; 377 return;
366 view->AcceleratedSurfaceRelease(params.identifier); 378 view->AcceleratedSurfaceRelease(params.identifier);
367 } 379 }
368 380
369 #endif 381 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698