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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/fileapi/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 a dcheck. Created 6 years, 4 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/file_system_provider/fileapi/backend_delegate. h" 5 #include "chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate. h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_st ream_reader.h" 8 #include "chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_st ream_reader.h"
9 #include "chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reade r.h" 9 #include "chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reade r.h"
10 #include "chrome/browser/chromeos/file_system_provider/fileapi/file_stream_write r.h" 10 #include "chrome/browser/chromeos/file_system_provider/fileapi/file_stream_write r.h"
(...skipping 24 matching lines...) Expand all
35 fileapi::FileSystemType type) { 35 fileapi::FileSystemType type) {
36 DCHECK_CURRENTLY_ON(BrowserThread::IO); 36 DCHECK_CURRENTLY_ON(BrowserThread::IO);
37 DCHECK_EQ(fileapi::kFileSystemTypeProvided, type); 37 DCHECK_EQ(fileapi::kFileSystemTypeProvided, type);
38 return async_file_util_.get(); 38 return async_file_util_.get();
39 } 39 }
40 40
41 scoped_ptr<webkit_blob::FileStreamReader> 41 scoped_ptr<webkit_blob::FileStreamReader>
42 BackendDelegate::CreateFileStreamReader( 42 BackendDelegate::CreateFileStreamReader(
43 const fileapi::FileSystemURL& url, 43 const fileapi::FileSystemURL& url,
44 int64 offset, 44 int64 offset,
45 int64 length,
45 const base::Time& expected_modification_time, 46 const base::Time& expected_modification_time,
46 fileapi::FileSystemContext* context) { 47 fileapi::FileSystemContext* context) {
47 DCHECK_CURRENTLY_ON(BrowserThread::IO); 48 DCHECK_CURRENTLY_ON(BrowserThread::IO);
48 DCHECK_EQ(fileapi::kFileSystemTypeProvided, url.type()); 49 DCHECK_EQ(fileapi::kFileSystemTypeProvided, url.type());
49 50
50 return scoped_ptr<webkit_blob::FileStreamReader>( 51 return scoped_ptr<webkit_blob::FileStreamReader>(
51 new BufferingFileStreamReader( 52 new BufferingFileStreamReader(
52 scoped_ptr<webkit_blob::FileStreamReader>(new FileStreamReader( 53 scoped_ptr<webkit_blob::FileStreamReader>(new FileStreamReader(
53 context, url, offset, expected_modification_time)), 54 context, url, offset, expected_modification_time)),
54 kReaderBufferSize)); 55 kReaderBufferSize,
56 length));
55 } 57 }
56 58
57 scoped_ptr<fileapi::FileStreamWriter> BackendDelegate::CreateFileStreamWriter( 59 scoped_ptr<fileapi::FileStreamWriter> BackendDelegate::CreateFileStreamWriter(
58 const fileapi::FileSystemURL& url, 60 const fileapi::FileSystemURL& url,
59 int64 offset, 61 int64 offset,
60 fileapi::FileSystemContext* context) { 62 fileapi::FileSystemContext* context) {
61 DCHECK_CURRENTLY_ON(BrowserThread::IO); 63 DCHECK_CURRENTLY_ON(BrowserThread::IO);
62 DCHECK_EQ(fileapi::kFileSystemTypeProvided, url.type()); 64 DCHECK_EQ(fileapi::kFileSystemTypeProvided, url.type());
63 65
64 return scoped_ptr<fileapi::FileStreamWriter>( 66 return scoped_ptr<fileapi::FileStreamWriter>(
65 new FileStreamWriter(url, offset)); 67 new FileStreamWriter(url, offset));
66 } 68 }
67 69
68 } // namespace file_system_provider 70 } // namespace file_system_provider
69 } // namespace chromeos 71 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698