| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/net/crl_set_fetcher.h" | 5 #include "ios/chrome/browser/net/crl_set_fetcher.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 156 } |
| 157 | 157 |
| 158 void CRLSetFetcher::OnUpdateError(int error) { | 158 void CRLSetFetcher::OnUpdateError(int error) { |
| 159 LOG(WARNING) << "CRLSetFetcher got error " << error | 159 LOG(WARNING) << "CRLSetFetcher got error " << error |
| 160 << " from component installer"; | 160 << " from component installer"; |
| 161 } | 161 } |
| 162 | 162 |
| 163 update_client::CrxInstaller::Result CRLSetFetcher::Install( | 163 update_client::CrxInstaller::Result CRLSetFetcher::Install( |
| 164 const base::DictionaryValue& manifest, | 164 const base::DictionaryValue& manifest, |
| 165 const base::FilePath& unpack_path) { | 165 const base::FilePath& unpack_path) { |
| 166 return update_client::InstallFunctionWrapper( | 166 const auto result = update_client::InstallFunctionWrapper( |
| 167 base::Bind(&CRLSetFetcher::DoInstall, base::Unretained(this), | 167 base::Bind(&CRLSetFetcher::DoInstall, base::Unretained(this), |
| 168 base::ConstRef(manifest), base::ConstRef(unpack_path))); | 168 base::ConstRef(manifest), base::ConstRef(unpack_path))); |
| 169 base::DeleteFile(unpack_path, true /* recursive */); |
| 170 return result; |
| 169 } | 171 } |
| 170 | 172 |
| 171 bool CRLSetFetcher::DoInstall(const base::DictionaryValue& manifest, | 173 bool CRLSetFetcher::DoInstall(const base::DictionaryValue& manifest, |
| 172 const base::FilePath& unpack_path) { | 174 const base::FilePath& unpack_path) { |
| 173 base::FilePath crl_set_file_path = | 175 base::FilePath crl_set_file_path = |
| 174 unpack_path.Append(FILE_PATH_LITERAL("crl-set")); | 176 unpack_path.Append(FILE_PATH_LITERAL("crl-set")); |
| 175 base::FilePath save_to = GetCRLSetFilePath(); | 177 base::FilePath save_to = GetCRLSetFilePath(); |
| 176 | 178 |
| 177 std::string crl_set_bytes; | 179 std::string crl_set_bytes; |
| 178 if (!base::ReadFileToString(crl_set_file_path, &crl_set_bytes)) { | 180 if (!base::ReadFileToString(crl_set_file_path, &crl_set_bytes)) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 bool CRLSetFetcher::GetInstalledFile(const std::string& file, | 240 bool CRLSetFetcher::GetInstalledFile(const std::string& file, |
| 239 base::FilePath* installed_file) { | 241 base::FilePath* installed_file) { |
| 240 return false; | 242 return false; |
| 241 } | 243 } |
| 242 | 244 |
| 243 bool CRLSetFetcher::Uninstall() { | 245 bool CRLSetFetcher::Uninstall() { |
| 244 return false; | 246 return false; |
| 245 } | 247 } |
| 246 | 248 |
| 247 CRLSetFetcher::~CRLSetFetcher() {} | 249 CRLSetFetcher::~CRLSetFetcher() {} |
| OLD | NEW |