| 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 "services/files/files_impl.h" | 5 #include "services/files/files_impl.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 DCHECK(temp_dir); | 72 DCHECK(temp_dir); |
| 73 } else if (file_system.get() == std::string("debug")) { | 73 } else if (file_system.get() == std::string("debug")) { |
| 74 #ifdef NDEBUG | 74 #ifdef NDEBUG |
| 75 LOG(WARNING) << "~/MojoDebug only available in Debug builds"; | 75 LOG(WARNING) << "~/MojoDebug only available in Debug builds"; |
| 76 #else | 76 #else |
| 77 // TODO(vtl): ScopedGeneric (hence ScopedFD) doesn't have an operator=! | 77 // TODO(vtl): ScopedGeneric (hence ScopedFD) doesn't have an operator=! |
| 78 dir_fd.reset(OpenMojoDebugDirectory().release()); | 78 dir_fd.reset(OpenMojoDebugDirectory().release()); |
| 79 #endif | 79 #endif |
| 80 if (!dir_fd.is_valid()) { | 80 if (!dir_fd.is_valid()) { |
| 81 LOG(ERROR) << "~/MojoDebug unavailable"; | 81 LOG(ERROR) << "~/MojoDebug unavailable"; |
| 82 callback.Run(ERROR_UNAVAILABLE); | 82 callback.Run(Error::UNAVAILABLE); |
| 83 return; | 83 return; |
| 84 } | 84 } |
| 85 } else { | 85 } else { |
| 86 LOG(ERROR) << "Unknown file system: " << file_system.get(); | 86 LOG(ERROR) << "Unknown file system: " << file_system.get(); |
| 87 callback.Run(ERROR_UNIMPLEMENTED); | 87 callback.Run(Error::UNIMPLEMENTED); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 | 90 |
| 91 new DirectoryImpl(directory.Pass(), dir_fd.Pass(), temp_dir.Pass()); | 91 new DirectoryImpl(directory.Pass(), dir_fd.Pass(), temp_dir.Pass()); |
| 92 callback.Run(ERROR_OK); | 92 callback.Run(Error::OK); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace files | 95 } // namespace files |
| 96 } // namespace mojo | 96 } // namespace mojo |
| OLD | NEW |