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