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

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

Issue 10078018: Final(?) eradications of GDK / GTK from the GPU process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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
« base/message_pump_gtk.cc ('K') | « base/message_pump_gtk.cc ('k') | 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 17 matching lines...) Expand all
28 #if defined(OS_WIN) 28 #if defined(OS_WIN)
29 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" 29 #include "content/common/gpu/media/dxva_video_decode_accelerator.h"
30 #include "sandbox/src/sandbox.h" 30 #include "sandbox/src/sandbox.h"
31 #endif 31 #endif
32 32
33 #if defined(USE_X11) 33 #if defined(USE_X11)
34 #include "ui/base/x/x11_util.h" 34 #include "ui/base/x/x11_util.h"
35 #endif 35 #endif
36 36
37 #if defined(TOOLKIT_GTK) 37 #if defined(TOOLKIT_GTK)
38 #include "ui/gfx/gtk_util.h" 38 #include "ui/gfx/gtk_util.h"
apatrick_chromium 2012/04/19 19:54:10 I think you should be able to delete this.
39 #endif 39 #endif
40 40
41 #if defined(OS_LINUX) 41 #if defined(OS_LINUX)
42 #include "content/public/common/sandbox_init.h" 42 #include "content/public/common/sandbox_init.h"
43 #endif 43 #endif
44 44
45 // Main function for starting the Gpu process. 45 // Main function for starting the Gpu process.
46 int GpuMain(const content::MainFunctionParams& parameters) { 46 int GpuMain(const content::MainFunctionParams& parameters) {
47 base::Time start_time = base::Time::Now(); 47 base::Time start_time = base::Time::Now();
48 48
49 const CommandLine& command_line = parameters.command_line; 49 const CommandLine& command_line = parameters.command_line;
50 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { 50 if (command_line.HasSwitch(switches::kGpuStartupDialog)) {
51 ChildProcess::WaitForDebugger("Gpu"); 51 ChildProcess::WaitForDebugger("Gpu");
52 } 52 }
53 53
54 if (!command_line.HasSwitch(switches::kSingleProcess)) { 54 if (!command_line.HasSwitch(switches::kSingleProcess)) {
55 #if defined(OS_WIN) 55 #if defined(OS_WIN)
56 // Prevent Windows from displaying a modal dialog on failures like not being 56 // Prevent Windows from displaying a modal dialog on failures like not being
57 // able to load a DLL. 57 // able to load a DLL.
58 SetErrorMode( 58 SetErrorMode(
59 SEM_FAILCRITICALERRORS | 59 SEM_FAILCRITICALERRORS |
60 SEM_NOGPFAULTERRORBOX | 60 SEM_NOGPFAULTERRORBOX |
61 SEM_NOOPENFILEERRORBOX); 61 SEM_NOOPENFILEERRORBOX);
62 #elif defined(USE_X11) 62 #elif defined(USE_X11)
63 ui::SetDefaultX11ErrorHandlers(); 63 ui::SetDefaultX11ErrorHandlers();
64 #endif 64 #endif
65 #if defined(TOOLKIT_GTK)
66 gfx::GdkInitFromCommandLine(*CommandLine::ForCurrentProcess());
67 #endif
68 } 65 }
69 66
70 // Initialization of the OpenGL bindings may fail, in which case we 67 // Initialization of the OpenGL bindings may fail, in which case we
71 // will need to tear down this process. However, we can not do so 68 // will need to tear down this process. However, we can not do so
72 // safely until the IPC channel is set up, because the detection of 69 // safely until the IPC channel is set up, because the detection of
73 // early return of a child process is implemented using an IPC 70 // early return of a child process is implemented using an IPC
74 // channel error. If the IPC channel is not fully set up between the 71 // channel error. If the IPC channel is not fully set up between the
75 // browser and GPU process, and the GPU process crashes or exits 72 // browser and GPU process, and the GPU process crashes or exits
76 // early, the browser process will never detect it. For this reason 73 // early, the browser process will never detect it. For this reason
77 // we defer tearing down the GPU process until receiving the 74 // we defer tearing down the GPU process until receiving the
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 child_thread->Init(start_time); 153 child_thread->Init(start_time);
157 154
158 gpu_process.set_main_thread(child_thread); 155 gpu_process.set_main_thread(child_thread);
159 156
160 main_message_loop.Run(); 157 main_message_loop.Run();
161 158
162 child_thread->StopWatchdog(); 159 child_thread->StopWatchdog();
163 160
164 return 0; 161 return 0;
165 } 162 }
OLDNEW
« base/message_pump_gtk.cc ('K') | « base/message_pump_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698