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 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 Operation::Operation(base::WeakPtr<OperationManager> manager, | 29 Operation::Operation(base::WeakPtr<OperationManager> manager, |
30 const ExtensionId& extension_id, | 30 const ExtensionId& extension_id, |
31 const std::string& storage_unit_id) | 31 const std::string& storage_unit_id) |
32 : manager_(manager), | 32 : manager_(manager), |
33 extension_id_(extension_id), | 33 extension_id_(extension_id), |
34 storage_unit_id_(storage_unit_id), | 34 storage_unit_id_(storage_unit_id), |
| 35 verify_write_(true), |
35 stage_(image_writer_api::STAGE_UNKNOWN), | 36 stage_(image_writer_api::STAGE_UNKNOWN), |
36 progress_(0) { | 37 progress_(0) { |
37 } | 38 } |
38 | 39 |
39 Operation::~Operation() { | 40 Operation::~Operation() { |
40 } | 41 } |
41 | 42 |
42 void Operation::Cancel() { | 43 void Operation::Cancel() { |
43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
44 | 45 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 callback.Run(hash.Pass()); | 322 callback.Run(hash.Pass()); |
322 } | 323 } |
323 } else { // len < 0 | 324 } else { // len < 0 |
324 reader->Close(); | 325 reader->Close(); |
325 Error(error::kHashReadError); | 326 Error(error::kHashReadError); |
326 } | 327 } |
327 } | 328 } |
328 | 329 |
329 } // namespace image_writer | 330 } // namespace image_writer |
330 } // namespace extensions | 331 } // namespace extensions |
OLD | NEW |