| // Copyright 2019 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 <string> |
| #include <vector> |
| |
| #include "base/at_exit.h" |
| #include "base/message_loop/message_loop.h" |
| #include "base/message_loop/message_pump_for_io.h" |
| #include "base/run_loop.h" |
| #include "chromecast/external_mojo/external_service_support/process_setup.h" |
| #include "chromecast/external_mojo/public/cpp/external_mojo_broker.h" |
| #include "mojo/core/embedder/embedder.h" |
| #include "mojo/core/embedder/scoped_ipc_support.h" |
| |
| // Standalone Mojo broker process. |
| |
| int main(int argc, char** argv) { |
| base::AtExitManager exit_manager; |
| chromecast::external_service_support::CommonProcessInitialization(argc, argv); |
| |
| base::MessageLoopForIO main_loop; |
| base::RunLoop run_loop; |
| |
| mojo::core::Configuration mojo_config; |
| mojo_config.is_broker_process = true; |
| mojo::core::Init(mojo_config); |
| |
| mojo::core::ScopedIPCSupport ipc_support( |
| main_loop.task_runner(), |
| mojo::core::ScopedIPCSupport::ShutdownPolicy::CLEAN); |
| |
| chromecast::external_mojo::ExternalMojoBroker broker; |
| |
| run_loop.Run(); |
| |
| return 0; |
| } |