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

Side by Side Diff: chrome/browser/gpu_process_host.cc

Issue 5701004: Rename ResourceMessageFilter to RenderMessageFilter, since that's what it act... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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/browser/gpu_process_host.h" 5 #include "chrome/browser/gpu_process_host.h"
6 6
7 #include "app/app_switches.h" 7 #include "app/app_switches.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/string_piece.h" 11 #include "base/string_piece.h"
12 #include "base/thread.h" 12 #include "base/thread.h"
13 #include "chrome/browser/browser_thread.h" 13 #include "chrome/browser/browser_thread.h"
14 #include "chrome/browser/gpu_blacklist.h" 14 #include "chrome/browser/gpu_blacklist.h"
15 #include "chrome/browser/gpu_process_host_ui_shim.h" 15 #include "chrome/browser/gpu_process_host_ui_shim.h"
16 #include "chrome/browser/renderer_host/render_message_filter.h"
16 #include "chrome/browser/renderer_host/render_view_host.h" 17 #include "chrome/browser/renderer_host/render_view_host.h"
17 #include "chrome/browser/renderer_host/render_widget_host_view.h" 18 #include "chrome/browser/renderer_host/render_widget_host_view.h"
18 #include "chrome/browser/renderer_host/resource_message_filter.h"
19 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" 19 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
20 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/gpu_feature_flags.h" 21 #include "chrome/common/gpu_feature_flags.h"
22 #include "chrome/common/gpu_info.h" 22 #include "chrome/common/gpu_info.h"
23 #include "chrome/common/gpu_messages.h" 23 #include "chrome/common/gpu_messages.h"
24 #include "chrome/common/render_messages.h" 24 #include "chrome/common/render_messages.h"
25 #include "grit/browser_resources.h" 25 #include "grit/browser_resources.h"
26 #include "ipc/ipc_channel_handle.h" 26 #include "ipc/ipc_channel_handle.h"
27 #include "ipc/ipc_switches.h" 27 #include "ipc/ipc_switches.h"
28 #include "media/base/media_switches.h" 28 #include "media/base/media_switches.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 void GpuProcessHost::OnMessageReceived(const IPC::Message& message) { 135 void GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
136 DCHECK(CalledOnValidThread()); 136 DCHECK(CalledOnValidThread());
137 137
138 if (message.routing_id() == MSG_ROUTING_CONTROL) 138 if (message.routing_id() == MSG_ROUTING_CONTROL)
139 OnControlMessageReceived(message); 139 OnControlMessageReceived(message);
140 else 140 else
141 RouteOnUIThread(message); 141 RouteOnUIThread(message);
142 } 142 }
143 143
144 void GpuProcessHost::EstablishGpuChannel(int renderer_id, 144 void GpuProcessHost::EstablishGpuChannel(int renderer_id,
145 ResourceMessageFilter* filter) { 145 RenderMessageFilter* filter) {
146 DCHECK(CalledOnValidThread()); 146 DCHECK(CalledOnValidThread());
147 147
148 if (Send(new GpuMsg_EstablishChannel(renderer_id))) { 148 if (Send(new GpuMsg_EstablishChannel(renderer_id))) {
149 sent_requests_.push(ChannelRequest(filter)); 149 sent_requests_.push(ChannelRequest(filter));
150 } else { 150 } else {
151 SendEstablishChannelReply(IPC::ChannelHandle(), GPUInfo(), filter); 151 SendEstablishChannelReply(IPC::ChannelHandle(), GPUInfo(), filter);
152 } 152 }
153 } 153 }
154 154
155 void GpuProcessHost::Synchronize(IPC::Message* reply, 155 void GpuProcessHost::Synchronize(IPC::Message* reply,
156 ResourceMessageFilter* filter) { 156 RenderMessageFilter* filter) {
157 DCHECK(CalledOnValidThread()); 157 DCHECK(CalledOnValidThread());
158 158
159 if (Send(new GpuMsg_Synchronize())) { 159 if (Send(new GpuMsg_Synchronize())) {
160 queued_synchronization_replies_.push(SynchronizationRequest(reply, filter)); 160 queued_synchronization_replies_.push(SynchronizationRequest(reply, filter));
161 } else { 161 } else {
162 SendSynchronizationReply(reply, filter); 162 SendSynchronizationReply(reply, filter);
163 } 163 }
164 } 164 }
165 165
166 GpuProcessHost::ChannelRequest::ChannelRequest(ResourceMessageFilter* filter) 166 GpuProcessHost::ChannelRequest::ChannelRequest(RenderMessageFilter* filter)
167 : filter(filter) { 167 : filter(filter) {
168 } 168 }
169 169
170 GpuProcessHost::ChannelRequest::~ChannelRequest() {} 170 GpuProcessHost::ChannelRequest::~ChannelRequest() {}
171 171
172 GpuProcessHost::SynchronizationRequest::SynchronizationRequest( 172 GpuProcessHost::SynchronizationRequest::SynchronizationRequest(
173 IPC::Message* reply, 173 IPC::Message* reply,
174 ResourceMessageFilter* filter) 174 RenderMessageFilter* filter)
175 : reply(reply), 175 : reply(reply),
176 filter(filter) { 176 filter(filter) {
177 } 177 }
178 178
179 GpuProcessHost::SynchronizationRequest::~SynchronizationRequest() {} 179 GpuProcessHost::SynchronizationRequest::~SynchronizationRequest() {}
180 180
181 void GpuProcessHost::OnControlMessageReceived(const IPC::Message& message) { 181 void GpuProcessHost::OnControlMessageReceived(const IPC::Message& message) {
182 DCHECK(CalledOnValidThread()); 182 DCHECK(CalledOnValidThread());
183 183
184 IPC_BEGIN_MESSAGE_MAP(GpuProcessHost, message) 184 IPC_BEGIN_MESSAGE_MAP(GpuProcessHost, message)
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 BrowserThread::UI, FROM_HERE, 453 BrowserThread::UI, FROM_HERE,
454 NewRunnableFunction(&GetCompositorHostWindowDispatcher, 454 NewRunnableFunction(&GetCompositorHostWindowDispatcher,
455 renderer_id, render_view_id, reply_message)); 455 renderer_id, render_view_id, reply_message));
456 } 456 }
457 457
458 #endif 458 #endif
459 459
460 void GpuProcessHost::SendEstablishChannelReply( 460 void GpuProcessHost::SendEstablishChannelReply(
461 const IPC::ChannelHandle& channel, 461 const IPC::ChannelHandle& channel,
462 const GPUInfo& gpu_info, 462 const GPUInfo& gpu_info,
463 ResourceMessageFilter* filter) { 463 RenderMessageFilter* filter) {
464 ViewMsg_GpuChannelEstablished* message = 464 ViewMsg_GpuChannelEstablished* message =
465 new ViewMsg_GpuChannelEstablished(channel, gpu_info); 465 new ViewMsg_GpuChannelEstablished(channel, gpu_info);
466 // If the renderer process is performing synchronous initialization, 466 // If the renderer process is performing synchronous initialization,
467 // it needs to handle this message before receiving the reply for 467 // it needs to handle this message before receiving the reply for
468 // the synchronous ViewHostMsg_SynchronizeGpu message. 468 // the synchronous ViewHostMsg_SynchronizeGpu message.
469 message->set_unblock(true); 469 message->set_unblock(true);
470 filter->Send(message); 470 filter->Send(message);
471 } 471 }
472 472
473 // Sends the response for synchronization request to the renderer. 473 // Sends the response for synchronization request to the renderer.
474 void GpuProcessHost::SendSynchronizationReply( 474 void GpuProcessHost::SendSynchronizationReply(
475 IPC::Message* reply, 475 IPC::Message* reply,
476 ResourceMessageFilter* filter) { 476 RenderMessageFilter* filter) {
477 filter->Send(reply); 477 filter->Send(reply);
478 } 478 }
479 479
480 URLRequestContext* GpuProcessHost::GetRequestContext( 480 URLRequestContext* GpuProcessHost::GetRequestContext(
481 uint32 request_id, 481 uint32 request_id,
482 const ViewHostMsg_Resource_Request& request_data) { 482 const ViewHostMsg_Resource_Request& request_data) {
483 return NULL; 483 return NULL;
484 } 484 }
485 485
486 bool GpuProcessHost::CanShutdown() { 486 bool GpuProcessHost::CanShutdown() {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); 567 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
568 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || 568 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) ||
569 blacklist->LoadGpuBlacklist(gpu_blacklist_json.as_string(), true)) { 569 blacklist->LoadGpuBlacklist(gpu_blacklist_json.as_string(), true)) {
570 gpu_blacklist_.reset(blacklist); 570 gpu_blacklist_.reset(blacklist);
571 return true; 571 return true;
572 } 572 }
573 delete blacklist; 573 delete blacklist;
574 return false; 574 return false;
575 } 575 }
576 576
OLDNEW
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698