Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Unified Diff: services/asset_bundle/main.cc

Issue 2005103003: Add implementations of mojo::{Run,Terminate}[Main]Application() for "chromium". (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/asset_bundle/main.cc
diff --git a/services/asset_bundle/main.cc b/services/asset_bundle/main.cc
index fc3fdf7a26255d97190ee97ac1f2f6d47049fda5..d6c8d63f5be3387e32cc353cb0a04a885c893967 100644
--- a/services/asset_bundle/main.cc
+++ b/services/asset_bundle/main.cc
@@ -4,30 +4,29 @@
#include "base/macros.h"
#include "base/threading/sequenced_worker_pool.h"
-#include "mojo/application/application_runner_chromium.h"
#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/application_impl_base.h"
+#include "mojo/public/cpp/application/run_application.h"
#include "mojo/public/cpp/application/service_provider_impl.h"
#include "services/asset_bundle/asset_unpacker_impl.h"
namespace mojo {
namespace asset_bundle {
-class AssetBundleApp : public ApplicationDelegate {
+class AssetBundleApp : public ApplicationImplBase {
public:
AssetBundleApp() {}
~AssetBundleApp() override {}
private:
- // |ApplicationDelegate| override:
- bool ConfigureIncomingConnection(
- ServiceProviderImpl* service_provider_impl) override {
+ // |ApplicationImplBase| override:
+ bool OnAcceptConnection(ServiceProviderImpl* service_provider_impl) override {
service_provider_impl->AddService<AssetUnpacker>(
[this](const ConnectionContext& connection_context,
InterfaceRequest<AssetUnpacker> asset_unpacker_request) {
// Lazily initialize |sequenced_worker_pool_|. (We can't create it in
// the constructor, since AtExitManager is only created in
- // ApplicationRunnerChromium::Run().)
+ // mojo::RunMainApplication().)
if (!sequenced_worker_pool_) {
// TODO(vtl): What's the "right" way to choose the maximum number of
// threads?
@@ -54,7 +53,6 @@ class AssetBundleApp : public ApplicationDelegate {
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunnerChromium runner(
- new mojo::asset_bundle::AssetBundleApp());
- return runner.Run(application_request);
+ mojo::asset_bundle::AssetBundleApp asset_bundle_app;
+ return mojo::RunMainApplication(application_request, &asset_bundle_app);
}

Powered by Google App Engine
This is Rietveld 408576698