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

Side by Side Diff: shell/context.h

Issue 1364243002: Bundle core applicatons in the shell. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 3 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 | « shell/android/url_response_disk_cache_delegate_impl.cc ('k') | 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 SHELL_CONTEXT_H_ 5 #ifndef SHELL_CONTEXT_H_
6 #define SHELL_CONTEXT_H_ 6 #define SHELL_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/master_process_delegate.h" 11 #include "mojo/edk/embedder/master_process_delegate.h"
12 #include "shell/application_manager/application_manager.h" 12 #include "shell/application_manager/application_manager.h"
13 #include "shell/task_runners.h" 13 #include "shell/task_runners.h"
14 #include "shell/url_resolver.h" 14 #include "shell/url_resolver.h"
15 15
16 namespace mojo {
17 class URLResponseDiskCacheDelegate;
18 }
19
16 namespace shell { 20 namespace shell {
17 class Tracer; 21 class Tracer;
18 22
19 // The "global" context for the shell's main process. 23 // The "global" context for the shell's main process.
20 class Context : public ApplicationManager::Delegate, 24 class Context : public ApplicationManager::Delegate,
21 public mojo::embedder::MasterProcessDelegate { 25 public mojo::embedder::MasterProcessDelegate {
22 public: 26 public:
23 explicit Context(Tracer* tracer = nullptr); 27 explicit Context(Tracer* tracer = nullptr);
24 ~Context() override; 28 ~Context() override;
25 29
(...skipping 15 matching lines...) Expand all
41 45
42 // Resolve an URL relative to the CWD mojo_shell was invoked from. This is a 46 // Resolve an URL relative to the CWD mojo_shell was invoked from. This is a
43 // nop for everything but relative file URLs or URLs without a scheme. 47 // nop for everything but relative file URLs or URLs without a scheme.
44 GURL ResolveCommandLineURL(const std::string& path); 48 GURL ResolveCommandLineURL(const std::string& path);
45 49
46 // This must be called with a message loop set up for the current thread, 50 // This must be called with a message loop set up for the current thread,
47 // which must remain alive until after Shutdown() is called. Returns true on 51 // which must remain alive until after Shutdown() is called. Returns true on
48 // success. 52 // success.
49 bool Init(); 53 bool Init();
50 54
51 // Like Init(), but specifies |mojo_shell_child_path()| explicitly. 55 // Like Init(), but specifies |mojo_shell_child_path()| explicitly. Also
52 bool InitWithPaths(const base::FilePath& shell_child_path); 56 // allows to set a delegate for the application offline cache.
57 bool InitWithPaths(
58 const base::FilePath& shell_child_path,
59 mojo::URLResponseDiskCacheDelegate* url_response_disk_cache_delegate);
53 60
54 // If Init() was called and succeeded, this must be called before destruction. 61 // If Init() was called and succeeded, this must be called before destruction.
55 void Shutdown(); 62 void Shutdown();
56 63
57 void Run(const GURL& url); 64 void Run(const GURL& url);
58 65
59 ApplicationManager* application_manager() { return &application_manager_; } 66 ApplicationManager* application_manager() { return &application_manager_; }
60 URLResolver* url_resolver() { return &url_resolver_; } 67 URLResolver* url_resolver() { return &url_resolver_; }
61 68
62 // Available after Init(): 69 // Available after Init():
(...skipping 26 matching lines...) Expand all
89 std::set<GURL> app_urls_; 96 std::set<GURL> app_urls_;
90 GURL shell_file_root_; 97 GURL shell_file_root_;
91 GURL command_line_cwd_; 98 GURL command_line_cwd_;
92 99
93 DISALLOW_COPY_AND_ASSIGN(Context); 100 DISALLOW_COPY_AND_ASSIGN(Context);
94 }; 101 };
95 102
96 } // namespace shell 103 } // namespace shell
97 104
98 #endif // SHELL_CONTEXT_H_ 105 #endif // SHELL_CONTEXT_H_
OLDNEW
« no previous file with comments | « shell/android/url_response_disk_cache_delegate_impl.cc ('k') | shell/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698