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

Side by Side Diff: chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.cc

Issue 470323003: [fsp] Improve performance for reading small chunks of data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.h" 5 #include "chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/chromeos/drive/file_system_util.h" 10 #include "chrome/browser/chromeos/drive/file_system_util.h"
(...skipping 23 matching lines...) Expand all
34 storage::FileSystemType type) { 34 storage::FileSystemType type) {
35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
36 DCHECK_EQ(storage::kFileSystemTypeDrive, type); 36 DCHECK_EQ(storage::kFileSystemTypeDrive, type);
37 return async_file_util_.get(); 37 return async_file_util_.get();
38 } 38 }
39 39
40 scoped_ptr<storage::FileStreamReader> 40 scoped_ptr<storage::FileStreamReader>
41 FileSystemBackendDelegate::CreateFileStreamReader( 41 FileSystemBackendDelegate::CreateFileStreamReader(
42 const storage::FileSystemURL& url, 42 const storage::FileSystemURL& url,
43 int64 offset, 43 int64 offset,
44 int64 length,
44 const base::Time& expected_modification_time, 45 const base::Time& expected_modification_time,
45 storage::FileSystemContext* context) { 46 storage::FileSystemContext* context) {
46 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 47 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
47 DCHECK_EQ(storage::kFileSystemTypeDrive, url.type()); 48 DCHECK_EQ(storage::kFileSystemTypeDrive, url.type());
48 49
49 base::FilePath file_path = util::ExtractDrivePathFromFileSystemUrl(url); 50 base::FilePath file_path = util::ExtractDrivePathFromFileSystemUrl(url);
50 if (file_path.empty()) 51 if (file_path.empty())
51 return scoped_ptr<storage::FileStreamReader>(); 52 return scoped_ptr<storage::FileStreamReader>();
52 53
53 return scoped_ptr<storage::FileStreamReader>( 54 return scoped_ptr<storage::FileStreamReader>(
(...skipping 20 matching lines...) Expand all
74 75
75 return scoped_ptr<storage::FileStreamWriter>( 76 return scoped_ptr<storage::FileStreamWriter>(
76 new internal::WebkitFileStreamWriterImpl( 77 new internal::WebkitFileStreamWriterImpl(
77 base::Bind(&fileapi_internal::GetFileSystemFromUrl, url), 78 base::Bind(&fileapi_internal::GetFileSystemFromUrl, url),
78 context->default_file_task_runner(), 79 context->default_file_task_runner(),
79 file_path, 80 file_path,
80 offset)); 81 offset));
81 } 82 }
82 83
83 } // namespace drive 84 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698