| 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 "storage/browser/fileapi/file_system_context.h" | 5 #include "storage/browser/fileapi/file_system_context.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 if (!backend) { | 422 if (!backend) { |
| 423 callback.Run(base::File::FILE_ERROR_SECURITY); | 423 callback.Run(base::File::FILE_ERROR_SECURITY); |
| 424 return; | 424 return; |
| 425 } | 425 } |
| 426 if (!backend->GetQuotaUtil()) { | 426 if (!backend->GetQuotaUtil()) { |
| 427 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); | 427 callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); |
| 428 return; | 428 return; |
| 429 } | 429 } |
| 430 | 430 |
| 431 base::PostTaskAndReplyWithResult( | 431 base::PostTaskAndReplyWithResult( |
| 432 default_file_task_runner(), | 432 default_file_task_runner(), FROM_HERE, |
| 433 FROM_HERE, | |
| 434 // It is safe to pass Unretained(quota_util) since context owns it. | 433 // It is safe to pass Unretained(quota_util) since context owns it. |
| 435 base::Bind(&FileSystemQuotaUtil::DeleteOriginDataOnFileTaskRunner, | 434 base::Bind(&FileSystemQuotaUtil::DeleteOriginDataOnFileTaskRunner, |
| 436 base::Unretained(backend->GetQuotaUtil()), | 435 base::Unretained(backend->GetQuotaUtil()), |
| 437 make_scoped_refptr(this), | 436 base::RetainedRef(this), |
| 438 base::Unretained(quota_manager_proxy()), | 437 base::Unretained(quota_manager_proxy()), origin_url, type), |
| 439 origin_url, | |
| 440 type), | |
| 441 callback); | 438 callback); |
| 442 } | 439 } |
| 443 | 440 |
| 444 scoped_ptr<storage::FileStreamReader> FileSystemContext::CreateFileStreamReader( | 441 scoped_ptr<storage::FileStreamReader> FileSystemContext::CreateFileStreamReader( |
| 445 const FileSystemURL& url, | 442 const FileSystemURL& url, |
| 446 int64_t offset, | 443 int64_t offset, |
| 447 int64_t max_bytes_to_read, | 444 int64_t max_bytes_to_read, |
| 448 const base::Time& expected_modification_time) { | 445 const base::Time& expected_modification_time) { |
| 449 if (!url.is_valid()) | 446 if (!url.is_valid()) |
| 450 return scoped_ptr<storage::FileStreamReader>(); | 447 return scoped_ptr<storage::FileStreamReader>(); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 630 |
| 634 // TODO(mtomasz): Not all fields should be required for ResolveURL. | 631 // TODO(mtomasz): Not all fields should be required for ResolveURL. |
| 635 operation_runner()->GetMetadata( | 632 operation_runner()->GetMetadata( |
| 636 url, FileSystemOperation::GET_METADATA_FIELD_IS_DIRECTORY | | 633 url, FileSystemOperation::GET_METADATA_FIELD_IS_DIRECTORY | |
| 637 FileSystemOperation::GET_METADATA_FIELD_SIZE | | 634 FileSystemOperation::GET_METADATA_FIELD_SIZE | |
| 638 FileSystemOperation::GET_METADATA_FIELD_LAST_MODIFIED, | 635 FileSystemOperation::GET_METADATA_FIELD_LAST_MODIFIED, |
| 639 base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); | 636 base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); |
| 640 } | 637 } |
| 641 | 638 |
| 642 } // namespace storage | 639 } // namespace storage |
| OLD | NEW |