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

Side by Side Diff: content/gpu/gpu_main.cc

Issue 10581041: Change GPU process to use IO rather than UI MessageLoop on Mac OS. On this platform, the GPU proces… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months 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 | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stdlib.h> 5 #include <stdlib.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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // For windows, if the target_services interface is not zero, the process 179 // For windows, if the target_services interface is not zero, the process
180 // is sandboxed and we must call LowerToken() before rendering untrusted 180 // is sandboxed and we must call LowerToken() before rendering untrusted
181 // content. 181 // content.
182 sandbox::TargetServices* target_services = 182 sandbox::TargetServices* target_services =
183 parameters.sandbox_info->target_services; 183 parameters.sandbox_info->target_services;
184 if (target_services) 184 if (target_services)
185 target_services->LowerToken(); 185 target_services->LowerToken();
186 } 186 }
187 #endif 187 #endif
188 188
189 MessageLoop::Type message_loop_type = MessageLoop::TYPE_UI; 189 MessageLoop::Type message_loop_type = MessageLoop::TYPE_IO;
190 #if defined(OS_WIN) 190 #if defined(OS_WIN)
191 // Unless we're running on desktop GL, we don't need a UI message 191 // Unless we're running on desktop GL, we don't need a UI message
192 // loop, so avoid its use to work around apparent problems with some 192 // loop, so avoid its use to work around apparent problems with some
193 // third-party software. 193 // third-party software.
194 message_loop_type = MessageLoop::TYPE_IO;
195 if (command_line.HasSwitch(switches::kUseGL) && 194 if (command_line.HasSwitch(switches::kUseGL) &&
196 command_line.GetSwitchValueASCII(switches::kUseGL) == 195 command_line.GetSwitchValueASCII(switches::kUseGL) ==
197 gfx::kGLImplementationDesktopName) { 196 gfx::kGLImplementationDesktopName) {
198 message_loop_type = MessageLoop::TYPE_UI; 197 message_loop_type = MessageLoop::TYPE_UI;
199 } 198 }
200 #elif defined(OS_LINUX) 199 #elif defined(OS_LINUX)
201 message_loop_type = MessageLoop::TYPE_DEFAULT; 200 message_loop_type = MessageLoop::TYPE_DEFAULT;
202 #endif 201 #endif
203 202
204 MessageLoop main_message_loop(message_loop_type); 203 MessageLoop main_message_loop(message_loop_type);
205 base::PlatformThread::SetName("CrGpuMain"); 204 base::PlatformThread::SetName("CrGpuMain");
206 205
207 GpuProcess gpu_process; 206 GpuProcess gpu_process;
208 207
209 GpuChildThread* child_thread = new GpuChildThread(dead_on_arrival, gpu_info); 208 GpuChildThread* child_thread = new GpuChildThread(dead_on_arrival, gpu_info);
210 209
211 child_thread->Init(start_time); 210 child_thread->Init(start_time);
212 211
213 gpu_process.set_main_thread(child_thread); 212 gpu_process.set_main_thread(child_thread);
214 213
215 { 214 {
216 TRACE_EVENT0("gpu", "Run Message Loop"); 215 TRACE_EVENT0("gpu", "Run Message Loop");
217 main_message_loop.Run(); 216 main_message_loop.Run();
218 } 217 }
219 218
220 child_thread->StopWatchdog(); 219 child_thread->StopWatchdog();
221 220
222 return 0; 221 return 0;
223 } 222 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698