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

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

Issue 2479633003: Makes the component installers return a Result instead of a bool. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « components/update_client/utils.h ('k') | extensions/browser/updater/update_install_shim.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/utils.h" 5 #include "components/update_client/utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 #include <cmath> 11 #include <cmath>
12 #include <cstring> 12 #include <cstring>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/callback.h"
15 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
16 #include "base/files/file_util.h" 17 #include "base/files/file_util.h"
17 #include "base/files/memory_mapped_file.h" 18 #include "base/files/memory_mapped_file.h"
18 #include "base/guid.h" 19 #include "base/guid.h"
19 #include "base/strings/string_number_conversions.h" 20 #include "base/strings/string_number_conversions.h"
20 #include "base/strings/string_piece.h" 21 #include "base/strings/string_piece.h"
21 #include "base/strings/string_util.h" 22 #include "base/strings/string_util.h"
22 #include "base/strings/stringprintf.h" 23 #include "base/strings/stringprintf.h"
23 #include "base/sys_info.h" 24 #include "base/sys_info.h"
24 #include "base/win/windows_version.h" 25 #include "base/win/windows_version.h"
25 #include "build/build_config.h" 26 #include "build/build_config.h"
26 #include "components/crx_file/id_util.h" 27 #include "components/crx_file/id_util.h"
27 #include "components/update_client/configurator.h" 28 #include "components/update_client/configurator.h"
28 #include "components/update_client/crx_update_item.h" 29 #include "components/update_client/crx_update_item.h"
29 #include "components/update_client/update_client.h" 30 #include "components/update_client/update_client.h"
31 #include "components/update_client/update_client_errors.h"
30 #include "components/update_client/update_query_params.h" 32 #include "components/update_client/update_query_params.h"
31 #include "crypto/secure_hash.h" 33 #include "crypto/secure_hash.h"
32 #include "crypto/sha2.h" 34 #include "crypto/sha2.h"
33 #include "net/base/load_flags.h" 35 #include "net/base/load_flags.h"
34 #include "net/url_request/url_fetcher.h" 36 #include "net/url_request/url_fetcher.h"
35 #include "net/url_request/url_request_context_getter.h" 37 #include "net/url_request/url_request_context_getter.h"
36 #include "net/url_request/url_request_status.h" 38 #include "net/url_request/url_request_status.h"
37 #include "url/gurl.h" 39 #include "url/gurl.h"
38 40
39 namespace update_client { 41 namespace update_client {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 305 }
304 306
305 void RemoveUnsecureUrls(std::vector<GURL>* urls) { 307 void RemoveUnsecureUrls(std::vector<GURL>* urls) {
306 DCHECK(urls); 308 DCHECK(urls);
307 urls->erase(std::remove_if( 309 urls->erase(std::remove_if(
308 urls->begin(), urls->end(), 310 urls->begin(), urls->end(),
309 [](const GURL& url) { return !url.SchemeIsCryptographic(); }), 311 [](const GURL& url) { return !url.SchemeIsCryptographic(); }),
310 urls->end()); 312 urls->end());
311 } 313 }
312 314
315 CrxInstaller::Result InstallFunctionWrapper(base::Callback<bool()> callback) {
316 return CrxInstaller::Result(callback.Run() ? InstallError::NONE
317 : InstallError::GENERIC_ERROR);
318 }
319
313 } // namespace update_client 320 } // namespace update_client
OLDNEW
« no previous file with comments | « components/update_client/utils.h ('k') | extensions/browser/updater/update_install_shim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698