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

Side by Side Diff: chrome/browser/net/crl_set_fetcher.cc

Issue 2906683002: Clean up the unpack directory for CRLSet component. (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 | 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/net/crl_set_fetcher.h" 5 #include "chrome/browser/net/crl_set_fetcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 void CRLSetFetcher::OnUpdateError(int error) { 163 void CRLSetFetcher::OnUpdateError(int error) {
164 LOG(WARNING) << "CRLSetFetcher got error " << error 164 LOG(WARNING) << "CRLSetFetcher got error " << error
165 << " from component installer"; 165 << " from component installer";
166 } 166 }
167 167
168 update_client::CrxInstaller::Result CRLSetFetcher::Install( 168 update_client::CrxInstaller::Result CRLSetFetcher::Install(
169 const base::DictionaryValue& manifest, 169 const base::DictionaryValue& manifest,
170 const base::FilePath& unpack_path) { 170 const base::FilePath& unpack_path) {
171 return update_client::InstallFunctionWrapper( 171 const auto result = update_client::InstallFunctionWrapper(
172 base::Bind(&CRLSetFetcher::DoInstall, base::Unretained(this), 172 base::Bind(&CRLSetFetcher::DoInstall, base::Unretained(this),
173 base::ConstRef(manifest), base::ConstRef(unpack_path))); 173 base::ConstRef(manifest), base::ConstRef(unpack_path)));
174 base::DeleteFile(unpack_path, true);
175 return result;
174 } 176 }
175 177
176 bool CRLSetFetcher::DoInstall(const base::DictionaryValue& manifest, 178 bool CRLSetFetcher::DoInstall(const base::DictionaryValue& manifest,
177 const base::FilePath& unpack_path) { 179 const base::FilePath& unpack_path) {
178 base::FilePath crl_set_file_path = 180 base::FilePath crl_set_file_path =
179 unpack_path.Append(FILE_PATH_LITERAL("crl-set")); 181 unpack_path.Append(FILE_PATH_LITERAL("crl-set"));
180 base::FilePath save_to = GetCRLSetFilePath(); 182 base::FilePath save_to = GetCRLSetFilePath();
181 183
182 std::string crl_set_bytes; 184 std::string crl_set_bytes;
183 if (!base::ReadFileToString(crl_set_file_path, &crl_set_bytes)) { 185 if (!base::ReadFileToString(crl_set_file_path, &crl_set_bytes)) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 bool CRLSetFetcher::GetInstalledFile( 245 bool CRLSetFetcher::GetInstalledFile(
244 const std::string& file, base::FilePath* installed_file) { 246 const std::string& file, base::FilePath* installed_file) {
245 return false; 247 return false;
246 } 248 }
247 249
248 bool CRLSetFetcher::Uninstall() { 250 bool CRLSetFetcher::Uninstall() {
249 return false; 251 return false;
250 } 252 }
251 253
252 CRLSetFetcher::~CRLSetFetcher() {} 254 CRLSetFetcher::~CRLSetFetcher() {}
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