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/browser/fileapi/file_system_context.h" | 5 #include "webkit/browser/fileapi/file_system_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 make_scoped_refptr(this), | 422 make_scoped_refptr(this), |
423 base::Unretained(quota_manager_proxy()), | 423 base::Unretained(quota_manager_proxy()), |
424 origin_url, | 424 origin_url, |
425 type), | 425 type), |
426 callback); | 426 callback); |
427 } | 427 } |
428 | 428 |
429 scoped_ptr<storage::FileStreamReader> FileSystemContext::CreateFileStreamReader( | 429 scoped_ptr<storage::FileStreamReader> FileSystemContext::CreateFileStreamReader( |
430 const FileSystemURL& url, | 430 const FileSystemURL& url, |
431 int64 offset, | 431 int64 offset, |
| 432 int64 length, |
432 const base::Time& expected_modification_time) { | 433 const base::Time& expected_modification_time) { |
433 if (!url.is_valid()) | 434 if (!url.is_valid()) |
434 return scoped_ptr<storage::FileStreamReader>(); | 435 return scoped_ptr<storage::FileStreamReader>(); |
435 FileSystemBackend* backend = GetFileSystemBackend(url.type()); | 436 FileSystemBackend* backend = GetFileSystemBackend(url.type()); |
436 if (!backend) | 437 if (!backend) |
437 return scoped_ptr<storage::FileStreamReader>(); | 438 return scoped_ptr<storage::FileStreamReader>(); |
438 return backend->CreateFileStreamReader( | 439 return backend->CreateFileStreamReader( |
439 url, offset, expected_modification_time, this); | 440 url, offset, length, expected_modification_time, this); |
440 } | 441 } |
441 | 442 |
442 scoped_ptr<FileStreamWriter> FileSystemContext::CreateFileStreamWriter( | 443 scoped_ptr<FileStreamWriter> FileSystemContext::CreateFileStreamWriter( |
443 const FileSystemURL& url, | 444 const FileSystemURL& url, |
444 int64 offset) { | 445 int64 offset) { |
445 if (!url.is_valid()) | 446 if (!url.is_valid()) |
446 return scoped_ptr<FileStreamWriter>(); | 447 return scoped_ptr<FileStreamWriter>(); |
447 FileSystemBackend* backend = GetFileSystemBackend(url.type()); | 448 FileSystemBackend* backend = GetFileSystemBackend(url.type()); |
448 if (!backend) | 449 if (!backend) |
449 return scoped_ptr<FileStreamWriter>(); | 450 return scoped_ptr<FileStreamWriter>(); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 } else if (parent != child) { | 628 } else if (parent != child) { |
628 bool result = parent.AppendRelativePath(child, &path); | 629 bool result = parent.AppendRelativePath(child, &path); |
629 DCHECK(result); | 630 DCHECK(result); |
630 } | 631 } |
631 | 632 |
632 operation_runner()->GetMetadata( | 633 operation_runner()->GetMetadata( |
633 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); | 634 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); |
634 } | 635 } |
635 | 636 |
636 } // namespace storage | 637 } // namespace storage |
OLD | NEW |