1 // Copyright 2014 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.
5 #include "base/at_exit.h"
6 #include "base/command_line.h"
7 #include "base/message_loop/message_loop.h"
8 #include "mojo/public/cpp/application/application.h"
9 #include "mojo/public/cpp/environment/environment.h"
10 #include "mojo/public/cpp/utility/run_loop.h"
12 extern "C" APPLICATION_EXPORT MojoResult CDECL
MojoMain(
13 MojoHandle service_provider_handle
) {
14 base::CommandLine::Init(0, NULL
);
15 base::AtExitManager at_exit
;
16 base::MessageLoop loop
;
18 scoped_ptr
<mojo::Application
>app(mojo::Application::Create());
19 app
->BindServiceProvider(
20 mojo::MakeScopedHandle(mojo::MessagePipeHandle(service_provider_handle
)));
24 return MOJO_RESULT_OK
;