Roll src/third_party/skia d32087a:1052f51
[chromium-blink-merge.git] / mojo / shell / native_runner.h
blobdd48cb343d70abf0933f538f229768c5a159675a
1 // Copyright 2015 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_SHELL_NATIVE_RUNNER_H_
6 #define MOJO_SHELL_NATIVE_RUNNER_H_
8 #include "base/callback_forward.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "mojo/application/public/interfaces/application.mojom.h"
11 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
13 #if defined(OS_WIN)
14 #undef DELETE
15 #endif
17 namespace base {
18 class FilePath;
21 namespace mojo {
22 namespace shell {
24 // ApplicationManager requires implementations of NativeRunner and
25 // NativeRunnerFactory to run native applications.
26 class NativeRunner {
27 public:
28 virtual ~NativeRunner() {}
30 // Loads the app in the file at |app_path| and runs it on some other
31 // thread/process. If |cleanup| is |DELETE|, this takes ownership of the file.
32 // |app_completed_callback| is posted (to the thread on which |Start()| was
33 // called) after |MojoMain()| completes.
34 // TODO(vtl): |app_path| and |cleanup| should probably be moved to the
35 // factory's Create(). Rationale: The factory may need information from the
36 // file to decide what kind of NativeRunner to make.
37 virtual void Start(const base::FilePath& app_path,
38 bool start_sandboxed,
39 InterfaceRequest<Application> application_request,
40 const base::Closure& app_completed_callback) = 0;
43 class NativeRunnerFactory {
44 public:
45 virtual ~NativeRunnerFactory() {}
46 virtual scoped_ptr<NativeRunner> Create() = 0;
49 } // namespace shell
50 } // namespace mojo
52 #endif // MOJO_SHELL_NATIVE_RUNNER_H_