| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.h" | 5 #include "chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
| 10 #include "base/platform_file.h" | |
| 11 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" | 10 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" |
| 12 #include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h" | 11 #include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h" |
| 13 #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" | 12 #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" |
| 14 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 15 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
| 16 #include "net/base/mime_sniffer.h" | 15 #include "net/base/mime_sniffer.h" |
| 17 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 18 #include "webkit/browser/fileapi/file_system_context.h" | 17 #include "webkit/browser/fileapi/file_system_context.h" |
| 19 | 18 |
| 20 using webkit_blob::FileStreamReader; | 19 using webkit_blob::FileStreamReader; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 const base::File::Info& file_info) { | 186 const base::File::Info& file_info) { |
| 188 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 187 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 189 | 188 |
| 190 if (!VerifySnapshotTime(expected_modification_time_, file_info)) { | 189 if (!VerifySnapshotTime(expected_modification_time_, file_info)) { |
| 191 callback.Run(net::ERR_UPLOAD_FILE_CHANGED); | 190 callback.Run(net::ERR_UPLOAD_FILE_CHANGED); |
| 192 return; | 191 return; |
| 193 } | 192 } |
| 194 | 193 |
| 195 callback.Run(file_info.size); | 194 callback.Run(file_info.size); |
| 196 } | 195 } |
| OLD | NEW |