Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: storage/browser/fileapi/file_system_context.cc

Issue 470323003: [fsp] Improve performance for reading small chunks of data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 make_scoped_refptr(this), 430 make_scoped_refptr(this),
431 base::Unretained(quota_manager_proxy()), 431 base::Unretained(quota_manager_proxy()),
432 origin_url, 432 origin_url,
433 type), 433 type),
434 callback); 434 callback);
435 } 435 }
436 436
437 scoped_ptr<storage::FileStreamReader> FileSystemContext::CreateFileStreamReader( 437 scoped_ptr<storage::FileStreamReader> FileSystemContext::CreateFileStreamReader(
438 const FileSystemURL& url, 438 const FileSystemURL& url,
439 int64 offset, 439 int64 offset,
440 int64 max_bytes_to_read,
440 const base::Time& expected_modification_time) { 441 const base::Time& expected_modification_time) {
441 if (!url.is_valid()) 442 if (!url.is_valid())
442 return scoped_ptr<storage::FileStreamReader>(); 443 return scoped_ptr<storage::FileStreamReader>();
443 FileSystemBackend* backend = GetFileSystemBackend(url.type()); 444 FileSystemBackend* backend = GetFileSystemBackend(url.type());
444 if (!backend) 445 if (!backend)
445 return scoped_ptr<storage::FileStreamReader>(); 446 return scoped_ptr<storage::FileStreamReader>();
446 return backend->CreateFileStreamReader( 447 return backend->CreateFileStreamReader(
447 url, offset, expected_modification_time, this); 448 url, offset, max_bytes_to_read, expected_modification_time, this);
448 } 449 }
449 450
450 scoped_ptr<FileStreamWriter> FileSystemContext::CreateFileStreamWriter( 451 scoped_ptr<FileStreamWriter> FileSystemContext::CreateFileStreamWriter(
451 const FileSystemURL& url, 452 const FileSystemURL& url,
452 int64 offset) { 453 int64 offset) {
453 if (!url.is_valid()) 454 if (!url.is_valid())
454 return scoped_ptr<FileStreamWriter>(); 455 return scoped_ptr<FileStreamWriter>();
455 FileSystemBackend* backend = GetFileSystemBackend(url.type()); 456 FileSystemBackend* backend = GetFileSystemBackend(url.type());
456 if (!backend) 457 if (!backend)
457 return scoped_ptr<FileStreamWriter>(); 458 return scoped_ptr<FileStreamWriter>();
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 } else if (parent != child) { 636 } else if (parent != child) {
636 bool result = parent.AppendRelativePath(child, &path); 637 bool result = parent.AppendRelativePath(child, &path);
637 DCHECK(result); 638 DCHECK(result);
638 } 639 }
639 640
640 operation_runner()->GetMetadata( 641 operation_runner()->GetMetadata(
641 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); 642 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info));
642 } 643 }
643 644
644 } // namespace storage 645 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698