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