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: webkit/fileapi/file_system_file_stream_reader.h

Issue 10447083: Rename webkit_blob::FileReader to FileStreamReader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge master branch. Created 8 years, 6 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 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_FILE_READER_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_READER_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/platform_file.h" 11 #include "base/platform_file.h"
12 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
13 #include "webkit/blob/file_reader.h" 13 #include "webkit/blob/file_stream_reader.h"
14 14
15 class FilePath; 15 class FilePath;
16 16
17 namespace base { 17 namespace base {
18 class SequencedTaskRunner; 18 class SequencedTaskRunner;
19 } 19 }
20 20
21 namespace webkit_blob { 21 namespace webkit_blob {
22 class LocalFileReader; 22 class LocalFileStreamReader;
23 class ShareableFileReference; 23 class ShareableFileReference;
24 } 24 }
25 25
26 namespace fileapi { 26 namespace fileapi {
27 27
28 class FileSystemContext; 28 class FileSystemContext;
29 29
30 // TODO(kinaba,satorux): This generic implementation would work for any 30 // TODO(kinaba,satorux): This generic implementation would work for any
31 // filesystems but remote filesystem should implement its own reader 31 // filesystems but remote filesystem should implement its own reader
32 // rather than relying on FileSystemOperation::GetSnapshotFile() which 32 // rather than relying on FileSystemOperation::GetSnapshotFile() which
33 // may force downloading the entire contents for remote files. 33 // may force downloading the entire contents for remote files.
34 class FileSystemFileReader : public webkit_blob::FileReader { 34 class FileSystemFileStreamReader : public webkit_blob::FileStreamReader {
35 public: 35 public:
36 // Creates a new FileReader for a filesystem URL |url| form |initial_offset|. 36 // Creates a new FileReader for a filesystem URL |url| form |initial_offset|.
37 FileSystemFileReader(FileSystemContext* file_system_context, 37 FileSystemFileStreamReader(FileSystemContext* file_system_context,
38 const GURL& url, 38 const GURL& url,
39 int64 initial_offset); 39 int64 initial_offset);
40 virtual ~FileSystemFileReader(); 40 virtual ~FileSystemFileStreamReader();
41 41
42 // FileReader override. 42 // FileReader override.
43 virtual int Read(net::IOBuffer* buf, int buf_len, 43 virtual int Read(net::IOBuffer* buf, int buf_len,
44 const net::CompletionCallback& callback) OVERRIDE; 44 const net::CompletionCallback& callback) OVERRIDE;
45 45
46 private: 46 private:
47 void DidCreateSnapshot( 47 void DidCreateSnapshot(
48 const base::Closure& read_closure, 48 const base::Closure& read_closure,
49 const net::CompletionCallback& callback, 49 const net::CompletionCallback& callback,
50 base::PlatformFileError file_error, 50 base::PlatformFileError file_error,
51 const base::PlatformFileInfo& file_info, 51 const base::PlatformFileInfo& file_info,
52 const FilePath& platform_path, 52 const FilePath& platform_path,
53 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); 53 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
54 54
55 scoped_refptr<FileSystemContext> file_system_context_; 55 scoped_refptr<FileSystemContext> file_system_context_;
56 const GURL url_; 56 const GURL url_;
57 const int64 initial_offset_; 57 const int64 initial_offset_;
58 scoped_ptr<webkit_blob::LocalFileReader> local_file_reader_; 58 scoped_ptr<webkit_blob::LocalFileStreamReader> local_file_reader_;
59 scoped_refptr<webkit_blob::ShareableFileReference> snapshot_ref_; 59 scoped_refptr<webkit_blob::ShareableFileReference> snapshot_ref_;
60 bool has_pending_create_snapshot_; 60 bool has_pending_create_snapshot_;
61 base::WeakPtrFactory<FileSystemFileReader> weak_factory_; 61 base::WeakPtrFactory<FileSystemFileStreamReader> weak_factory_;
62 62
63 DISALLOW_COPY_AND_ASSIGN(FileSystemFileReader); 63 DISALLOW_COPY_AND_ASSIGN(FileSystemFileStreamReader);
64 }; 64 };
65 65
66 } // namespace fileapi 66 } // namespace fileapi
67 67
68 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_READER_H_ 68 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_file_reader.cc ('k') | webkit/fileapi/file_system_file_stream_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698