Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: mojo/shell/context.h

Issue 323593002: Mojo: Use network service to load non-local Mojo Apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/shell/app_child_process_host.cc ('k') | mojo/shell/context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "mojo/shell/keep_alive.h" 11 #include "mojo/shell/keep_alive.h"
12 #include "mojo/shell/loader.h" 12 #include "mojo/shell/mojo_url_resolver.h"
13 #include "mojo/shell/storage.h"
14 #include "mojo/shell/task_runners.h" 13 #include "mojo/shell/task_runners.h"
15 14
16 #if defined(OS_ANDROID) 15 #if defined(OS_ANDROID)
17 #include "base/android/scoped_java_ref.h" 16 #include "base/android/scoped_java_ref.h"
18 #endif // defined(OS_ANDROID) 17 #endif // defined(OS_ANDROID)
19 18
20 namespace mojo { 19 namespace mojo {
21 20
22 class Spy; 21 class Spy;
23 22
24 namespace shell { 23 namespace shell {
25 24
26 class DynamicServiceLoader; 25 class DynamicServiceLoader;
27 26
28 // The "global" context for the shell's main process. 27 // The "global" context for the shell's main process.
29 class Context { 28 class Context {
30 public: 29 public:
31 Context(); 30 Context();
32 ~Context(); 31 ~Context();
33 32
34 const std::string& mojo_origin() const { return mojo_origin_; }
35 void set_mojo_origin(const std::string& mojo_origin) {
36 mojo_origin_ = mojo_origin;
37 }
38
39 TaskRunners* task_runners() { return &task_runners_; } 33 TaskRunners* task_runners() { return &task_runners_; }
40 Storage* storage() { return &storage_; }
41 Loader* loader() { return &loader_; }
42 ServiceManager* service_manager() { return &service_manager_; } 34 ServiceManager* service_manager() { return &service_manager_; }
43 KeepAliveCounter* keep_alive_counter() { return &keep_alive_counter_; } 35 KeepAliveCounter* keep_alive_counter() { return &keep_alive_counter_; }
36 MojoURLResolver* mojo_url_resolver() { return &mojo_url_resolver_; }
44 37
45 #if defined(OS_ANDROID) 38 #if defined(OS_ANDROID)
46 jobject activity() const { return activity_.obj(); } 39 jobject activity() const { return activity_.obj(); }
47 void set_activity(jobject activity) { activity_.Reset(NULL, activity); } 40 void set_activity(jobject activity) { activity_.Reset(NULL, activity); }
48 #endif // defined(OS_ANDROID) 41 #endif // defined(OS_ANDROID)
49 42
50 private: 43 private:
51 class NativeViewportServiceLoader; 44 class NativeViewportServiceLoader;
52 45
53 std::string mojo_origin_;
54
55 TaskRunners task_runners_; 46 TaskRunners task_runners_;
56 Storage storage_;
57 Loader loader_;
58 ServiceManager service_manager_; 47 ServiceManager service_manager_;
48 MojoURLResolver mojo_url_resolver_;
59 scoped_ptr<Spy> spy_; 49 scoped_ptr<Spy> spy_;
60 #if defined(OS_ANDROID) 50 #if defined(OS_ANDROID)
61 base::android::ScopedJavaGlobalRef<jobject> activity_; 51 base::android::ScopedJavaGlobalRef<jobject> activity_;
62 #endif // defined(OS_ANDROID) 52 #endif // defined(OS_ANDROID)
63 53
64 KeepAliveCounter keep_alive_counter_; 54 KeepAliveCounter keep_alive_counter_;
65 55
66 DISALLOW_COPY_AND_ASSIGN(Context); 56 DISALLOW_COPY_AND_ASSIGN(Context);
67 }; 57 };
68 58
69 } // namespace shell 59 } // namespace shell
70 } // namespace mojo 60 } // namespace mojo
71 61
72 #endif // MOJO_SHELL_CONTEXT_H_ 62 #endif // MOJO_SHELL_CONTEXT_H_
OLDNEW
« no previous file with comments | « mojo/shell/app_child_process_host.cc ('k') | mojo/shell/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698