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

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

Issue 1630823002: Move mojo/runner to mojo/shell/standalone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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/shell/standalone/scoped_user_data_dir.h ('k') | mojo/shell/standalone/shell_apptest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/runner/scoped_user_data_dir.h" 5 #include "mojo/shell/standalone/scoped_user_data_dir.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "mojo/runner/switches.h" 9 #include "mojo/shell/standalone/switches.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 namespace runner { 12 namespace shell {
13 13
14 ScopedUserDataDir::ScopedUserDataDir() { 14 ScopedUserDataDir::ScopedUserDataDir() {
15 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 15 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
16 if (!command_line->HasSwitch(switches::kUseTemporaryUserDataDir)) 16 if (!command_line->HasSwitch(switches::kUseTemporaryUserDataDir))
17 return; 17 return;
18 18
19 if (command_line->HasSwitch(switches::kUserDataDir)) { 19 if (command_line->HasSwitch(switches::kUserDataDir)) {
20 // User should not specify a --user-data-dir manually when using 20 // User should not specify a --user-data-dir manually when using
21 // --use-temporary-user-data-dir. The point of the flag is to let the 21 // --use-temporary-user-data-dir. The point of the flag is to let the
22 // mojo runner process manage the lifetime of the user data dir. 22 // mojo runner process manage the lifetime of the user data dir.
23 LOG(ERROR) << "Ignoring request to --use-temporary-user-data-dir because " 23 LOG(ERROR) << "Ignoring request to --use-temporary-user-data-dir because "
24 << "--user-data-dir was also specified."; 24 << "--user-data-dir was also specified.";
25 return; 25 return;
26 } 26 }
27 27
28 if (!temp_dir_.CreateUniqueTempDir()) { 28 if (!temp_dir_.CreateUniqueTempDir()) {
29 LOG(ERROR) << "Failed to create a temporary user data dir."; 29 LOG(ERROR) << "Failed to create a temporary user data dir.";
30 return; 30 return;
31 } 31 }
32 32
33 command_line->AppendSwitchPath(switches::kUserDataDir, temp_dir_.path()); 33 command_line->AppendSwitchPath(switches::kUserDataDir, temp_dir_.path());
34 } 34 }
35 35
36 ScopedUserDataDir::~ScopedUserDataDir() { 36 ScopedUserDataDir::~ScopedUserDataDir() {}
37 }
38 37
39 } // namespace runner 38 } // namespace shell
40 } // namespace mojo 39 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/standalone/scoped_user_data_dir.h ('k') | mojo/shell/standalone/shell_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698