OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CONTEXT_H_ | 5 #ifndef MOJO_SHELL_CONTEXT_H_ |
6 #define MOJO_SHELL_CONTEXT_H_ | 6 #define MOJO_SHELL_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "mojo/service_manager/service_manager.h" | 10 #include "mojo/service_manager/service_manager.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 namespace shell { | 23 namespace shell { |
24 | 24 |
25 class DynamicServiceLoader; | 25 class DynamicServiceLoader; |
26 | 26 |
27 // The "global" context for the shell's main process. | 27 // The "global" context for the shell's main process. |
28 class Context { | 28 class Context { |
29 public: | 29 public: |
30 Context(); | 30 Context(); |
31 ~Context(); | 31 ~Context(); |
32 | 32 |
| 33 // Tear down context in safe order prior to deleting. Shutdown() is also |
| 34 // called by the destructor. |
| 35 void Shutdown(); |
| 36 |
33 TaskRunners* task_runners() { return &task_runners_; } | 37 TaskRunners* task_runners() { return &task_runners_; } |
34 ServiceManager* service_manager() { return &service_manager_; } | 38 ServiceManager* service_manager() { return &service_manager_; } |
35 KeepAliveCounter* keep_alive_counter() { return &keep_alive_counter_; } | 39 KeepAliveCounter* keep_alive_counter() { return &keep_alive_counter_; } |
36 MojoURLResolver* mojo_url_resolver() { return &mojo_url_resolver_; } | 40 MojoURLResolver* mojo_url_resolver() { return &mojo_url_resolver_; } |
37 | 41 |
38 #if defined(OS_ANDROID) | 42 #if defined(OS_ANDROID) |
39 jobject activity() const { return activity_.obj(); } | 43 jobject activity() const { return activity_.obj(); } |
40 void set_activity(jobject activity) { activity_.Reset(NULL, activity); } | 44 void set_activity(jobject activity) { activity_.Reset(NULL, activity); } |
41 base::MessageLoop* ui_loop() const { return ui_loop_; } | 45 base::MessageLoop* ui_loop() const { return ui_loop_; } |
42 void set_ui_loop(base::MessageLoop* ui_loop) { ui_loop_ = ui_loop; } | 46 void set_ui_loop(base::MessageLoop* ui_loop) { ui_loop_ = ui_loop; } |
(...skipping 13 matching lines...) Expand all Loading... |
56 | 60 |
57 KeepAliveCounter keep_alive_counter_; | 61 KeepAliveCounter keep_alive_counter_; |
58 | 62 |
59 DISALLOW_COPY_AND_ASSIGN(Context); | 63 DISALLOW_COPY_AND_ASSIGN(Context); |
60 }; | 64 }; |
61 | 65 |
62 } // namespace shell | 66 } // namespace shell |
63 } // namespace mojo | 67 } // namespace mojo |
64 | 68 |
65 #endif // MOJO_SHELL_CONTEXT_H_ | 69 #endif // MOJO_SHELL_CONTEXT_H_ |
OLD | NEW |