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

Side by Side Diff: mojo/shell/standalone/context.cc

Issue 1667273002: Creates BackgroundShell and uses it in test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android Created 4 years, 10 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 #include "mojo/shell/standalone/context.h" 5 #include "mojo/shell/standalone/context.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/i18n/icu_util.h"
17 #include "base/lazy_instance.h" 16 #include "base/lazy_instance.h"
18 #include "base/macros.h" 17 #include "base/macros.h"
19 #include "base/memory/scoped_ptr.h" 18 #include "base/memory/scoped_ptr.h"
20 #include "base/path_service.h" 19 #include "base/path_service.h"
21 #include "base/process/process_info.h" 20 #include "base/process/process_info.h"
22 #include "base/run_loop.h" 21 #include "base/run_loop.h"
23 #include "base/strings/string_number_conversions.h" 22 #include "base/strings/string_number_conversions.h"
24 #include "base/strings/string_split.h" 23 #include "base/strings/string_split.h"
25 #include "base/strings/string_util.h" 24 #include "base/strings/string_util.h"
26 #include "base/trace_event/trace_event.h" 25 #include "base/trace_event/trace_event.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 *base::CommandLine::ForCurrentProcess(); 191 *base::CommandLine::ForCurrentProcess();
193 192
194 bool trace_startup = command_line.HasSwitch(switches::kTraceStartup); 193 bool trace_startup = command_line.HasSwitch(switches::kTraceStartup);
195 if (trace_startup) { 194 if (trace_startup) {
196 tracer_.Start( 195 tracer_.Start(
197 command_line.GetSwitchValueASCII(switches::kTraceStartup), 196 command_line.GetSwitchValueASCII(switches::kTraceStartup),
198 command_line.GetSwitchValueASCII(switches::kTraceStartupDuration), 197 command_line.GetSwitchValueASCII(switches::kTraceStartupDuration),
199 "mojo_runner.trace"); 198 "mojo_runner.trace");
200 } 199 }
201 200
202 // ICU data is a thing every part of the system needs. This here warms
203 // up the copy of ICU in the mojo runner.
204 CHECK(base::i18n::InitializeICU());
205
206 EnsureEmbedderIsInitialized(); 201 EnsureEmbedderIsInitialized();
207 task_runners_.reset( 202 task_runners_.reset(
208 new TaskRunners(base::MessageLoop::current()->task_runner())); 203 new TaskRunners(base::MessageLoop::current()->task_runner()));
209 204
210 // TODO(vtl): This should be MASTER, not NONE. 205 // TODO(vtl): This should be MASTER, not NONE.
211 embedder::InitIPCSupport(embedder::ProcessType::NONE, this, 206 embedder::InitIPCSupport(embedder::ProcessType::NONE, this,
212 task_runners_->io_runner(), 207 task_runners_->io_runner(),
213 embedder::ScopedPlatformHandle()); 208 embedder::ScopedPlatformHandle());
214 209
215 package_manager_ = new PackageManagerImpl( 210 package_manager_ = new PackageManagerImpl(
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 base::MessageLoop::current()->QuitWhenIdle(); 333 base::MessageLoop::current()->QuitWhenIdle();
339 } else { 334 } else {
340 app_complete_callback_.Run(); 335 app_complete_callback_.Run();
341 } 336 }
342 } 337 }
343 } 338 }
344 } 339 }
345 340
346 } // namespace shell 341 } // namespace shell
347 } // namespace mojo 342 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/standalone/android/main.cc ('k') | mojo/shell/standalone/desktop/launcher_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698