Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_operation.h" | 5 #include "webkit/fileapi/file_system_operation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "net/base/escape.h" | 10 #include "net/base/escape.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 } | 71 } |
| 72 | 72 |
| 73 FileSystemOperation::~FileSystemOperation() { | 73 FileSystemOperation::~FileSystemOperation() { |
| 74 if (file_writer_delegate_.get()) | 74 if (file_writer_delegate_.get()) |
| 75 base::FileUtilProxy::RelayClose( | 75 base::FileUtilProxy::RelayClose( |
| 76 proxy_, | 76 proxy_, |
| 77 base::Bind(&FileSystemFileUtil::Close, | 77 base::Bind(&FileSystemFileUtil::Close, |
| 78 base::Unretained(operation_context_.src_file_util()), | 78 base::Unretained(operation_context_.src_file_util()), |
| 79 base::Unretained(&operation_context_)), | 79 base::Unretained(&operation_context_)), |
| 80 file_writer_delegate_->file(), | 80 file_writer_delegate_->file(), |
| 81 FileSystemFileUtilProxy::StatusCallback()); | 81 base::FileUtilProxy::StatusCallback()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void FileSystemOperation::OpenFileSystem( | 84 void FileSystemOperation::OpenFileSystem( |
| 85 const GURL& origin_url, fileapi::FileSystemType type, bool create) { | 85 const GURL& origin_url, fileapi::FileSystemType type, bool create) { |
| 86 #ifndef NDEBUG | 86 #ifndef NDEBUG |
| 87 DCHECK(kOperationNone == pending_operation_); | 87 DCHECK(kOperationNone == pending_operation_); |
| 88 pending_operation_ = static_cast<FileSystemOperation::OperationType>( | 88 pending_operation_ = static_cast<FileSystemOperation::OperationType>( |
| 89 kOperationOpenFileSystem); | 89 kOperationOpenFileSystem); |
| 90 #endif | 90 #endif |
| 91 | 91 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 107 void FileSystemOperation::CreateFile(const GURL& path, | 107 void FileSystemOperation::CreateFile(const GURL& path, |
| 108 bool exclusive) { | 108 bool exclusive) { |
| 109 #ifndef NDEBUG | 109 #ifndef NDEBUG |
| 110 DCHECK(kOperationNone == pending_operation_); | 110 DCHECK(kOperationNone == pending_operation_); |
| 111 pending_operation_ = kOperationCreateFile; | 111 pending_operation_ = kOperationCreateFile; |
| 112 #endif | 112 #endif |
| 113 if (!SetupSrcContextForWrite(path, true)) { | 113 if (!SetupSrcContextForWrite(path, true)) { |
| 114 delete this; | 114 delete this; |
| 115 return; | 115 return; |
| 116 } | 116 } |
| 117 exclusive_ = exclusive; | |
| 118 | |
| 119 GetUsageAndQuotaThenCallback( | 117 GetUsageAndQuotaThenCallback( |
| 120 operation_context_.src_origin_url(), | 118 operation_context_.src_origin_url(), |
| 121 base::Bind(&FileSystemOperation::DelayedCreateFileForQuota, | 119 base::Bind(&FileSystemOperation::DelayedCreateFileForQuota, |
| 122 weak_factory_.GetWeakPtr())); | 120 weak_factory_.GetWeakPtr(), exclusive)); |
| 123 } | 121 } |
| 124 | 122 |
| 125 void FileSystemOperation::DelayedCreateFileForQuota( | 123 void FileSystemOperation::DelayedCreateFileForQuota( |
| 124 bool exclusive, | |
| 126 quota::QuotaStatusCode status, int64 usage, int64 quota) { | 125 quota::QuotaStatusCode status, int64 usage, int64 quota) { |
| 127 operation_context_.set_allowed_bytes_growth(quota - usage); | 126 operation_context_.set_allowed_bytes_growth(quota - usage); |
| 128 | 127 |
| 129 quota_util_helper_.reset(new ScopedQuotaUtilHelper( | 128 quota_util_helper_.reset(new ScopedQuotaUtilHelper( |
| 130 file_system_context(), | 129 file_system_context(), |
| 131 operation_context_.src_origin_url(), | 130 operation_context_.src_origin_url(), |
| 132 operation_context_.src_type())); | 131 operation_context_.src_type())); |
| 133 | 132 |
| 134 FileSystemFileUtilProxy::EnsureFileExists( | 133 FileSystemFileUtilProxy::EnsureFileExists( |
| 135 operation_context_, | 134 operation_context_, |
| 136 proxy_, | 135 proxy_, |
| 137 src_virtual_path_, | 136 src_virtual_path_, |
| 138 base::Bind( | 137 base::Bind( |
| 139 exclusive_ ? &FileSystemOperation::DidEnsureFileExistsExclusive | 138 exclusive ? &FileSystemOperation::DidEnsureFileExistsExclusive |
| 140 : &FileSystemOperation::DidEnsureFileExistsNonExclusive, | 139 : &FileSystemOperation::DidEnsureFileExistsNonExclusive, |
| 141 weak_factory_.GetWeakPtr())); | 140 weak_factory_.GetWeakPtr())); |
| 142 } | 141 } |
| 143 | 142 |
| 144 void FileSystemOperation::CreateDirectory(const GURL& path, | 143 void FileSystemOperation::CreateDirectory(const GURL& path, |
| 145 bool exclusive, | 144 bool exclusive, |
| 146 bool recursive) { | 145 bool recursive) { |
| 147 #ifndef NDEBUG | 146 #ifndef NDEBUG |
| 148 DCHECK(kOperationNone == pending_operation_); | 147 DCHECK(kOperationNone == pending_operation_); |
| 149 pending_operation_ = kOperationCreateDirectory; | 148 pending_operation_ = kOperationCreateDirectory; |
| 150 #endif | 149 #endif |
| 151 if (!SetupSrcContextForWrite(path, true)) { | 150 if (!SetupSrcContextForWrite(path, true)) { |
| 152 delete this; | 151 delete this; |
| 153 return; | 152 return; |
| 154 } | 153 } |
| 155 exclusive_ = exclusive; | |
| 156 recursive_ = recursive; | |
| 157 | |
| 158 GetUsageAndQuotaThenCallback( | 154 GetUsageAndQuotaThenCallback( |
| 159 operation_context_.src_origin_url(), | 155 operation_context_.src_origin_url(), |
| 160 base::Bind(&FileSystemOperation::DelayedCreateDirectoryForQuota, | 156 base::Bind(&FileSystemOperation::DelayedCreateDirectoryForQuota, |
| 161 weak_factory_.GetWeakPtr())); | 157 weak_factory_.GetWeakPtr(), exclusive, recursive)); |
| 162 } | 158 } |
| 163 | 159 |
| 164 void FileSystemOperation::DelayedCreateDirectoryForQuota( | 160 void FileSystemOperation::DelayedCreateDirectoryForQuota( |
| 161 bool exclusive, bool recursive, | |
| 165 quota::QuotaStatusCode status, int64 usage, int64 quota) { | 162 quota::QuotaStatusCode status, int64 usage, int64 quota) { |
| 166 operation_context_.set_allowed_bytes_growth(quota - usage); | 163 operation_context_.set_allowed_bytes_growth(quota - usage); |
| 167 | 164 |
| 168 quota_util_helper_.reset(new ScopedQuotaUtilHelper( | 165 quota_util_helper_.reset(new ScopedQuotaUtilHelper( |
| 169 file_system_context(), | 166 file_system_context(), |
| 170 operation_context_.src_origin_url(), | 167 operation_context_.src_origin_url(), |
| 171 operation_context_.src_type())); | 168 operation_context_.src_type())); |
| 172 | 169 |
| 173 FileSystemFileUtilProxy::CreateDirectory( | 170 base::FileUtilProxy::RelayFileTask( |
| 174 operation_context_, proxy_, src_virtual_path_, exclusive_, | 171 proxy_, FROM_HERE, |
| 175 recursive_, | 172 base::Bind(&FileSystemFileUtil::CreateDirectory, |
| 173 base::Unretained(operation_context_.src_file_util()), | |
| 174 base::Unretained(&operation_context_), | |
|
willchan no longer on Chromium
2011/11/01 23:56:48
Sorry, I'm not familiar with the code. It's not ob
kinuko
2011/11/02 08:04:28
Right, it's self-deleting and WeakPtr makes things
| |
| 175 src_virtual_path_, exclusive, recursive), | |
| 176 base::Bind(&FileSystemOperation::DidFinishFileOperation, | 176 base::Bind(&FileSystemOperation::DidFinishFileOperation, |
| 177 weak_factory_.GetWeakPtr())); | 177 weak_factory_.GetWeakPtr())); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void FileSystemOperation::Copy(const GURL& src_path, | 180 void FileSystemOperation::Copy(const GURL& src_path, |
| 181 const GURL& dest_path) { | 181 const GURL& dest_path) { |
| 182 #ifndef NDEBUG | 182 #ifndef NDEBUG |
| 183 DCHECK(kOperationNone == pending_operation_); | 183 DCHECK(kOperationNone == pending_operation_); |
| 184 pending_operation_ = kOperationCopy; | 184 pending_operation_ = kOperationCopy; |
| 185 #endif | 185 #endif |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 197 | 197 |
| 198 void FileSystemOperation::DelayedCopyForQuota(quota::QuotaStatusCode status, | 198 void FileSystemOperation::DelayedCopyForQuota(quota::QuotaStatusCode status, |
| 199 int64 usage, int64 quota) { | 199 int64 usage, int64 quota) { |
| 200 operation_context_.set_allowed_bytes_growth(quota - usage); | 200 operation_context_.set_allowed_bytes_growth(quota - usage); |
| 201 | 201 |
| 202 quota_util_helper_.reset(new ScopedQuotaUtilHelper( | 202 quota_util_helper_.reset(new ScopedQuotaUtilHelper( |
| 203 file_system_context(), | 203 file_system_context(), |
| 204 operation_context_.dest_origin_url(), | 204 operation_context_.dest_origin_url(), |
| 205 operation_context_.dest_type())); | 205 operation_context_.dest_type())); |
| 206 | 206 |
| 207 FileSystemFileUtilProxy::Copy( | 207 base::FileUtilProxy::RelayFileTask( |
| 208 operation_context_, proxy_, src_virtual_path_, | 208 proxy_, FROM_HERE, |
| 209 dest_virtual_path_, | 209 base::Bind(&FileSystemFileUtil::Copy, |
| 210 base::Unretained(operation_context_.src_file_util()), | |
| 211 base::Unretained(&operation_context_), | |
| 212 src_virtual_path_, dest_virtual_path_), | |
| 210 base::Bind(&FileSystemOperation::DidFinishFileOperation, | 213 base::Bind(&FileSystemOperation::DidFinishFileOperation, |
| 211 weak_factory_.GetWeakPtr())); | 214 weak_factory_.GetWeakPtr())); |
| 212 } | 215 } |
| 213 | 216 |
| 214 void FileSystemOperation::Move(const GURL& src_path, | 217 void FileSystemOperation::Move(const GURL& src_path, |
| 215 const GURL& dest_path) { | 218 const GURL& dest_path) { |
| 216 #ifndef NDEBUG | 219 #ifndef NDEBUG |
| 217 DCHECK(kOperationNone == pending_operation_); | 220 DCHECK(kOperationNone == pending_operation_); |
| 218 pending_operation_ = kOperationMove; | 221 pending_operation_ = kOperationMove; |
| 219 #endif | 222 #endif |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 231 | 234 |
| 232 void FileSystemOperation::DelayedMoveForQuota(quota::QuotaStatusCode status, | 235 void FileSystemOperation::DelayedMoveForQuota(quota::QuotaStatusCode status, |
| 233 int64 usage, int64 quota) { | 236 int64 usage, int64 quota) { |
| 234 operation_context_.set_allowed_bytes_growth(quota - usage); | 237 operation_context_.set_allowed_bytes_growth(quota - usage); |
| 235 | 238 |
| 236 quota_util_helper_.reset(new ScopedQuotaUtilHelper( | 239 quota_util_helper_.reset(new ScopedQuotaUtilHelper( |
| 237 file_system_context(), | 240 file_system_context(), |
| 238 operation_context_.dest_origin_url(), | 241 operation_context_.dest_origin_url(), |
| 239 operation_context_.dest_type())); | 242 operation_context_.dest_type())); |
| 240 | 243 |
| 241 FileSystemFileUtilProxy::Move( | 244 base::FileUtilProxy::RelayFileTask( |
| 242 operation_context_, proxy_, src_virtual_path_, | 245 proxy_, FROM_HERE, |
| 243 dest_virtual_path_, | 246 base::Bind(&FileSystemFileUtil::Move, |
| 247 base::Unretained(operation_context_.src_file_util()), | |
| 248 base::Unretained(&operation_context_), | |
| 249 src_virtual_path_, dest_virtual_path_), | |
| 244 base::Bind(&FileSystemOperation::DidFinishFileOperation, | 250 base::Bind(&FileSystemOperation::DidFinishFileOperation, |
| 245 weak_factory_.GetWeakPtr())); | 251 weak_factory_.GetWeakPtr())); |
| 246 } | 252 } |
| 247 | 253 |
| 248 void FileSystemOperation::DirectoryExists(const GURL& path) { | 254 void FileSystemOperation::DirectoryExists(const GURL& path) { |
| 249 #ifndef NDEBUG | 255 #ifndef NDEBUG |
| 250 DCHECK(kOperationNone == pending_operation_); | 256 DCHECK(kOperationNone == pending_operation_); |
| 251 pending_operation_ = kOperationDirectoryExists; | 257 pending_operation_ = kOperationDirectoryExists; |
| 252 #endif | 258 #endif |
| 253 if (!SetupSrcContextForRead(path)) { | 259 if (!SetupSrcContextForRead(path)) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 void FileSystemOperation::Remove(const GURL& path, bool recursive) { | 318 void FileSystemOperation::Remove(const GURL& path, bool recursive) { |
| 313 #ifndef NDEBUG | 319 #ifndef NDEBUG |
| 314 DCHECK(kOperationNone == pending_operation_); | 320 DCHECK(kOperationNone == pending_operation_); |
| 315 pending_operation_ = kOperationRemove; | 321 pending_operation_ = kOperationRemove; |
| 316 #endif | 322 #endif |
| 317 if (!SetupSrcContextForWrite(path, false)) { | 323 if (!SetupSrcContextForWrite(path, false)) { |
| 318 delete this; | 324 delete this; |
| 319 return; | 325 return; |
| 320 } | 326 } |
| 321 | 327 |
| 322 FileSystemFileUtilProxy::Delete( | 328 base::FileUtilProxy::RelayFileTask( |
| 323 operation_context_, proxy_, src_virtual_path_, recursive, | 329 proxy_, FROM_HERE, |
| 330 base::Bind(&FileSystemFileUtil::Delete, | |
| 331 base::Unretained(operation_context_.src_file_util()), | |
| 332 base::Unretained(&operation_context_), | |
| 333 src_virtual_path_, recursive), | |
| 324 base::Bind(&FileSystemOperation::DidFinishFileOperation, | 334 base::Bind(&FileSystemOperation::DidFinishFileOperation, |
| 325 weak_factory_.GetWeakPtr())); | 335 weak_factory_.GetWeakPtr())); |
| 326 } | 336 } |
| 327 | 337 |
| 328 void FileSystemOperation::Write( | 338 void FileSystemOperation::Write( |
| 329 scoped_refptr<net::URLRequestContext> url_request_context, | 339 scoped_refptr<net::URLRequestContext> url_request_context, |
| 330 const GURL& path, | 340 const GURL& path, |
| 331 const GURL& blob_url, | 341 const GURL& blob_url, |
| 332 int64 offset) { | 342 int64 offset) { |
| 333 #ifndef NDEBUG | 343 #ifndef NDEBUG |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 | 389 |
| 380 void FileSystemOperation::Truncate(const GURL& path, int64 length) { | 390 void FileSystemOperation::Truncate(const GURL& path, int64 length) { |
| 381 #ifndef NDEBUG | 391 #ifndef NDEBUG |
| 382 DCHECK(kOperationNone == pending_operation_); | 392 DCHECK(kOperationNone == pending_operation_); |
| 383 pending_operation_ = kOperationTruncate; | 393 pending_operation_ = kOperationTruncate; |
| 384 #endif | 394 #endif |
| 385 if (!SetupSrcContextForWrite(path, false)) { | 395 if (!SetupSrcContextForWrite(path, false)) { |
| 386 delete this; | 396 delete this; |
| 387 return; | 397 return; |
| 388 } | 398 } |
| 389 length_ = length; | |
| 390 | |
| 391 GetUsageAndQuotaThenCallback( | 399 GetUsageAndQuotaThenCallback( |
| 392 operation_context_.src_origin_url(), | 400 operation_context_.src_origin_url(), |
| 393 base::Bind(&FileSystemOperation::DelayedTruncateForQuota, | 401 base::Bind(&FileSystemOperation::DelayedTruncateForQuota, |
| 394 weak_factory_.GetWeakPtr())); | 402 weak_factory_.GetWeakPtr(), length)); |
| 395 } | 403 } |
| 396 | 404 |
| 397 void FileSystemOperation::DelayedTruncateForQuota(quota::QuotaStatusCode status, | 405 void FileSystemOperation::DelayedTruncateForQuota(int64 length, |
| 406 quota::QuotaStatusCode status, | |
| 398 int64 usage, int64 quota) { | 407 int64 usage, int64 quota) { |
| 399 operation_context_.set_allowed_bytes_growth(quota - usage); | 408 operation_context_.set_allowed_bytes_growth(quota - usage); |
| 400 | 409 |
| 401 quota_util_helper_.reset(new ScopedQuotaUtilHelper( | 410 quota_util_helper_.reset(new ScopedQuotaUtilHelper( |
| 402 file_system_context(), | 411 file_system_context(), |
| 403 operation_context_.src_origin_url(), | 412 operation_context_.src_origin_url(), |
| 404 operation_context_.src_type())); | 413 operation_context_.src_type())); |
| 405 | 414 |
| 406 FileSystemFileUtilProxy::Truncate( | 415 base::FileUtilProxy::RelayFileTask( |
| 407 operation_context_, proxy_, src_virtual_path_, length_, | 416 proxy_, FROM_HERE, |
| 417 base::Bind(&FileSystemFileUtil::Truncate, | |
| 418 base::Unretained(operation_context_.src_file_util()), | |
| 419 base::Unretained(&operation_context_), | |
| 420 src_virtual_path_, length), | |
| 408 base::Bind(&FileSystemOperation::DidFinishFileOperation, | 421 base::Bind(&FileSystemOperation::DidFinishFileOperation, |
| 409 weak_factory_.GetWeakPtr())); | 422 weak_factory_.GetWeakPtr())); |
| 410 } | 423 } |
| 411 | 424 |
| 412 void FileSystemOperation::TouchFile(const GURL& path, | 425 void FileSystemOperation::TouchFile(const GURL& path, |
| 413 const base::Time& last_access_time, | 426 const base::Time& last_access_time, |
| 414 const base::Time& last_modified_time) { | 427 const base::Time& last_modified_time) { |
| 415 #ifndef NDEBUG | 428 #ifndef NDEBUG |
| 416 DCHECK(kOperationNone == pending_operation_); | 429 DCHECK(kOperationNone == pending_operation_); |
| 417 pending_operation_ = kOperationTouchFile; | 430 pending_operation_ = kOperationTouchFile; |
| 418 #endif | 431 #endif |
| 419 if (!SetupSrcContextForWrite(path, true)) { | 432 if (!SetupSrcContextForWrite(path, true)) { |
| 420 delete this; | 433 delete this; |
| 421 return; | 434 return; |
| 422 } | 435 } |
| 423 | 436 |
| 424 FileSystemFileUtilProxy::Touch( | 437 base::FileUtilProxy::RelayFileTask( |
| 425 operation_context_, proxy_, src_virtual_path_, | 438 proxy_, FROM_HERE, |
| 426 last_access_time, last_modified_time, | 439 base::Bind(&FileSystemFileUtil::Touch, |
| 440 base::Unretained(operation_context_.src_file_util()), | |
| 441 base::Unretained(&operation_context_), | |
| 442 src_virtual_path_, last_access_time, last_modified_time), | |
| 427 base::Bind(&FileSystemOperation::DidTouchFile, | 443 base::Bind(&FileSystemOperation::DidTouchFile, |
| 428 weak_factory_.GetWeakPtr())); | 444 weak_factory_.GetWeakPtr())); |
| 429 } | 445 } |
| 430 | 446 |
| 431 void FileSystemOperation::OpenFile(const GURL& path, | 447 void FileSystemOperation::OpenFile(const GURL& path, |
| 432 int file_flags, | 448 int file_flags, |
| 433 base::ProcessHandle peer_handle) { | 449 base::ProcessHandle peer_handle) { |
| 434 #ifndef NDEBUG | 450 #ifndef NDEBUG |
| 435 DCHECK(kOperationNone == pending_operation_); | 451 DCHECK(kOperationNone == pending_operation_); |
| 436 pending_operation_ = kOperationOpenFile; | 452 pending_operation_ = kOperationOpenFile; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 452 if (!SetupSrcContextForWrite(path, true)) { | 468 if (!SetupSrcContextForWrite(path, true)) { |
| 453 delete this; | 469 delete this; |
| 454 return; | 470 return; |
| 455 } | 471 } |
| 456 } else { | 472 } else { |
| 457 if (!SetupSrcContextForRead(path)) { | 473 if (!SetupSrcContextForRead(path)) { |
| 458 delete this; | 474 delete this; |
| 459 return; | 475 return; |
| 460 } | 476 } |
| 461 } | 477 } |
| 462 file_flags_ = file_flags; | |
| 463 | |
| 464 GetUsageAndQuotaThenCallback( | 478 GetUsageAndQuotaThenCallback( |
| 465 operation_context_.src_origin_url(), | 479 operation_context_.src_origin_url(), |
| 466 base::Bind(&FileSystemOperation::DelayedOpenFileForQuota, | 480 base::Bind(&FileSystemOperation::DelayedOpenFileForQuota, |
| 467 weak_factory_.GetWeakPtr())); | 481 weak_factory_.GetWeakPtr(), file_flags)); |
| 468 } | 482 } |
| 469 | 483 |
| 470 void FileSystemOperation::DelayedOpenFileForQuota(quota::QuotaStatusCode status, | 484 void FileSystemOperation::DelayedOpenFileForQuota(int file_flags, |
| 485 quota::QuotaStatusCode status, | |
| 471 int64 usage, int64 quota) { | 486 int64 usage, int64 quota) { |
| 472 operation_context_.set_allowed_bytes_growth(quota - usage); | 487 operation_context_.set_allowed_bytes_growth(quota - usage); |
| 473 | 488 |
| 474 quota_util_helper_.reset(new ScopedQuotaUtilHelper( | 489 quota_util_helper_.reset(new ScopedQuotaUtilHelper( |
| 475 file_system_context(), | 490 file_system_context(), |
| 476 operation_context_.src_origin_url(), | 491 operation_context_.src_origin_url(), |
| 477 operation_context_.src_type())); | 492 operation_context_.src_type())); |
| 478 | 493 |
| 479 base::FileUtilProxy::RelayCreateOrOpen( | 494 base::FileUtilProxy::RelayCreateOrOpen( |
| 480 proxy_, | 495 proxy_, |
| 481 base::Bind(&FileSystemFileUtil::CreateOrOpen, | 496 base::Bind(&FileSystemFileUtil::CreateOrOpen, |
| 482 base::Unretained(operation_context_.src_file_util()), | 497 base::Unretained(operation_context_.src_file_util()), |
| 483 base::Unretained(&operation_context_), | 498 base::Unretained(&operation_context_), |
| 484 src_virtual_path_, | 499 src_virtual_path_, |
| 485 file_flags_), | 500 file_flags), |
| 486 base::Bind(&FileSystemFileUtil::Close, | 501 base::Bind(&FileSystemFileUtil::Close, |
| 487 base::Unretained(operation_context_.src_file_util()), | 502 base::Unretained(operation_context_.src_file_util()), |
| 488 base::Unretained(&operation_context_)), | 503 base::Unretained(&operation_context_)), |
| 489 base::Bind(&FileSystemOperation::DidOpenFile, | 504 base::Bind(&FileSystemOperation::DidOpenFile, |
| 490 weak_factory_.GetWeakPtr())); | 505 weak_factory_.GetWeakPtr())); |
| 491 } | 506 } |
| 492 | 507 |
| 493 void FileSystemOperation::SyncGetPlatformPath(const GURL& path, | 508 void FileSystemOperation::SyncGetPlatformPath(const GURL& path, |
| 494 FilePath* platform_path) { | 509 FilePath* platform_path) { |
| 495 #ifndef NDEBUG | 510 #ifndef NDEBUG |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 847 bool result = VerifyFileSystemPathForWrite( | 862 bool result = VerifyFileSystemPathForWrite( |
| 848 path, create, &origin_url, &type, &dest_virtual_path_, &file_util); | 863 path, create, &origin_url, &type, &dest_virtual_path_, &file_util); |
| 849 operation_context_.set_dest_origin_url(origin_url); | 864 operation_context_.set_dest_origin_url(origin_url); |
| 850 operation_context_.set_dest_type(type); | 865 operation_context_.set_dest_type(type); |
| 851 if (!operation_context_.dest_file_util()) | 866 if (!operation_context_.dest_file_util()) |
| 852 operation_context_.set_dest_file_util(file_util); | 867 operation_context_.set_dest_file_util(file_util); |
| 853 return result; | 868 return result; |
| 854 } | 869 } |
| 855 | 870 |
| 856 } // namespace fileapi | 871 } // namespace fileapi |
| OLD | NEW |