1 // Copyright 2015 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 "mandoline/services/updater/updater_app.h"
7 #include "base/logging.h"
8 #include "mandoline/services/updater/updater_impl.h"
9 #include "mojo/application/public/cpp/application_connection.h"
10 #include "mojo/application/public/cpp/application_impl.h"
11 #include "mojo/application/public/cpp/application_runner.h"
12 #include "mojo/public/c/system/main.h"
16 UpdaterApp::UpdaterApp() : app_impl_(nullptr) {
19 UpdaterApp::~UpdaterApp() {
22 void UpdaterApp::Initialize(mojo::ApplicationImpl
* app
) {
26 bool UpdaterApp::ConfigureIncomingConnection(
27 mojo::ApplicationConnection
* connection
) {
28 connection
->AddService
<Updater
>(this);
32 void UpdaterApp::Create(mojo::ApplicationConnection
* connection
,
33 mojo::InterfaceRequest
<Updater
> request
) {
34 new UpdaterImpl(app_impl_
, this, request
.Pass());
37 } // namespace updater
39 MojoResult
MojoMain(MojoHandle shell_handle
) {
40 mojo::ApplicationRunner
runner(new updater::UpdaterApp
);
41 return runner
.Run(shell_handle
);