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

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

Issue 305013015: Mojo: (Mostly) factor out command-line switches from the shell's load code path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/android/mojo_main.cc ('k') | mojo/shell/desktop/mojo_main.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>
9
8 #include "mojo/service_manager/service_manager.h" 10 #include "mojo/service_manager/service_manager.h"
9 #include "mojo/shell/keep_alive.h" 11 #include "mojo/shell/keep_alive.h"
10 #include "mojo/shell/loader.h" 12 #include "mojo/shell/loader.h"
11 #include "mojo/shell/storage.h" 13 #include "mojo/shell/storage.h"
12 #include "mojo/shell/task_runners.h" 14 #include "mojo/shell/task_runners.h"
13 15
14 #if defined(OS_ANDROID) 16 #if defined(OS_ANDROID)
15 #include "base/android/scoped_java_ref.h" 17 #include "base/android/scoped_java_ref.h"
16 #endif // defined(OS_ANDROID) 18 #endif // defined(OS_ANDROID)
17 19
18 namespace mojo { 20 namespace mojo {
19 21
20 class Spy; 22 class Spy;
21 23
22 namespace shell { 24 namespace shell {
23 25
24 class DynamicServiceLoader; 26 class DynamicServiceLoader;
25 27
26 // The "global" context for the shell's main process. 28 // The "global" context for the shell's main process.
27 class Context { 29 class Context {
28 public: 30 public:
29 Context(); 31 Context();
30 ~Context(); 32 ~Context();
31 33
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
32 TaskRunners* task_runners() { return &task_runners_; } 39 TaskRunners* task_runners() { return &task_runners_; }
33 Storage* storage() { return &storage_; } 40 Storage* storage() { return &storage_; }
34 Loader* loader() { return &loader_; } 41 Loader* loader() { return &loader_; }
35 ServiceManager* service_manager() { return &service_manager_; } 42 ServiceManager* service_manager() { return &service_manager_; }
36 KeepAliveCounter* keep_alive_counter() { return &keep_alive_counter_; } 43 KeepAliveCounter* keep_alive_counter() { return &keep_alive_counter_; }
37 44
38 #if defined(OS_ANDROID) 45 #if defined(OS_ANDROID)
39 jobject activity() const { return activity_.obj(); } 46 jobject activity() const { return activity_.obj(); }
40 void set_activity(jobject activity) { activity_.Reset(NULL, activity); } 47 void set_activity(jobject activity) { activity_.Reset(NULL, activity); }
41 #endif // defined(OS_ANDROID) 48 #endif // defined(OS_ANDROID)
42 49
43 private: 50 private:
44 class NativeViewportServiceLoader; 51 class NativeViewportServiceLoader;
52
53 std::string mojo_origin_;
54
45 TaskRunners task_runners_; 55 TaskRunners task_runners_;
46 Storage storage_; 56 Storage storage_;
47 Loader loader_; 57 Loader loader_;
48 ServiceManager service_manager_; 58 ServiceManager service_manager_;
49 scoped_ptr<Spy> spy_; 59 scoped_ptr<Spy> spy_;
50 #if defined(OS_ANDROID) 60 #if defined(OS_ANDROID)
51 base::android::ScopedJavaGlobalRef<jobject> activity_; 61 base::android::ScopedJavaGlobalRef<jobject> activity_;
52 #endif // defined(OS_ANDROID) 62 #endif // defined(OS_ANDROID)
53 63
54 KeepAliveCounter keep_alive_counter_; 64 KeepAliveCounter keep_alive_counter_;
55 65
56 DISALLOW_COPY_AND_ASSIGN(Context); 66 DISALLOW_COPY_AND_ASSIGN(Context);
57 }; 67 };
58 68
59 } // namespace shell 69 } // namespace shell
60 } // namespace mojo 70 } // namespace mojo
61 71
62 #endif // MOJO_SHELL_CONTEXT_H_ 72 #endif // MOJO_SHELL_CONTEXT_H_
OLDNEW
« no previous file with comments | « mojo/shell/android/mojo_main.cc ('k') | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698