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

Side by Side Diff: chrome/browser/gpu_process_host_ui_shim.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
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_ui_shim.h" 5 #include "chrome/browser/gpu_process_host_ui_shim.h"
6 6
7 #include "chrome/browser/browser_thread.h" 7 #include "chrome/browser/browser_thread.h"
8 #include "chrome/browser/gpu_process_host.h" 8 #include "chrome/browser/gpu_process_host.h"
9 #include "chrome/browser/renderer_host/render_view_host.h" 9 #include "chrome/browser/renderer_host/render_view_host.h"
10 #include "chrome/common/child_process_logging.h" 10 #include "chrome/common/child_process_logging.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 IPC::Channel::Listener* listener) { 56 IPC::Channel::Listener* listener) {
57 DCHECK(CalledOnValidThread()); 57 DCHECK(CalledOnValidThread());
58 router_.AddRoute(routing_id, listener); 58 router_.AddRoute(routing_id, listener);
59 } 59 }
60 60
61 void GpuProcessHostUIShim::RemoveRoute(int32 routing_id) { 61 void GpuProcessHostUIShim::RemoveRoute(int32 routing_id) {
62 DCHECK(CalledOnValidThread()); 62 DCHECK(CalledOnValidThread());
63 router_.RemoveRoute(routing_id); 63 router_.RemoveRoute(routing_id);
64 } 64 }
65 65
66 void GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) { 66 bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) {
67 DCHECK(CalledOnValidThread()); 67 DCHECK(CalledOnValidThread());
68 68
69 if (message.routing_id() == MSG_ROUTING_CONTROL) 69 if (message.routing_id() == MSG_ROUTING_CONTROL)
70 OnControlMessageReceived(message); 70 return OnControlMessageReceived(message);
71 else 71
72 router_.RouteMessage(message); 72 return router_.RouteMessage(message);
73 } 73 }
74 74
75 void GpuProcessHostUIShim::CollectGraphicsInfoAsynchronously() { 75 void GpuProcessHostUIShim::CollectGraphicsInfoAsynchronously() {
76 DCHECK(CalledOnValidThread()); 76 DCHECK(CalledOnValidThread());
77 BrowserThread::PostTask( 77 BrowserThread::PostTask(
78 BrowserThread::IO, 78 BrowserThread::IO,
79 FROM_HERE, 79 FROM_HERE,
80 new SendOnIOThreadTask(new GpuMsg_CollectGraphicsInfo())); 80 new SendOnIOThreadTask(new GpuMsg_CollectGraphicsInfo()));
81 } 81 }
82 82
(...skipping 29 matching lines...) Expand all
112 112
113 void GpuProcessHostUIShim::OnScheduleComposite(int renderer_id, 113 void GpuProcessHostUIShim::OnScheduleComposite(int renderer_id,
114 int render_view_id) { 114 int render_view_id) {
115 RenderViewHost* host = RenderViewHost::FromID(renderer_id, 115 RenderViewHost* host = RenderViewHost::FromID(renderer_id,
116 render_view_id); 116 render_view_id);
117 if (!host) { 117 if (!host) {
118 return; 118 return;
119 } 119 }
120 host->ScheduleComposite(); 120 host->ScheduleComposite();
121 } 121 }
122 void GpuProcessHostUIShim::OnControlMessageReceived( 122
123 bool GpuProcessHostUIShim::OnControlMessageReceived(
123 const IPC::Message& message) { 124 const IPC::Message& message) {
124 DCHECK(CalledOnValidThread()); 125 DCHECK(CalledOnValidThread());
125 126
126 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) 127 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message)
127 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, 128 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected,
128 OnGraphicsInfoCollected) 129 OnGraphicsInfoCollected)
129 #if defined(OS_WIN) 130 #if defined(OS_WIN)
130 IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite, 131 IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite, OnScheduleComposite);
131 OnScheduleComposite);
132 #endif 132 #endif
133 IPC_MESSAGE_UNHANDLED_ERROR() 133 IPC_MESSAGE_UNHANDLED_ERROR()
134 IPC_END_MESSAGE_MAP() 134 IPC_END_MESSAGE_MAP()
135
136 return true;
135 } 137 }
OLDNEW
« no previous file with comments | « chrome/browser/gpu_process_host_ui_shim.h ('k') | chrome/browser/importer/firefox_importer_unittest_utils_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698