OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_SHELL_STATIC_APPLICATION_LOADER_H_ | 5 #ifndef MOJO_SHELL_STATIC_APPLICATION_LOADER_H_ |
6 #define MOJO_SHELL_STATIC_APPLICATION_LOADER_H_ | 6 #define MOJO_SHELL_STATIC_APPLICATION_LOADER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // Constructs a static loader for |factory| with a closure that will be called | 38 // Constructs a static loader for |factory| with a closure that will be called |
39 // when the loaded application quits. | 39 // when the loaded application quits. |
40 StaticApplicationLoader(const ApplicationFactory& factory, | 40 StaticApplicationLoader(const ApplicationFactory& factory, |
41 const base::Closure& quit_callback); | 41 const base::Closure& quit_callback); |
42 | 42 |
43 ~StaticApplicationLoader() override; | 43 ~StaticApplicationLoader() override; |
44 | 44 |
45 // mojo::shell::ApplicationLoader: | 45 // mojo::shell::ApplicationLoader: |
46 void Load(const GURL& url, | 46 void Load(const GURL& url, |
47 InterfaceRequest<mojom::Application> request) override; | 47 InterfaceRequest<mojom::ShellClient> request) override; |
48 | 48 |
49 private: | 49 private: |
50 void StopAppThread(); | 50 void StopAppThread(); |
51 | 51 |
52 // The factory used t create new instances of the application delegate. | 52 // The factory used t create new instances of the application delegate. |
53 ApplicationFactory factory_; | 53 ApplicationFactory factory_; |
54 | 54 |
55 // If not null, this is run when the loaded application quits. | 55 // If not null, this is run when the loaded application quits. |
56 base::Closure quit_callback_; | 56 base::Closure quit_callback_; |
57 | 57 |
58 // Thread for the application if currently running. | 58 // Thread for the application if currently running. |
59 scoped_ptr<base::SimpleThread> thread_; | 59 scoped_ptr<base::SimpleThread> thread_; |
60 | 60 |
61 base::WeakPtrFactory<StaticApplicationLoader> weak_factory_; | 61 base::WeakPtrFactory<StaticApplicationLoader> weak_factory_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(StaticApplicationLoader); | 63 DISALLOW_COPY_AND_ASSIGN(StaticApplicationLoader); |
64 }; | 64 }; |
65 | 65 |
66 } // namespace shell | 66 } // namespace shell |
67 } // namespace mojo | 67 } // namespace mojo |
68 | 68 |
69 #endif // MOJO_SHELL_STATIC_APPLICATION_LOADER_H_ | 69 #endif // MOJO_SHELL_STATIC_APPLICATION_LOADER_H_ |
OLD | NEW |