Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / mojo / runner / native_application_support.h
blob5fbbea065e9b843961da46f05c2ce9e2208f5c1b
1 // Copyright 2014 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 #ifndef MOJO_RUNNER_NATIVE_APPLICATION_SUPPORT_H_
6 #define MOJO_RUNNER_NATIVE_APPLICATION_SUPPORT_H_
8 #include "base/native_library.h"
9 #include "mojo/public/cpp/bindings/interface_request.h"
10 #include "mojo/shell/native_runner.h"
12 namespace base {
13 class FilePath;
16 namespace mojo {
18 class Application;
20 namespace runner {
22 // Loads the native Mojo application from the DSO specified by |app_path|.
23 // Returns the |base::NativeLibrary| for the application on success (or null on
24 // failure).
26 // Note: The caller may choose to eventually unload the returned DSO. If so,
27 // this should be done only after the thread on which |LoadNativeApplication()|
28 // and |RunNativeApplication()| were called has terminated, so that any
29 // thread-local destructors have been executed.
30 base::NativeLibrary LoadNativeApplication(const base::FilePath& app_path);
32 // Runs the native Mojo application from the DSO that was loaded using
33 // |LoadNativeApplication()|; this tolerates |app_library| being null. This
34 // should be called on the same thread as |LoadNativeApplication()|. Returns
35 // true if |MojoMain()| was called (even if it returns an error), and false
36 // otherwise.
37 // TODO(vtl): Maybe this should also have a |MojoResult| as an out parameter?
38 bool RunNativeApplication(base::NativeLibrary app_library,
39 InterfaceRequest<Application> application_request);
41 } // namespace runner
42 } // namespace mojo
44 #endif // MOJO_RUNNER_NATIVE_APPLICATION_SUPPORT_H_