OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/command_line.h" | |
6 #include "base/debug/debugger.h" | |
7 #include "base/message_loop.h" | |
8 #include "ui/compositor/test/compositor_test_support.h" | |
9 #include "ui/viewer/viewer_process.h" | |
10 | |
11 // Mainline routine for running as the viewer process. | |
12 int ViewerProcessMain() { | |
13 MessageLoop main_message_loop(MessageLoop::TYPE_UI); | |
14 ui::CompositorTestSupport::Initialize(); | |
15 | |
16 main_message_loop.set_thread_name("MainThread"); | |
17 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
18 // TODO(scottmg): Constant. | |
tfarina
2012/08/28 00:55:37
why don't you do this now? It shouldn't take too m
| |
19 if (command_line->HasSwitch("wait-for-debugger")) { | |
20 base::debug::WaitForDebugger(60, true); | |
21 } | |
22 | |
23 VLOG(1) << "Viewer process launched: " | |
24 << CommandLine::ForCurrentProcess()->GetCommandLineString(); | |
25 | |
26 base::PlatformThread::SetName("CrViewerMain"); | |
27 | |
28 // TODO(scottmg): Uniquize this process? | |
29 | |
30 ViewerProcess viewer_process; | |
31 if (viewer_process.Initialize(&main_message_loop, *command_line)) { | |
32 MessageLoopForUI::current()->Run(); | |
33 } else { | |
34 LOG(ERROR) << "Viewer process failed to initialize"; | |
35 } | |
36 viewer_process.Teardown(); | |
37 return 0; | |
38 } | |
OLD | NEW |