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

Unified Diff: services/shell/public/cpp/application_runner.h

Issue 2156203003: shell::ApplicationRunner -> shell::ServiceRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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
« no previous file with comments | « services/shell/public/cpp/BUILD.gn ('k') | services/shell/public/cpp/lib/application_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/public/cpp/application_runner.h
diff --git a/services/shell/public/cpp/application_runner.h b/services/shell/public/cpp/application_runner.h
deleted file mode 100644
index 11b28103975fb1a803ed7cd0b70a477027db7739..0000000000000000000000000000000000000000
--- a/services/shell/public/cpp/application_runner.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef SERVICES_SHELL_PUBLIC_CPP_APPLICATION_RUNNER_H_
-#define SERVICES_SHELL_PUBLIC_CPP_APPLICATION_RUNNER_H_
-
-#include <memory>
-
-#include "base/message_loop/message_loop.h"
-#include "mojo/public/cpp/system/core.h"
-
-namespace shell {
-
-class Service;
-class ServiceContext;
-
-// A utility for running a chromium based mojo Application. The typical use
-// case is to use when writing your MojoMain:
-//
-// MojoResult MojoMain(MojoHandle shell_handle) {
-// shell::ApplicationRunner runner(new MyDelegate());
-// return runner.Run(shell_handle);
-// }
-//
-// ApplicationRunner takes care of chromium environment initialization and
-// shutdown, and starting a MessageLoop from which your application can run and
-// ultimately Quit().
-class ApplicationRunner {
- public:
- // Takes ownership of |client|.
- explicit ApplicationRunner(Service* client);
- ~ApplicationRunner();
-
- static void InitBaseCommandLine();
-
- void set_message_loop_type(base::MessageLoop::Type type);
-
- // Once the various parameters have been set above, use Run to initialize an
- // ServiceContext wired to the provided delegate, and run a MessageLoop until
- // the application exits.
- //
- // Iff |init_base| is true, the runner will perform some initialization of
- // base globals (e.g. CommandLine and AtExitManager) before starting the
- // application.
- MojoResult Run(MojoHandle shell_handle, bool init_base);
-
- // Calls Run above with |init_base| set to |true|.
- MojoResult Run(MojoHandle shell_handle);
-
- // Allows the caller to shut down the connection with the Service Manager.
- // After the Service Manager notices the pipe has closed, it will no longer
- // track an instance of this service, though this service may continue to run
- // and handle requests from others.
- void DestroyServiceContext();
-
- // Allows the caller to explicitly quit the application. Must be called from
- // the thread which created the ApplicationRunner.
- void Quit();
-
- private:
- std::unique_ptr<ServiceContext> context_;
- std::unique_ptr<Service> client_;
-
- // MessageLoop type. TYPE_CUSTOM is default (MessagePumpMojo will be used as
- // the underlying message pump).
- base::MessageLoop::Type message_loop_type_;
- // Whether Run() has been called.
- bool has_run_;
-
- DISALLOW_COPY_AND_ASSIGN(ApplicationRunner);
-};
-
-} // namespace shell
-
-#endif // SERVICES_SHELL_PUBLIC_CPP_APPLICATION_RUNNER_H_
« no previous file with comments | « services/shell/public/cpp/BUILD.gn ('k') | services/shell/public/cpp/lib/application_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698