| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/chromeos/fileapi/remote_file_system_operation.h" | 5 #include "webkit/chromeos/fileapi/remote_file_system_operation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 const base::Time& last_access_time, | 150 const base::Time& last_access_time, |
| 151 const base::Time& last_modified_time, | 151 const base::Time& last_modified_time, |
| 152 const StatusCallback& callback) { | 152 const StatusCallback& callback) { |
| 153 NOTIMPLEMENTED(); | 153 NOTIMPLEMENTED(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void RemoteFileSystemOperation::OpenFile(const FileSystemURL& url, | 156 void RemoteFileSystemOperation::OpenFile(const FileSystemURL& url, |
| 157 int file_flags, | 157 int file_flags, |
| 158 base::ProcessHandle peer_handle, | 158 base::ProcessHandle peer_handle, |
| 159 const OpenFileCallback& callback) { | 159 const OpenFileCallback& callback) { |
| 160 // TODO(zelidrag): Implement file write operations. | |
| 161 if ((file_flags & base::PLATFORM_FILE_CREATE) || | |
| 162 (file_flags & base::PLATFORM_FILE_WRITE) || | |
| 163 (file_flags & base::PLATFORM_FILE_EXCLUSIVE_WRITE) || | |
| 164 (file_flags & base::PLATFORM_FILE_CREATE_ALWAYS) || | |
| 165 (file_flags & base::PLATFORM_FILE_OPEN_TRUNCATED) || | |
| 166 (file_flags & base::PLATFORM_FILE_DELETE_ON_CLOSE)) { | |
| 167 NOTIMPLEMENTED() << "File write operations not supported " << url.spec(); | |
| 168 return; | |
| 169 } | |
| 170 DCHECK(SetPendingOperationType(kOperationOpenFile)); | 160 DCHECK(SetPendingOperationType(kOperationOpenFile)); |
| 171 remote_proxy_->OpenFile( | 161 remote_proxy_->OpenFile( |
| 172 url, | 162 url, |
| 173 file_flags, | 163 file_flags, |
| 174 peer_handle, | 164 peer_handle, |
| 175 base::Bind(&RemoteFileSystemOperation::DidOpenFile, | 165 base::Bind(&RemoteFileSystemOperation::DidOpenFile, |
| 176 base::Owned(this), callback)); | 166 base::Owned(this), callback)); |
| 177 } | 167 } |
| 178 | 168 |
| 179 void RemoteFileSystemOperation::NotifyCloseFile( | 169 void RemoteFileSystemOperation::NotifyCloseFile( |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 268 |
| 279 void RemoteFileSystemOperation::DidOpenFile( | 269 void RemoteFileSystemOperation::DidOpenFile( |
| 280 const OpenFileCallback& callback, | 270 const OpenFileCallback& callback, |
| 281 base::PlatformFileError result, | 271 base::PlatformFileError result, |
| 282 base::PlatformFile file, | 272 base::PlatformFile file, |
| 283 base::ProcessHandle peer_handle) { | 273 base::ProcessHandle peer_handle) { |
| 284 callback.Run(result, file, peer_handle); | 274 callback.Run(result, file, peer_handle); |
| 285 } | 275 } |
| 286 | 276 |
| 287 } // namespace chromeos | 277 } // namespace chromeos |
| OLD | NEW |