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

Side by Side Diff: mojo/runner/desktop/launcher_process.cc

Issue 1459453003: mandoline: write this after lunch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TracingImpls to mus and mash, fix naming. Created 5 years, 1 month 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 | « mash/wm/window_manager_application.cc ('k') | mojo/services/network/BUILD.gn » ('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 #include <stdio.h> 5 #include <stdio.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <iostream> 9 #include <iostream>
10 10
11 #include "base/base_switches.h" 11 #include "base/base_switches.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/path_service.h" 16 #include "base/path_service.h"
17 #include "base/synchronization/waitable_event.h" 17 #include "base/synchronization/waitable_event.h"
18 #include "base/threading/platform_thread.h"
18 #include "mojo/runner/context.h" 19 #include "mojo/runner/context.h"
19 #include "mojo/runner/switches.h" 20 #include "mojo/runner/switches.h"
20 #include "mojo/shell/switches.h" 21 #include "mojo/shell/switches.h"
21 22
22 namespace mojo { 23 namespace mojo {
23 namespace runner { 24 namespace runner {
24 25
25 int LauncherProcessMain(const GURL& mojo_url, const base::Closure& callback) { 26 int LauncherProcessMain(const GURL& mojo_url, const base::Closure& callback) {
26 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 27 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
27 if (!command_line->HasSwitch(switches::kMojoSingleProcess) && 28 if (!command_line->HasSwitch(switches::kMojoSingleProcess) &&
28 !command_line->HasSwitch("gtest_list_tests")) 29 !command_line->HasSwitch("gtest_list_tests"))
29 command_line->AppendSwitch(switches::kEnableMultiprocess); 30 command_line->AppendSwitch(switches::kEnableMultiprocess);
30 command_line->AppendSwitch("use-new-edk"); 31 command_line->AppendSwitch("use-new-edk");
31 // http://crbug.com/546644 32 // http://crbug.com/546644
32 command_line->AppendSwitch(switches::kMojoNoSandbox); 33 command_line->AppendSwitch(switches::kMojoNoSandbox);
33 34
35 base::PlatformThread::SetName("mojo_runner");
36
34 // We want the shell::Context to outlive the MessageLoop so that pipes are 37 // We want the shell::Context to outlive the MessageLoop so that pipes are
35 // all gracefully closed / error-out before we try to shut the Context down. 38 // all gracefully closed / error-out before we try to shut the Context down.
36 Context shell_context; 39 Context shell_context;
37 { 40 {
38 base::MessageLoop message_loop; 41 base::MessageLoop message_loop;
39 base::FilePath shell_dir; 42 base::FilePath shell_dir;
40 PathService::Get(base::DIR_MODULE, &shell_dir); 43 PathService::Get(base::DIR_MODULE, &shell_dir);
41 if (!shell_context.Init(shell_dir)) 44 if (!shell_context.Init(shell_dir))
42 return 0; 45 return 0;
43 46
(...skipping 12 matching lines...) Expand all
56 59
57 // Must be called before |message_loop| is destroyed. 60 // Must be called before |message_loop| is destroyed.
58 shell_context.Shutdown(); 61 shell_context.Shutdown();
59 } 62 }
60 63
61 return 0; 64 return 0;
62 } 65 }
63 66
64 } // namespace runner 67 } // namespace runner
65 } // namespace mojo 68 } // namespace mojo
OLDNEW
« no previous file with comments | « mash/wm/window_manager_application.cc ('k') | mojo/services/network/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698