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