Index: mojo/public/cpp/application/run_application.h |
diff --git a/mojo/public/cpp/application/run_application.h b/mojo/public/cpp/application/run_application.h |
index d22de413ec8f22dd48acb3602ea7caa592f8ffa4..1c6008b00c498a71b8f38e3d6e0cfcffea455553 100644 |
--- a/mojo/public/cpp/application/run_application.h |
+++ b/mojo/public/cpp/application/run_application.h |
@@ -12,55 +12,46 @@ namespace mojo { |
class ApplicationImplBase; |
-// Base class for options to |RunMainApplication()| and |RunApplication()|. An |
-// implementation of these functions may (but need not, in which case no options |
-// are available) separately provide an implementation subclass, which would be |
-// specific to that implementation. (The "standalone" implementation has no |
-// options.) |
+// Base class for options to |RunApplication()|. An implementation of these |
+// functions may (but need not, in which case no options are available) |
+// separately provide an implementation subclass, which would be specific to |
+// that implementation. (The "standalone" implementation has no options.) |
class RunApplicationOptions { |
protected: |
RunApplicationOptions() {} |
~RunApplicationOptions() {} |
}; |
-// |RunMainApplication()| and |RunApplication()| set up a message (run) loop and |
-// run the provided application implementation. |RunMainApplication()| should be |
-// used on the application's main thread (e.g., from |MojoMain()|) and may do |
-// additional initialization. (In the case of the "standalone" implementation, |
-// the two are equivalent.) The return value will be the one provided to |
-// |TerminateMainApplication()| or |TerminateApplication()|, respectively. |
+// |RunApplication()| sets up a message (run) loop and runs the provided |
+// application implementation. The return value will be the one provided to |
+// |TerminateApplication()|. |
// |
// Typical use (where |MyApplicationImpl| is an implementation of |
// |ApplicationImplBase|): |
// |
// MojoResult MojoMain(MojoHandle application_request_handle) { |
// MyApplicationImpl my_app; |
-// return mojo::RunMainApplication(application_request_handle, &my_app); |
+// return mojo::RunApplication(application_request_handle, &my_app); |
// } |
// |
-// |RunApplication()| may be used on secondary threads (that are not already |
-// running a message loop of some sort). |
+// Note that |RunApplication()| may also be used on secondary threads (that are |
+// not already running a message loop of some sort). |
// |
// |*application_impl| must remain alive until the message loop starts running |
// (thus it may own itself). If |options| is non-null, then it must point to an |
// instance of an implementation-specific subclass of |RunApplicationOptions|; |
// |*options| must remain alive for the duration of the call. |
-MojoResult RunMainApplication(MojoHandle application_request_handle, |
- ApplicationImplBase* application_impl, |
- const RunApplicationOptions* options = nullptr); |
MojoResult RunApplication(MojoHandle application_request_handle, |
ApplicationImplBase* application_impl, |
const RunApplicationOptions* options = nullptr); |
-// |TerminateMainApplication()| and |TerminateApplication()| terminate the |
-// application that is running on the current thread. They may only be called |
-// from "inside" |RunMainApplication()| and |RunApplication()| respectively |
-// (i.e., |Run[Main]Application()| is on the stack, which means that the message |
-// loop is running). They will cause |Run[Main]Application()| to return "soon" |
-// (assuming the message loop is not blocked processing some task), with return |
-// value |result|. They may cause queued work to *not* be executed. They should |
-// be executed at most once (per |Run[Main]Application()|). |
-void TerminateMainApplication(MojoResult result); |
+// |TerminateApplication()| terminates the application that is running on the |
+// current thread. It may only be called from "inside" |RunApplication()| (i.e., |
+// with |RunApplication()| on the stack, which means that the message loop is |
+// running). It causes |RunApplication()| to return "soon" (assuming the message |
+// loop is not blocked processing some task), with return value |result|. It may |
+// cause queued work to *not* be executed. It should be executed at most once |
+// (per |RunApplication()|). |
void TerminateApplication(MojoResult result); |
} // namespace mojo |