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

Side by Side Diff: webkit/blob/local_file_reader.h

Issue 10067026: Accomodate files larger than maxint in size in blob/file reading. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « webkit/blob/blob_url_request_job.cc ('k') | webkit/blob/local_file_reader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_BLOB_LOCAL_FILE_READER_H_ 5 #ifndef WEBKIT_BLOB_LOCAL_FILE_READER_H_
6 #define WEBKIT_BLOB_LOCAL_FILE_READER_H_ 6 #define WEBKIT_BLOB_LOCAL_FILE_READER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // Reads from the current cursor position asynchronously. 50 // Reads from the current cursor position asynchronously.
51 // This works mostly same as how net::FileStream::Read() works except that 51 // This works mostly same as how net::FileStream::Read() works except that
52 // it internally opens (and seeks) the file if it is not opened yet. 52 // it internally opens (and seeks) the file if it is not opened yet.
53 // It is invalid to call Read while there is an in-flight Read operation. 53 // It is invalid to call Read while there is an in-flight Read operation.
54 int Read(net::IOBuffer* buf, int buf_len, 54 int Read(net::IOBuffer* buf, int buf_len,
55 const net::CompletionCallback& callback); 55 const net::CompletionCallback& callback);
56 56
57 // Returns the number of bytes available to read from the beginning of 57 // Returns the number of bytes available to read from the beginning of
58 // the file (or initial_offset) until the end of the file (rv >= 0 cases). 58 // the file (or initial_offset) until the end of the file (rv >= 0 cases).
59 // Otherwise, a negative error code is returned (rv < 0 cases). 59 // Otherwise, a negative error code is returned (rv < 0 cases).
60 int GetLength(const net::CompletionCallback& callback); 60 int GetLength(const net::Int64CompletionCallback& callback);
61 61
62 private: 62 private:
63 class OpenFileStreamHelper; 63 class OpenFileStreamHelper;
64 64
65 int Open(const OpenFileStreamCallback& callback); 65 int Open(const OpenFileStreamCallback& callback);
66 void DidOpen(net::IOBuffer* buf, 66 void DidOpen(net::IOBuffer* buf,
67 int buf_len, 67 int buf_len,
68 const net::CompletionCallback& callback, 68 const net::CompletionCallback& callback,
69 int open_error, 69 int open_error,
70 scoped_ptr<net::FileStream> stream); 70 scoped_ptr<net::FileStream> stream);
71 71
72 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; 72 scoped_refptr<base::MessageLoopProxy> file_thread_proxy_;
73 scoped_ptr<net::FileStream> stream_impl_; 73 scoped_ptr<net::FileStream> stream_impl_;
74 const FilePath file_path_; 74 const FilePath file_path_;
75 const int64 initial_offset_; 75 const int64 initial_offset_;
76 const base::Time expected_modification_time_; 76 const base::Time expected_modification_time_;
77 bool has_pending_open_; 77 bool has_pending_open_;
78 base::WeakPtrFactory<LocalFileReader> weak_factory_; 78 base::WeakPtrFactory<LocalFileReader> weak_factory_;
79 }; 79 };
80 80
81 } // namespace webkit_blob 81 } // namespace webkit_blob
82 82
83 #endif // WEBKIT_BLOB_LOCAL_FILE_READER_H_ 83 #endif // WEBKIT_BLOB_LOCAL_FILE_READER_H_
OLDNEW
« no previous file with comments | « webkit/blob/blob_url_request_job.cc ('k') | webkit/blob/local_file_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698