| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/fileapi/file_system_file_util_proxy.h" | 5 #include "webkit/fileapi/file_system_file_util_proxy.h" |
| 6 | 6 |
| 7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
| 8 #include "webkit/fileapi/file_system_context.h" | 8 #include "webkit/fileapi/file_system_context.h" |
| 9 #include "webkit/fileapi/file_system_file_util.h" | 9 #include "webkit/fileapi/file_system_file_util.h" |
| 10 #include "webkit/fileapi/file_system_operation_context.h" | 10 #include "webkit/fileapi/file_system_operation_context.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 : MessageLoopRelay(context), | 201 : MessageLoopRelay(context), |
| 202 callback_(callback), | 202 callback_(callback), |
| 203 file_path_(file_path) { | 203 file_path_(file_path) { |
| 204 DCHECK(callback); | 204 DCHECK(callback); |
| 205 } | 205 } |
| 206 | 206 |
| 207 protected: | 207 protected: |
| 208 virtual void RunWork() { | 208 virtual void RunWork() { |
| 209 set_error_code( | 209 set_error_code( |
| 210 file_system_file_util()->GetFileInfo( | 210 file_system_file_util()->GetFileInfo( |
| 211 context(), file_path_, &file_info_)); | 211 context(), file_path_, &file_info_, &platform_path_)); |
| 212 } | 212 } |
| 213 | 213 |
| 214 virtual void RunCallback() { | 214 virtual void RunCallback() { |
| 215 callback_->Run(error_code(), file_info_); | 215 callback_->Run(error_code(), file_info_, platform_path_); |
| 216 delete callback_; | 216 delete callback_; |
| 217 } | 217 } |
| 218 | 218 |
| 219 private: | 219 private: |
| 220 fileapi::FileSystemFileUtilProxy::GetFileInfoCallback* callback_; | 220 fileapi::FileSystemFileUtilProxy::GetFileInfoCallback* callback_; |
| 221 FilePath file_path_; | 221 FilePath file_path_; |
| 222 base::PlatformFileInfo file_info_; | 222 base::PlatformFileInfo file_info_; |
| 223 FilePath platform_path_; |
| 223 }; | 224 }; |
| 224 | 225 |
| 225 class RelayReadDirectory : public MessageLoopRelay { | 226 class RelayReadDirectory : public MessageLoopRelay { |
| 226 public: | 227 public: |
| 227 RelayReadDirectory( | 228 RelayReadDirectory( |
| 228 const fileapi::FileSystemOperationContext& context, | 229 const fileapi::FileSystemOperationContext& context, |
| 229 const FilePath& file_path, | 230 const FilePath& file_path, |
| 230 fileapi::FileSystemFileUtilProxy::ReadDirectoryCallback* callback) | 231 fileapi::FileSystemFileUtilProxy::ReadDirectoryCallback* callback) |
| 231 : MessageLoopRelay(context), | 232 : MessageLoopRelay(context), |
| 232 callback_(callback), file_path_(file_path) { | 233 callback_(callback), file_path_(file_path) { |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 const FileSystemOperationContext& context, | 523 const FileSystemOperationContext& context, |
| 523 scoped_refptr<MessageLoopProxy> message_loop_proxy, | 524 scoped_refptr<MessageLoopProxy> message_loop_proxy, |
| 524 const FilePath& path, | 525 const FilePath& path, |
| 525 int64 length, | 526 int64 length, |
| 526 StatusCallback* callback) { | 527 StatusCallback* callback) { |
| 527 return Start(FROM_HERE, message_loop_proxy, | 528 return Start(FROM_HERE, message_loop_proxy, |
| 528 new RelayTruncate(context, path, length, callback)); | 529 new RelayTruncate(context, path, length, callback)); |
| 529 } | 530 } |
| 530 | 531 |
| 531 } // namespace fileapi | 532 } // namespace fileapi |
| OLD | NEW |