| 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 #endif // defined(OS_ANDROID) | 45 #endif // defined(OS_ANDROID) |
| 42 | 46 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 53 | 57 |
| 54 KeepAliveCounter keep_alive_counter_; | 58 KeepAliveCounter keep_alive_counter_; |
| 55 | 59 |
| 56 DISALLOW_COPY_AND_ASSIGN(Context); | 60 DISALLOW_COPY_AND_ASSIGN(Context); |
| 57 }; | 61 }; |
| 58 | 62 |
| 59 } // namespace shell | 63 } // namespace shell |
| 60 } // namespace mojo | 64 } // namespace mojo |
| 61 | 65 |
| 62 #endif // MOJO_SHELL_CONTEXT_H_ | 66 #endif // MOJO_SHELL_CONTEXT_H_ |
| OLD | NEW |