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

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

Issue 1107233002: Move runner stuff into a runner namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 7 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
« no previous file with comments | « mojo/runner/child_process_host_unittest.cc ('k') | mojo/runner/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_RUNNER_CONTEXT_H_ 5 #ifndef MOJO_RUNNER_CONTEXT_H_
6 #define MOJO_RUNNER_CONTEXT_H_ 6 #define MOJO_RUNNER_CONTEXT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "mojo/edk/embedder/process_delegate.h" 11 #include "mojo/edk/embedder/process_delegate.h"
12 #include "mojo/runner/task_runners.h" 12 #include "mojo/runner/task_runners.h"
13 #include "mojo/runner/url_resolver.h" 13 #include "mojo/runner/url_resolver.h"
14 #include "mojo/shell/application_manager.h" 14 #include "mojo/shell/application_manager.h"
15 15
16 namespace mojo { 16 namespace mojo {
17 namespace shell { 17 namespace runner {
18 18
19 class NativeApplicationLoader; 19 class NativeApplicationLoader;
20 20
21 // The "global" context for the shell's main process. 21 // The "global" context for the shell's main process.
22 class Context : public ApplicationManager::Delegate, 22 class Context : public shell::ApplicationManager::Delegate,
23 public embedder::ProcessDelegate { 23 public embedder::ProcessDelegate {
24 public: 24 public:
25 Context(); 25 Context();
26 ~Context() override; 26 ~Context() override;
27 27
28 static void EnsureEmbedderIsInitialized(); 28 static void EnsureEmbedderIsInitialized();
29 29
30 // Point to the directory containing installed services, such as the network 30 // Point to the directory containing installed services, such as the network
31 // service. By default this directory is used as the base URL for resolving 31 // service. By default this directory is used as the base URL for resolving
32 // unknown mojo: URLs. The network service will be loaded from this directory, 32 // unknown mojo: URLs. The network service will be loaded from this directory,
(...skipping 16 matching lines...) Expand all
49 // which must remain alive until after Shutdown() is called. Returns true on 49 // which must remain alive until after Shutdown() is called. Returns true on
50 // success. 50 // success.
51 bool Init(); 51 bool Init();
52 52
53 // If Init() was called and succeeded, this must be called before destruction. 53 // If Init() was called and succeeded, this must be called before destruction.
54 void Shutdown(); 54 void Shutdown();
55 55
56 void Run(const GURL& url); 56 void Run(const GURL& url);
57 57
58 TaskRunners* task_runners() { return task_runners_.get(); } 58 TaskRunners* task_runners() { return task_runners_.get(); }
59 ApplicationManager* application_manager() { return &application_manager_; } 59 shell::ApplicationManager* application_manager() {
60 return &application_manager_;
61 }
60 URLResolver* url_resolver() { return &url_resolver_; } 62 URLResolver* url_resolver() { return &url_resolver_; }
61 63
62 private: 64 private:
63 class NativeViewportApplicationLoader; 65 class NativeViewportApplicationLoader;
64 66
65 // ApplicationManager::Delegate overrides. 67 // ApplicationManager::Delegate overrides.
66 GURL ResolveMappings(const GURL& url) override; 68 GURL ResolveMappings(const GURL& url) override;
67 GURL ResolveMojoURL(const GURL& url) override; 69 GURL ResolveMojoURL(const GURL& url) override;
68 70
69 // ProcessDelegate implementation. 71 // ProcessDelegate implementation.
70 void OnShutdownComplete() override; 72 void OnShutdownComplete() override;
71 73
72 void OnApplicationEnd(const GURL& url); 74 void OnApplicationEnd(const GURL& url);
73 75
74 std::set<GURL> app_urls_; 76 std::set<GURL> app_urls_;
75 scoped_ptr<TaskRunners> task_runners_; 77 scoped_ptr<TaskRunners> task_runners_;
76 ApplicationManager application_manager_; 78 shell::ApplicationManager application_manager_;
77 URLResolver url_resolver_; 79 URLResolver url_resolver_;
78 GURL shell_file_root_; 80 GURL shell_file_root_;
79 GURL command_line_cwd_; 81 GURL command_line_cwd_;
80 82
81 DISALLOW_COPY_AND_ASSIGN(Context); 83 DISALLOW_COPY_AND_ASSIGN(Context);
82 }; 84 };
83 85
84 } // namespace shell 86 } // namespace runner
85 } // namespace mojo 87 } // namespace mojo
86 88
87 #endif // MOJO_RUNNER_CONTEXT_H_ 89 #endif // MOJO_RUNNER_CONTEXT_H_
OLDNEW
« no previous file with comments | « mojo/runner/child_process_host_unittest.cc ('k') | mojo/runner/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698