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

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

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (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
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/browser/gpu_process_host_ui_shim.h » ('j') | 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/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"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 bool GpuProcessHost::Send(IPC::Message* msg) { 126 bool GpuProcessHost::Send(IPC::Message* msg) {
127 DCHECK(CalledOnValidThread()); 127 DCHECK(CalledOnValidThread());
128 128
129 if (!EnsureInitialized()) 129 if (!EnsureInitialized())
130 return false; 130 return false;
131 131
132 return BrowserChildProcessHost::Send(msg); 132 return BrowserChildProcessHost::Send(msg);
133 } 133 }
134 134
135 void GpuProcessHost::OnMessageReceived(const IPC::Message& message) { 135 bool 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 return OnControlMessageReceived(message);
140 else 140
141 RouteOnUIThread(message); 141 RouteOnUIThread(message);
142 return true;
142 } 143 }
143 144
144 void GpuProcessHost::EstablishGpuChannel(int renderer_id, 145 void GpuProcessHost::EstablishGpuChannel(int renderer_id,
145 RenderMessageFilter* filter) { 146 RenderMessageFilter* filter) {
146 DCHECK(CalledOnValidThread()); 147 DCHECK(CalledOnValidThread());
147 148
148 if (Send(new GpuMsg_EstablishChannel(renderer_id))) { 149 if (Send(new GpuMsg_EstablishChannel(renderer_id))) {
149 sent_requests_.push(ChannelRequest(filter)); 150 sent_requests_.push(ChannelRequest(filter));
150 } else { 151 } else {
151 SendEstablishChannelReply(IPC::ChannelHandle(), GPUInfo(), filter); 152 SendEstablishChannelReply(IPC::ChannelHandle(), GPUInfo(), filter);
(...skipping 19 matching lines...) Expand all
171 172
172 GpuProcessHost::SynchronizationRequest::SynchronizationRequest( 173 GpuProcessHost::SynchronizationRequest::SynchronizationRequest(
173 IPC::Message* reply, 174 IPC::Message* reply,
174 RenderMessageFilter* filter) 175 RenderMessageFilter* filter)
175 : reply(reply), 176 : reply(reply),
176 filter(filter) { 177 filter(filter) {
177 } 178 }
178 179
179 GpuProcessHost::SynchronizationRequest::~SynchronizationRequest() {} 180 GpuProcessHost::SynchronizationRequest::~SynchronizationRequest() {}
180 181
181 void GpuProcessHost::OnControlMessageReceived(const IPC::Message& message) { 182 bool GpuProcessHost::OnControlMessageReceived(const IPC::Message& message) {
182 DCHECK(CalledOnValidThread()); 183 DCHECK(CalledOnValidThread());
183 184
184 IPC_BEGIN_MESSAGE_MAP(GpuProcessHost, message) 185 IPC_BEGIN_MESSAGE_MAP(GpuProcessHost, message)
185 IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, OnChannelEstablished) 186 IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, OnChannelEstablished)
186 IPC_MESSAGE_HANDLER(GpuHostMsg_SynchronizeReply, OnSynchronizeReply) 187 IPC_MESSAGE_HANDLER(GpuHostMsg_SynchronizeReply, OnSynchronizeReply)
187 #if defined(OS_LINUX) 188 #if defined(OS_LINUX)
188 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_GetViewXID, OnGetViewXID) 189 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_GetViewXID, OnGetViewXID)
189 IPC_MESSAGE_HANDLER(GpuHostMsg_ReleaseXID, OnReleaseXID) 190 IPC_MESSAGE_HANDLER(GpuHostMsg_ReleaseXID, OnReleaseXID)
190 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_ResizeXID, OnResizeXID) 191 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_ResizeXID, OnResizeXID)
191 #elif defined(OS_MACOSX) 192 #elif defined(OS_MACOSX)
192 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface, 193 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceSetIOSurface,
193 OnAcceleratedSurfaceSetIOSurface) 194 OnAcceleratedSurfaceSetIOSurface)
194 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, 195 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
195 OnAcceleratedSurfaceBuffersSwapped) 196 OnAcceleratedSurfaceBuffersSwapped)
196 #elif defined(OS_WIN) 197 #elif defined(OS_WIN)
197 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_GetCompositorHostWindow, 198 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_GetCompositorHostWindow,
198 OnGetCompositorHostWindow) 199 OnGetCompositorHostWindow)
199 #endif 200 #endif
200 // If the IO thread does not handle the message then automatically route it 201 // If the IO thread does not handle the message then automatically route it
201 // to the UI thread. The UI thread will report an error if it does not 202 // to the UI thread. The UI thread will report an error if it does not
202 // handle it. 203 // handle it.
203 IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message)) 204 IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message))
204 IPC_END_MESSAGE_MAP() 205 IPC_END_MESSAGE_MAP()
206
207 return true;
205 } 208 }
206 209
207 void GpuProcessHost::OnChannelEstablished( 210 void GpuProcessHost::OnChannelEstablished(
208 const IPC::ChannelHandle& channel_handle, 211 const IPC::ChannelHandle& channel_handle,
209 const GPUInfo& gpu_info) { 212 const GPUInfo& gpu_info) {
210 GpuFeatureFlags gpu_feature_flags; 213 GpuFeatureFlags gpu_feature_flags;
211 if (channel_handle.name.size() != 0) { 214 if (channel_handle.name.size() != 0) {
212 gpu_feature_flags = gpu_blacklist_->DetermineGpuFeatureFlags( 215 gpu_feature_flags = gpu_blacklist_->DetermineGpuFeatureFlags(
213 GpuBlacklist::kOsAny, NULL, gpu_info); 216 GpuBlacklist::kOsAny, NULL, gpu_info);
214 } 217 }
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); 564 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
562 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || 565 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) ||
563 blacklist->LoadGpuBlacklist(gpu_blacklist_json.as_string(), true)) { 566 blacklist->LoadGpuBlacklist(gpu_blacklist_json.as_string(), true)) {
564 gpu_blacklist_.reset(blacklist); 567 gpu_blacklist_.reset(blacklist);
565 return true; 568 return true;
566 } 569 }
567 delete blacklist; 570 delete blacklist;
568 return false; 571 return false;
569 } 572 }
570 573
OLDNEW
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/browser/gpu_process_host_ui_shim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698