| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/files/file_enumerator.h" | 6 #include "base/files/file_enumerator.h" |
| 7 #include "base/threading/worker_pool.h" | 7 #include "base/threading/worker_pool.h" |
| 8 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" | 8 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" |
| 9 #include "chrome/browser/extensions/api/image_writer_private/operation.h" | 9 #include "chrome/browser/extensions/api/image_writer_private/operation.h" |
| 10 #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h
" | 10 #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h
" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 this)); | 166 this)); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void Operation::VerifyWriteStage2( | 169 void Operation::VerifyWriteStage2( |
| 170 scoped_ptr<std::string> image_hash) { | 170 scoped_ptr<std::string> image_hash) { |
| 171 DVLOG(1) << "Building MD5 sum of device: " << storage_unit_id_; | 171 DVLOG(1) << "Building MD5 sum of device: " << storage_unit_id_; |
| 172 | 172 |
| 173 int64 image_size; | 173 int64 image_size; |
| 174 scoped_ptr<base::FilePath> device_path(new base::FilePath(storage_unit_id_)); | 174 scoped_ptr<base::FilePath> device_path(new base::FilePath(storage_unit_id_)); |
| 175 | 175 |
| 176 if (!file_util::GetFileSize(image_path_, &image_size)){ | 176 if (!base::GetFileSize(image_path_, &image_size)){ |
| 177 Error(error::kImageSize); | 177 Error(error::kImageSize); |
| 178 return; | 178 return; |
| 179 } | 179 } |
| 180 | 180 |
| 181 GetMD5SumOfFile( | 181 GetMD5SumOfFile( |
| 182 device_path.Pass(), | 182 device_path.Pass(), |
| 183 image_size, | 183 image_size, |
| 184 50, // progress_offset | 184 50, // progress_offset |
| 185 50, // progress_scale | 185 50, // progress_scale |
| 186 base::Bind(&Operation::VerifyWriteCompare, | 186 base::Bind(&Operation::VerifyWriteCompare, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 200 | 200 |
| 201 DVLOG(2) << "Completed write verification of " << image_path_.value(); | 201 DVLOG(2) << "Completed write verification of " << image_path_.value(); |
| 202 | 202 |
| 203 SetProgress(kProgressComplete); | 203 SetProgress(kProgressComplete); |
| 204 | 204 |
| 205 Finish(); | 205 Finish(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 } // namespace image_writer | 208 } // namespace image_writer |
| 209 } // namespace extensions | 209 } // namespace extensions |
| OLD | NEW |