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 #include "webkit/fileapi/file_system_file_stream_reader.h" | 5 #include "webkit/fileapi/file_system_file_stream_reader.h" |
6 | 6 |
7 #include "base/files/file_util_proxy.h" | 7 #include "base/files/file_util_proxy.h" |
8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "net/base/file_stream.h" | 10 #include "net/base/file_stream.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 FileSystemFileStreamReader::FileSystemFileStreamReader( | 50 FileSystemFileStreamReader::FileSystemFileStreamReader( |
51 FileSystemContext* file_system_context, | 51 FileSystemContext* file_system_context, |
52 const FileSystemURL& url, | 52 const FileSystemURL& url, |
53 int64 initial_offset, | 53 int64 initial_offset, |
54 const base::Time& expected_modification_time) | 54 const base::Time& expected_modification_time) |
55 : file_system_context_(file_system_context), | 55 : file_system_context_(file_system_context), |
56 url_(url), | 56 url_(url), |
57 initial_offset_(initial_offset), | 57 initial_offset_(initial_offset), |
58 expected_modification_time_(expected_modification_time), | 58 expected_modification_time_(expected_modification_time), |
59 has_pending_create_snapshot_(false), | 59 has_pending_create_snapshot_(false), |
60 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 60 weak_factory_(this) { |
61 } | 61 } |
62 | 62 |
63 FileSystemFileStreamReader::~FileSystemFileStreamReader() { | 63 FileSystemFileStreamReader::~FileSystemFileStreamReader() { |
64 } | 64 } |
65 | 65 |
66 int FileSystemFileStreamReader::Read( | 66 int FileSystemFileStreamReader::Read( |
67 net::IOBuffer* buf, int buf_len, | 67 net::IOBuffer* buf, int buf_len, |
68 const net::CompletionCallback& callback) { | 68 const net::CompletionCallback& callback) { |
69 if (local_file_reader_.get()) | 69 if (local_file_reader_.get()) |
70 return local_file_reader_->Read(buf, buf_len, callback); | 70 return local_file_reader_->Read(buf, buf_len, callback); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 local_file_reader_.reset( | 124 local_file_reader_.reset( |
125 new LocalFileStreamReader( | 125 new LocalFileStreamReader( |
126 file_system_context_->task_runners()->file_task_runner(), | 126 file_system_context_->task_runners()->file_task_runner(), |
127 platform_path, initial_offset_, expected_modification_time_)); | 127 platform_path, initial_offset_, expected_modification_time_)); |
128 | 128 |
129 callback.Run(); | 129 callback.Run(); |
130 } | 130 } |
131 | 131 |
132 } // namespace fileapi | 132 } // namespace fileapi |
OLD | NEW |