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

Side by Side Diff: components/update_client/component.cc

Issue 2918653003: Unconditionally delete the unpack path in the UpdateClient. (Closed)
Patch Set: Created 3 years, 6 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 | components/update_client/test_installer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "components/update_client/component.h" 5 #include "components/update_client/component.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 void InstallOnBlockingTaskRunner( 89 void InstallOnBlockingTaskRunner(
90 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, 90 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner,
91 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, 91 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
92 const base::FilePath& unpack_path, 92 const base::FilePath& unpack_path,
93 const std::string& fingerprint, 93 const std::string& fingerprint,
94 const scoped_refptr<CrxInstaller>& installer, 94 const scoped_refptr<CrxInstaller>& installer,
95 InstallOnBlockingTaskRunnerCompleteCallback callback) { 95 InstallOnBlockingTaskRunnerCompleteCallback callback) {
96 DCHECK(blocking_task_runner->RunsTasksOnCurrentThread()); 96 DCHECK(blocking_task_runner->RunsTasksOnCurrentThread());
97 97
98 DCHECK(base::DirectoryExists(unpack_path));
98 const auto result = DoInstallOnBlockingTaskRunner( 99 const auto result = DoInstallOnBlockingTaskRunner(
99 main_task_runner, blocking_task_runner, unpack_path, fingerprint, 100 main_task_runner, blocking_task_runner, unpack_path, fingerprint,
100 installer, callback); 101 installer, callback);
102 base::DeleteFile(unpack_path, true);
101 103
102 const ErrorCategory error_category = 104 const ErrorCategory error_category =
103 result.error ? ErrorCategory::kInstallError : ErrorCategory::kErrorNone; 105 result.error ? ErrorCategory::kInstallError : ErrorCategory::kErrorNone;
104 main_task_runner->PostTask( 106 main_task_runner->PostTask(
105 FROM_HERE, 107 FROM_HERE,
106 base::Bind(callback, static_cast<int>(error_category), 108 base::Bind(callback, static_cast<int>(error_category),
107 static_cast<int>(result.error), result.extended_error)); 109 static_cast<int>(result.error), result.extended_error));
108 } 110 }
109 111
110 void UnpackCompleteOnBlockingTaskRunner( 112 void UnpackCompleteOnBlockingTaskRunner(
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 void Component::StateUninstalled::DoHandle() { 707 void Component::StateUninstalled::DoHandle() {
706 DCHECK(thread_checker_.CalledOnValidThread()); 708 DCHECK(thread_checker_.CalledOnValidThread());
707 709
708 auto& component = State::component(); 710 auto& component = State::component();
709 component.AppendEvent(BuildUninstalledEventElement(component)); 711 component.AppendEvent(BuildUninstalledEventElement(component));
710 712
711 TransitionState(nullptr); 713 TransitionState(nullptr);
712 } 714 }
713 715
714 } // namespace update_client 716 } // namespace update_client
OLDNEW
« no previous file with comments | « no previous file | components/update_client/test_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698