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

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

Issue 2909693004: 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 166
167 void CRLSetFetcher::OnUpdateError(int error) { 167 void CRLSetFetcher::OnUpdateError(int error) {
168 LOG(WARNING) << "CRLSetFetcher got error " << error 168 LOG(WARNING) << "CRLSetFetcher got error " << error
169 << " from component installer"; 169 << " from component installer";
170 } 170 }
171 171
172 update_client::CrxInstaller::Result CRLSetFetcher::Install( 172 update_client::CrxInstaller::Result CRLSetFetcher::Install(
173 const base::DictionaryValue& manifest, 173 const base::DictionaryValue& manifest,
174 const base::FilePath& unpack_path) { 174 const base::FilePath& unpack_path) {
175 return update_client::InstallFunctionWrapper( 175 const auto result = update_client::InstallFunctionWrapper(
176 base::Bind(&CRLSetFetcher::DoInstall, base::Unretained(this), 176 base::Bind(&CRLSetFetcher::DoInstall, base::Unretained(this),
177 base::ConstRef(manifest), base::ConstRef(unpack_path))); 177 base::ConstRef(manifest), base::ConstRef(unpack_path)));
178 base::DeleteFile(unpack_path, true);
179 return result;
178 } 180 }
179 181
180 bool CRLSetFetcher::DoInstall(const base::DictionaryValue& manifest, 182 bool CRLSetFetcher::DoInstall(const base::DictionaryValue& manifest,
181 const base::FilePath& unpack_path) { 183 const base::FilePath& unpack_path) {
182 base::FilePath crl_set_file_path = 184 base::FilePath crl_set_file_path =
183 unpack_path.Append(FILE_PATH_LITERAL("crl-set")); 185 unpack_path.Append(FILE_PATH_LITERAL("crl-set"));
184 base::FilePath save_to = GetCRLSetFilePath(); 186 base::FilePath save_to = GetCRLSetFilePath();
185 187
186 std::string crl_set_bytes; 188 std::string crl_set_bytes;
187 if (!base::ReadFileToString(crl_set_file_path, &crl_set_bytes)) { 189 if (!base::ReadFileToString(crl_set_file_path, &crl_set_bytes)) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 bool CRLSetFetcher::GetInstalledFile( 250 bool CRLSetFetcher::GetInstalledFile(
249 const std::string& file, base::FilePath* installed_file) { 251 const std::string& file, base::FilePath* installed_file) {
250 return false; 252 return false;
251 } 253 }
252 254
253 bool CRLSetFetcher::Uninstall() { 255 bool CRLSetFetcher::Uninstall() {
254 return false; 256 return false;
255 } 257 }
256 258
257 CRLSetFetcher::~CRLSetFetcher() {} 259 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