| 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 make_scoped_refptr(this), | 414 make_scoped_refptr(this), |
| 415 base::Unretained(quota_manager_proxy()), | 415 base::Unretained(quota_manager_proxy()), |
| 416 origin_url, | 416 origin_url, |
| 417 type), | 417 type), |
| 418 callback); | 418 callback); |
| 419 } | 419 } |
| 420 | 420 |
| 421 scoped_ptr<storage::FileStreamReader> FileSystemContext::CreateFileStreamReader( | 421 scoped_ptr<storage::FileStreamReader> FileSystemContext::CreateFileStreamReader( |
| 422 const FileSystemURL& url, | 422 const FileSystemURL& url, |
| 423 int64 offset, | 423 int64 offset, |
| 424 int64 length, |
| 424 const base::Time& expected_modification_time) { | 425 const base::Time& expected_modification_time) { |
| 425 if (!url.is_valid()) | 426 if (!url.is_valid()) |
| 426 return scoped_ptr<storage::FileStreamReader>(); | 427 return scoped_ptr<storage::FileStreamReader>(); |
| 427 FileSystemBackend* backend = GetFileSystemBackend(url.type()); | 428 FileSystemBackend* backend = GetFileSystemBackend(url.type()); |
| 428 if (!backend) | 429 if (!backend) |
| 429 return scoped_ptr<storage::FileStreamReader>(); | 430 return scoped_ptr<storage::FileStreamReader>(); |
| 430 return backend->CreateFileStreamReader( | 431 return backend->CreateFileStreamReader( |
| 431 url, offset, expected_modification_time, this); | 432 url, offset, length, expected_modification_time, this); |
| 432 } | 433 } |
| 433 | 434 |
| 434 scoped_ptr<FileStreamWriter> FileSystemContext::CreateFileStreamWriter( | 435 scoped_ptr<FileStreamWriter> FileSystemContext::CreateFileStreamWriter( |
| 435 const FileSystemURL& url, | 436 const FileSystemURL& url, |
| 436 int64 offset) { | 437 int64 offset) { |
| 437 if (!url.is_valid()) | 438 if (!url.is_valid()) |
| 438 return scoped_ptr<FileStreamWriter>(); | 439 return scoped_ptr<FileStreamWriter>(); |
| 439 FileSystemBackend* backend = GetFileSystemBackend(url.type()); | 440 FileSystemBackend* backend = GetFileSystemBackend(url.type()); |
| 440 if (!backend) | 441 if (!backend) |
| 441 return scoped_ptr<FileStreamWriter>(); | 442 return scoped_ptr<FileStreamWriter>(); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 } else if (parent != child) { | 620 } else if (parent != child) { |
| 620 bool result = parent.AppendRelativePath(child, &path); | 621 bool result = parent.AppendRelativePath(child, &path); |
| 621 DCHECK(result); | 622 DCHECK(result); |
| 622 } | 623 } |
| 623 | 624 |
| 624 operation_runner()->GetMetadata( | 625 operation_runner()->GetMetadata( |
| 625 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); | 626 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); |
| 626 } | 627 } |
| 627 | 628 |
| 628 } // namespace storage | 629 } // namespace storage |
| OLD | NEW |