OLD | NEW |
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_impl.h" | 5 #include "components/filesystem/file_system_impl.h" |
6 | 6 |
| 7 #include <fcntl.h> |
| 8 #include <stdlib.h> |
| 9 #include <sys/stat.h> |
| 10 #include <sys/types.h> |
| 11 #include <unistd.h> |
| 12 |
7 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
8 #include "base/files/scoped_file.h" | 14 #include "base/files/scoped_file.h" |
9 #include "base/files/scoped_temp_dir.h" | 15 #include "base/files/scoped_temp_dir.h" |
10 #include "base/logging.h" | 16 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
12 #include "components/filesystem/directory_impl.h" | 18 #include "components/filesystem/directory_impl.h" |
13 #include "mojo/application/public/cpp/application_connection.h" | 19 #include "mojo/application/public/cpp/application_connection.h" |
14 | 20 |
15 namespace filesystem { | 21 namespace filesystem { |
16 | 22 |
(...skipping 16 matching lines...) Expand all Loading... |
33 temp_dir.reset(new base::ScopedTempDir); | 39 temp_dir.reset(new base::ScopedTempDir); |
34 CHECK(temp_dir->CreateUniqueTempDir()); | 40 CHECK(temp_dir->CreateUniqueTempDir()); |
35 path = temp_dir->path(); | 41 path = temp_dir->path(); |
36 } else if (file_system.get() == std::string("origin")) { | 42 } else if (file_system.get() == std::string("origin")) { |
37 // TODO(erg): We should serve a persistent directory based on the | 43 // TODO(erg): We should serve a persistent directory based on the |
38 // subdirectory |remote_application_url_| of a profile directory. | 44 // subdirectory |remote_application_url_| of a profile directory. |
39 } | 45 } |
40 | 46 |
41 if (!path.empty()) { | 47 if (!path.empty()) { |
42 new DirectoryImpl(directory.Pass(), path, temp_dir.Pass()); | 48 new DirectoryImpl(directory.Pass(), path, temp_dir.Pass()); |
43 callback.Run(FILE_ERROR_OK); | 49 callback.Run(ERROR_OK); |
44 } else { | 50 } else { |
45 callback.Run(FILE_ERROR_FAILED); | 51 callback.Run(ERROR_FAILED); |
46 } | 52 } |
47 } | 53 } |
48 | 54 |
49 } // namespace filesystem | 55 } // namespace filesystem |
OLD | NEW |