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/browser/blob/local_file_stream_reader.h" | 5 #include "webkit/browser/blob/local_file_stream_reader.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_util_proxy.h" | 8 #include "base/files/file_util_proxy.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 return; | 143 return; |
144 } | 144 } |
145 DCHECK(stream_impl_.get()); | 145 DCHECK(stream_impl_.get()); |
146 const int read_result = stream_impl_->Read(buf, buf_len, callback); | 146 const int read_result = stream_impl_->Read(buf, buf_len, callback); |
147 if (read_result != net::ERR_IO_PENDING) | 147 if (read_result != net::ERR_IO_PENDING) |
148 callback.Run(read_result); | 148 callback.Run(read_result); |
149 } | 149 } |
150 | 150 |
151 void LocalFileStreamReader::DidGetFileInfoForGetLength( | 151 void LocalFileStreamReader::DidGetFileInfoForGetLength( |
152 const net::Int64CompletionCallback& callback, | 152 const net::Int64CompletionCallback& callback, |
153 base::PlatformFileError error, | 153 base::File::Error error, |
154 const base::PlatformFileInfo& file_info) { | 154 const base::File::Info& file_info) { |
155 if (file_info.is_directory) { | 155 if (file_info.is_directory) { |
156 callback.Run(net::ERR_FILE_NOT_FOUND); | 156 callback.Run(net::ERR_FILE_NOT_FOUND); |
157 return; | 157 return; |
158 } | 158 } |
159 if (error != base::PLATFORM_FILE_OK) { | 159 if (error != base::File::FILE_OK) { |
160 callback.Run(net::PlatformFileErrorToNetError(error)); | 160 callback.Run(net::FileErrorToNetError(error)); |
161 return; | 161 return; |
162 } | 162 } |
163 if (!VerifySnapshotTime(expected_modification_time_, file_info)) { | 163 if (!VerifySnapshotTime(expected_modification_time_, file_info)) { |
164 callback.Run(net::ERR_UPLOAD_FILE_CHANGED); | 164 callback.Run(net::ERR_UPLOAD_FILE_CHANGED); |
165 return; | 165 return; |
166 } | 166 } |
167 callback.Run(file_info.size); | 167 callback.Run(file_info.size); |
168 } | 168 } |
169 | 169 |
170 } // namespace webkit_blob | 170 } // namespace webkit_blob |
OLD | NEW |