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

Side by Side Diff: components/filesystem/file_system_app.cc

Issue 1814223002: Quit the message loop by default in ShellConnectionLost when ApplicationRunner is used (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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 | « components/filesystem/file_system_app.h ('k') | components/font_service/font_service_app.h » ('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 "components/filesystem/file_system_app.h" 5 #include "components/filesystem/file_system_app.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "mojo/shell/public/cpp/connection.h" 10 #include "mojo/shell/public/cpp/connection.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return true; 48 return true;
49 } 49 }
50 50
51 // |InterfaceFactory<Files>| implementation: 51 // |InterfaceFactory<Files>| implementation:
52 void FileSystemApp::Create(mojo::Connection* connection, 52 void FileSystemApp::Create(mojo::Connection* connection,
53 mojo::InterfaceRequest<FileSystem> request) { 53 mojo::InterfaceRequest<FileSystem> request) {
54 new FileSystemImpl(connection, std::move(request), GetUserDataDir(), 54 new FileSystemImpl(connection, std::move(request), GetUserDataDir(),
55 lock_table_.get()); 55 lock_table_.get());
56 } 56 }
57 57
58 void FileSystemApp::ShellConnectionLost() {
59 _exit(1);
60 }
61
62 //static 58 //static
63 base::FilePath FileSystemApp::GetUserDataDir() { 59 base::FilePath FileSystemApp::GetUserDataDir() {
64 base::FilePath path; 60 base::FilePath path;
65 61
66 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 62 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
67 if (command_line->HasSwitch(kUserDataDir)) { 63 if (command_line->HasSwitch(kUserDataDir)) {
68 path = command_line->GetSwitchValuePath(kUserDataDir); 64 path = command_line->GetSwitchValuePath(kUserDataDir);
69 } else { 65 } else {
70 #if defined(OS_WIN) 66 #if defined(OS_WIN)
71 CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &path)); 67 CHECK(PathService::Get(base::DIR_LOCAL_APP_DATA, &path));
(...skipping 12 matching lines...) Expand all
84 path = path.Append(FILE_PATH_LITERAL("filesystem")); 80 path = path.Append(FILE_PATH_LITERAL("filesystem"));
85 } 81 }
86 82
87 if (!base::PathExists(path)) 83 if (!base::PathExists(path))
88 base::CreateDirectory(path); 84 base::CreateDirectory(path);
89 85
90 return path; 86 return path;
91 } 87 }
92 88
93 } // namespace filesystem 89 } // namespace filesystem
OLDNEW
« no previous file with comments | « components/filesystem/file_system_app.h ('k') | components/font_service/font_service_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698