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 | |
19 VLOG(1) << "Viewer process launched: " | |
20 << CommandLine::ForCurrentProcess()->GetCommandLineString(); | |
21 | |
22 base::PlatformThread::SetName("CrViewerMain"); | |
23 | |
24 // TODO(scottmg): Uniquize this process? | |
25 | |
26 ViewerProcess viewer_process; | |
27 if (viewer_process.Initialize(&main_message_loop, *command_line)) { | |
28 MessageLoopForUI::current()->Run(); | |
29 } else { | |
30 LOG(ERROR) << "Viewer process failed to initialize"; | |
31 } | |
32 viewer_process.Teardown(); | |
33 return 0; | |
34 } | |
OLD | NEW |