Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(863)

Side by Side Diff: chrome/browser/extensions/api/image_writer_private/operation.cc

Issue 109793006: Adds ImageWriterPrivate.destroyPartitions operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes up DBusThreadManager initialization. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698