diff options
author | scottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-18 16:31:01 +0000 |
---|---|---|
committer | scottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-18 16:31:01 +0000 |
commit | f7a0b4d2c8f13d1d25c79bd1bd63568adf057a20 (patch) | |
tree | 98f95d695fdd24dc7dc1e54168c901e82e7031dc /ui/viewer/viewer_main.cc | |
parent | 68f5b577e717e0cccbd012b2c73fe5f71ea78317 (diff) | |
download | chromium_src-f7a0b4d2c8f13d1d25c79bd1bd63568adf057a20.zip chromium_src-f7a0b4d2c8f13d1d25c79bd1bd63568adf057a20.tar.gz chromium_src-f7a0b4d2c8f13d1d25c79bd1bd63568adf057a20.tar.bz2 |
Bunch of boilerplate to set up a process, ipc, etc.
Only hooked up in "aura_demo --viewer" right now, and doesn't actually accomplish anything other than opening a window yet.
Review URL: https://codereview.chromium.org/10872002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157367 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/viewer/viewer_main.cc')
-rw-r--r-- | ui/viewer/viewer_main.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ui/viewer/viewer_main.cc b/ui/viewer/viewer_main.cc new file mode 100644 index 0000000..e49dcc0 --- /dev/null +++ b/ui/viewer/viewer_main.cc @@ -0,0 +1,34 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/command_line.h" +#include "base/debug/debugger.h" +#include "base/message_loop.h" +#include "ui/compositor/test/compositor_test_support.h" +#include "ui/viewer/viewer_process.h" + +// Mainline routine for running as the viewer process. +int ViewerProcessMain() { + MessageLoop main_message_loop(MessageLoop::TYPE_UI); + ui::CompositorTestSupport::Initialize(); + + main_message_loop.set_thread_name("MainThread"); + CommandLine* command_line = CommandLine::ForCurrentProcess(); + + VLOG(1) << "Viewer process launched: " + << CommandLine::ForCurrentProcess()->GetCommandLineString(); + + base::PlatformThread::SetName("CrViewerMain"); + + // TODO(scottmg): Uniquize this process? + + ViewerProcess viewer_process; + if (viewer_process.Initialize(&main_message_loop, *command_line)) { + MessageLoopForUI::current()->Run(); + } else { + LOG(ERROR) << "Viewer process failed to initialize"; + } + viewer_process.Teardown(); + return 0; +} |