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

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: 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 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_interface.h" 10 #include "chrome/browser/chromeos/drive/file_system_interface.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 storage::FileSystemType type) { 75 storage::FileSystemType type) {
76 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 76 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
77 DCHECK_EQ(storage::kFileSystemTypeDrive, type); 77 DCHECK_EQ(storage::kFileSystemTypeDrive, type);
78 return async_file_util_.get(); 78 return async_file_util_.get();
79 } 79 }
80 80
81 scoped_ptr<storage::FileStreamReader> 81 scoped_ptr<storage::FileStreamReader>
82 FileSystemBackendDelegate::CreateFileStreamReader( 82 FileSystemBackendDelegate::CreateFileStreamReader(
83 const storage::FileSystemURL& url, 83 const storage::FileSystemURL& url,
84 int64 offset, 84 int64 offset,
85 int64 max_bytes_to_read,
85 const base::Time& expected_modification_time, 86 const base::Time& expected_modification_time,
86 storage::FileSystemContext* context) { 87 storage::FileSystemContext* context) {
87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 88 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
88 DCHECK_EQ(storage::kFileSystemTypeDrive, url.type()); 89 DCHECK_EQ(storage::kFileSystemTypeDrive, url.type());
89 90
90 base::FilePath file_path = util::ExtractDrivePathFromFileSystemUrl(url); 91 base::FilePath file_path = util::ExtractDrivePathFromFileSystemUrl(url);
91 if (file_path.empty()) 92 if (file_path.empty())
92 return scoped_ptr<storage::FileStreamReader>(); 93 return scoped_ptr<storage::FileStreamReader>();
93 94
94 return scoped_ptr<storage::FileStreamReader>( 95 return scoped_ptr<storage::FileStreamReader>(
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 const storage::FileSystemURL& url, 132 const storage::FileSystemURL& url,
132 const storage::URLCallback& callback) { 133 const storage::URLCallback& callback) {
133 DCHECK_CURRENTLY_ON(BrowserThread::IO); 134 DCHECK_CURRENTLY_ON(BrowserThread::IO);
134 BrowserThread::PostTask( 135 BrowserThread::PostTask(
135 BrowserThread::UI, 136 BrowserThread::UI,
136 FROM_HERE, 137 FROM_HERE,
137 base::Bind(&GetRedirectURLForContentsOnUIThread, url, callback)); 138 base::Bind(&GetRedirectURLForContentsOnUIThread, url, callback));
138 } 139 }
139 140
140 } // namespace drive 141 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698