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

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

Issue 10080001: Reland 132134 with memory fix - Use LocalFileReader in FileSystemURLRequestJob (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Read return value fix 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 16 matching lines...) Expand all
27 27
28 // A thin wrapper of net::FileStream with range support for sliced file 28 // A thin wrapper of net::FileStream with range support for sliced file
29 // handling. 29 // handling.
30 class BLOB_EXPORT LocalFileReader { 30 class BLOB_EXPORT LocalFileReader {
31 public: 31 public:
32 typedef base::Callback<void(int error, scoped_ptr<net::FileStream> stream)> 32 typedef base::Callback<void(int error, scoped_ptr<net::FileStream> stream)>
33 OpenFileStreamCallback; 33 OpenFileStreamCallback;
34 34
35 // Creates a new FileReader for a local file |file_path|. 35 // Creates a new FileReader for a local file |file_path|.
36 // |initial_offset| specifies the offset in the file where the first read 36 // |initial_offset| specifies the offset in the file where the first read
37 // should start. 37 // should start. If the given offset is out of the file range any
38 // read operation may error out with net::ERR_REQUEST_RANGE_NOT_SATISFIABLE.
39 //
38 // |expected_modification_time| specifies the expected last modification 40 // |expected_modification_time| specifies the expected last modification
39 // If the value is non-null, the reader will check the underlying file's 41 // If the value is non-null, the reader will check the underlying file's
40 // actual modification time to see if the file has been modified, and if 42 // actual modification time to see if the file has been modified, and if
41 // it does any succeeding read operations should fail with 43 // it does any succeeding read operations should fail with
42 // ERR_UPLOAD_FILE_CHANGED error. 44 // ERR_UPLOAD_FILE_CHANGED error.
43 LocalFileReader(base::MessageLoopProxy* file_thread_proxy, 45 LocalFileReader(base::MessageLoopProxy* file_thread_proxy,
44 const FilePath& file_path, 46 const FilePath& file_path,
45 int64 initial_offset, 47 int64 initial_offset,
46 const base::Time& expected_modification_time); 48 const base::Time& expected_modification_time);
47 49
(...skipping 26 matching lines...) Expand all
74 const FilePath file_path_; 76 const FilePath file_path_;
75 const int64 initial_offset_; 77 const int64 initial_offset_;
76 const base::Time expected_modification_time_; 78 const base::Time expected_modification_time_;
77 bool has_pending_open_; 79 bool has_pending_open_;
78 base::WeakPtrFactory<LocalFileReader> weak_factory_; 80 base::WeakPtrFactory<LocalFileReader> weak_factory_;
79 }; 81 };
80 82
81 } // namespace webkit_blob 83 } // namespace webkit_blob
82 84
83 #endif // WEBKIT_BLOB_LOCAL_FILE_READER_H_ 85 #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