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), | |
36 stage_(image_writer_api::STAGE_UNKNOWN), | 35 stage_(image_writer_api::STAGE_UNKNOWN), |
37 progress_(0) { | 36 progress_(0) { |
38 } | 37 } |
39 | 38 |
40 Operation::~Operation() { | 39 Operation::~Operation() { |
41 } | 40 } |
42 | 41 |
43 void Operation::Cancel() { | 42 void Operation::Cancel() { |
44 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
45 | 44 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 callback.Run(hash.Pass()); | 321 callback.Run(hash.Pass()); |
323 } | 322 } |
324 } else { // len < 0 | 323 } else { // len < 0 |
325 reader->Close(); | 324 reader->Close(); |
326 Error(error::kHashReadError); | 325 Error(error::kHashReadError); |
327 } | 326 } |
328 } | 327 } |
329 | 328 |
330 } // namespace image_writer | 329 } // namespace image_writer |
331 } // namespace extensions | 330 } // namespace extensions |
OLD | NEW |