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

Side by Side Diff: shell/context.h

Issue 1105773002: Teach the mojo_shell --trace-startup flag to gather data from services (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: buffer data from tracing service to avoid needing to frame it or add extra commas 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
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/process_delegate.h" 11 #include "mojo/edk/embedder/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 shell { 16 namespace shell {
17 17 class Tracer;
18 class NativeApplicationLoader;
19 18
20 // The "global" context for the shell's main process. 19 // The "global" context for the shell's main process.
21 class Context : public ApplicationManager::Delegate, 20 class Context : public ApplicationManager::Delegate,
22 public mojo::embedder::ProcessDelegate { 21 public mojo::embedder::ProcessDelegate {
23 public: 22 public:
24 Context(); 23 explicit Context(Tracer* tracer = nullptr);
25 ~Context() override; 24 ~Context() override;
26 25
27 static void EnsureEmbedderIsInitialized(); 26 static void EnsureEmbedderIsInitialized();
28 27
29 // Point to the directory containing installed services, such as the network 28 // Point to the directory containing installed services, such as the network
30 // service. By default this directory is used as the base URL for resolving 29 // service. By default this directory is used as the base URL for resolving
31 // unknown mojo: URLs. The network service will be loaded from this directory, 30 // unknown mojo: URLs. The network service will be loaded from this directory,
32 // even when the base URL for unknown mojo: URLs is overridden. 31 // even when the base URL for unknown mojo: URLs is overridden.
33 void SetShellFileRoot(const base::FilePath& path); 32 void SetShellFileRoot(const base::FilePath& path);
34 33
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 71
73 // ApplicationManager::Delegate overrides. 72 // ApplicationManager::Delegate overrides.
74 GURL ResolveURL(const GURL& url) override; 73 GURL ResolveURL(const GURL& url) override;
75 GURL ResolveMappings(const GURL& url) override; 74 GURL ResolveMappings(const GURL& url) override;
76 75
77 // ProcessDelegate implementation. 76 // ProcessDelegate implementation.
78 void OnShutdownComplete() override; 77 void OnShutdownComplete() override;
79 78
80 void OnApplicationEnd(const GURL& url); 79 void OnApplicationEnd(const GURL& url);
81 80
81 Tracer* const tracer_;
82 ApplicationManager application_manager_; 82 ApplicationManager application_manager_;
83 URLResolver url_resolver_; 83 URLResolver url_resolver_;
84 84
85 base::FilePath mojo_shell_child_path_; 85 base::FilePath mojo_shell_child_path_;
86 scoped_ptr<TaskRunners> task_runners_; 86 scoped_ptr<TaskRunners> task_runners_;
87 87
88 std::set<GURL> app_urls_; 88 std::set<GURL> app_urls_;
89 GURL shell_file_root_; 89 GURL shell_file_root_;
90 GURL command_line_cwd_; 90 GURL command_line_cwd_;
91 91
92 DISALLOW_COPY_AND_ASSIGN(Context); 92 DISALLOW_COPY_AND_ASSIGN(Context);
93 }; 93 };
94 94
95 } // namespace shell 95 } // namespace shell
96 96
97 #endif // SHELL_CONTEXT_H_ 97 #endif // SHELL_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698