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

Side by Side Diff: chrome/browser/chromeos/file_manager/zip_file_creator.cc

Issue 2730583002: Convert utility process zip creator IPC to mojo: part 2 (Closed)
Patch Set: Created 3 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/file_manager/zip_file_creator.h" 5 #include "chrome/browser/chromeos/file_manager/zip_file_creator.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 utility_process_mojo_client_->Start(); 68 utility_process_mojo_client_->Start();
69 69
70 utility_process_mojo_client_->service()->CreateZipFile( 70 utility_process_mojo_client_->service()->CreateZipFile(
71 src_dir_, src_relative_paths_, std::move(file), 71 src_dir_, src_relative_paths_, std::move(file),
72 base::Bind(&ZipFileCreator::ReportDone, this)); 72 base::Bind(&ZipFileCreator::ReportDone, this));
73 } 73 }
74 74
75 void ZipFileCreator::ReportDone(bool success) { 75 void ZipFileCreator::ReportDone(bool success) {
76 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 76 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
77 77
78 // The current user of this class holds no reference to |this| so resetting
79 // the |utility_process_mojo_client_| here could release the last reference
80 // and delete |this|. So save |callback_| before resetting the client.
81 auto callback = base::ResetAndReturn(&callback_);
82 utility_process_mojo_client_.reset(); 78 utility_process_mojo_client_.reset();
83 callback.Run(success); 79 base::ResetAndReturn(&callback_).Run(success);
84 } 80 }
85 81
86 } // namespace file_manager 82 } // namespace file_manager
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698