| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef SERVICES_SHELL_RUNNER_HOST_NATIVE_APPLICATION_SUPPORT_H_ | |
| 6 #define SERVICES_SHELL_RUNNER_HOST_NATIVE_APPLICATION_SUPPORT_H_ | |
| 7 | |
| 8 #include "base/native_library.h" | |
| 9 #include "mojo/public/cpp/bindings/interface_request.h" | |
| 10 #include "services/shell/public/interfaces/service.mojom.h" | |
| 11 | |
| 12 namespace base { | |
| 13 class FilePath; | |
| 14 } | |
| 15 | |
| 16 namespace shell { | |
| 17 | |
| 18 // Loads the native Mojo application from the DSO specified by |app_path|. | |
| 19 // Returns the |base::NativeLibrary| for the application on success (or null on | |
| 20 // failure). | |
| 21 // | |
| 22 // Note: The caller may choose to eventually unload the returned DSO. If so, | |
| 23 // this should be done only after the thread on which |LoadNativeApplication()| | |
| 24 // and |RunNativeApplication()| were called has terminated, so that any | |
| 25 // thread-local destructors have been executed. | |
| 26 base::NativeLibrary LoadNativeApplication(const base::FilePath& app_path); | |
| 27 | |
| 28 // Runs the native Mojo application from the DSO that was loaded using | |
| 29 // |LoadNativeApplication()|; this tolerates |app_library| being null. This | |
| 30 // should be called on the same thread as |LoadNativeApplication()|. Returns | |
| 31 // true if |ServiceMain()| was called (even if it returns an error), and false | |
| 32 // otherwise. | |
| 33 bool RunNativeApplication(base::NativeLibrary app_library, | |
| 34 mojom::ServiceRequest request); | |
| 35 | |
| 36 } // namespace shell | |
| 37 | |
| 38 #endif // SERVICES_SHELL_RUNNER_HOST_NATIVE_APPLICATION_SUPPORT_H_ | |
| OLD | NEW |