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

Side by Side Diff: webkit/fileapi/upload_file_system_file_element_reader.h

Issue 15859007: Move browser-specific FileAPI code from webkit/fileapi to webkit/browser/fileapi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dump_file_system build fix Created 7 years, 7 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
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_FILEAPI_UPLOAD_FILE_SYSTEM_FILE_ELEMENT_READER_H_
6 #define WEBKIT_FILEAPI_UPLOAD_FILE_SYSTEM_FILE_ELEMENT_READER_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "base/time.h"
10 #include "googleurl/src/gurl.h"
11 #include "net/base/upload_element_reader.h"
12 #include "webkit/storage/webkit_storage_export.h"
13
14 namespace webkit_blob {
15 class FileStreamReader;
16 }
17
18 namespace fileapi {
19
20 class FileSystemContext;
21
22 // An UploadElementReader implementation for filesystem file.
23 class WEBKIT_STORAGE_EXPORT UploadFileSystemFileElementReader
24 : public net::UploadElementReader {
25 public:
26 UploadFileSystemFileElementReader(
27 FileSystemContext* file_system_context,
28 const GURL& url,
29 uint64 range_offset,
30 uint64 range_length,
31 const base::Time& expected_modification_time);
32 virtual ~UploadFileSystemFileElementReader();
33
34 // UploadElementReader overrides:
35 virtual int Init(const net::CompletionCallback& callback) OVERRIDE;
36 virtual uint64 GetContentLength() const OVERRIDE;
37 virtual uint64 BytesRemaining() const OVERRIDE;
38 virtual int Read(net::IOBuffer* buf,
39 int buf_length,
40 const net::CompletionCallback& callback) OVERRIDE;
41
42 private:
43 void OnGetLength(const net::CompletionCallback& callback, int64 result);
44 void OnRead(const net::CompletionCallback& callback, int result);
45
46 scoped_refptr<FileSystemContext> file_system_context_;
47 const GURL url_;
48 const uint64 range_offset_;
49 const uint64 range_length_;
50 const base::Time expected_modification_time_;
51
52 scoped_ptr<webkit_blob::FileStreamReader> stream_reader_;
53
54 uint64 stream_length_;
55 uint64 position_;
56
57 base::WeakPtrFactory<UploadFileSystemFileElementReader> weak_ptr_factory_;
58
59 DISALLOW_COPY_AND_ASSIGN(UploadFileSystemFileElementReader);
60 };
61
62 } // namespace fileapi
63
64 #endif // WEBKIT_FILEAPI_UPLOAD_FILE_SYSTEM_FILE_ELEMENT_READER_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/test_mount_point_provider.cc ('k') | webkit/fileapi/upload_file_system_file_element_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698