Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 ragnge any |
|
adamk
2012/04/12 16:04:15
Typo: s/ragnge/range/
kinuko
2012/04/13 03:06:28
Done.
| |
| 38 // succeeding read operation may error out with | |
|
adamk
2012/04/12 16:04:15
"succeeding" is confusing in context, I think you
kinuko
2012/04/13 03:06:28
Done.
| |
| 39 // net::ERR_REQUEST_RANGE_NOT_SATISFIABLE. | |
| 40 // | |
| 38 // |expected_modification_time| specifies the expected last modification | 41 // |expected_modification_time| specifies the expected last modification |
| 39 // If the value is non-null, the reader will check the underlying file's | 42 // 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 | 43 // actual modification time to see if the file has been modified, and if |
| 41 // it does any succeeding read operations should fail with | 44 // it does any succeeding read operations should fail with |
| 42 // ERR_UPLOAD_FILE_CHANGED error. | 45 // ERR_UPLOAD_FILE_CHANGED error. |
| 43 LocalFileReader(base::MessageLoopProxy* file_thread_proxy, | 46 LocalFileReader(base::MessageLoopProxy* file_thread_proxy, |
| 44 const FilePath& file_path, | 47 const FilePath& file_path, |
| 45 int64 initial_offset, | 48 int64 initial_offset, |
| 46 const base::Time& expected_modification_time); | 49 const base::Time& expected_modification_time); |
| 47 | 50 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 74 const FilePath file_path_; | 77 const FilePath file_path_; |
| 75 const int64 initial_offset_; | 78 const int64 initial_offset_; |
| 76 const base::Time expected_modification_time_; | 79 const base::Time expected_modification_time_; |
| 77 bool has_pending_open_; | 80 bool has_pending_open_; |
| 78 base::WeakPtrFactory<LocalFileReader> weak_factory_; | 81 base::WeakPtrFactory<LocalFileReader> weak_factory_; |
| 79 }; | 82 }; |
| 80 | 83 |
| 81 } // namespace webkit_blob | 84 } // namespace webkit_blob |
| 82 | 85 |
| 83 #endif // WEBKIT_BLOB_LOCAL_FILE_READER_H_ | 86 #endif // WEBKIT_BLOB_LOCAL_FILE_READER_H_ |
| OLD | NEW |