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

Side by Side Diff: extensions/browser/updater/update_data_provider.cc

Issue 1740333002: Allow fallback from https to http for component update checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
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 "extensions/browser/updater/update_data_provider.h" 5 #include "extensions/browser/updater/update_data_provider.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 30 matching lines...) Expand all
41 if (!extension) 41 if (!extension)
42 continue; 42 continue;
43 data->push_back(update_client::CrxComponent()); 43 data->push_back(update_client::CrxComponent());
44 update_client::CrxComponent* info = &data->back(); 44 update_client::CrxComponent* info = &data->back();
45 std::string pubkey_bytes; 45 std::string pubkey_bytes;
46 base::Base64Decode(extension->public_key(), &pubkey_bytes); 46 base::Base64Decode(extension->public_key(), &pubkey_bytes);
47 info->pk_hash.resize(crypto::kSHA256Length, 0); 47 info->pk_hash.resize(crypto::kSHA256Length, 0);
48 crypto::SHA256HashString(pubkey_bytes, info->pk_hash.data(), 48 crypto::SHA256HashString(pubkey_bytes, info->pk_hash.data(),
49 info->pk_hash.size()); 49 info->pk_hash.size());
50 info->version = *extension->version(); 50 info->version = *extension->version();
51 info->allow_background_download = false; 51 info->allows_background_download = false;
52 52 info->requires_network_encryption = true;
53 info->installer = new UpdateInstallShim( 53 info->installer = new UpdateInstallShim(
54 id, extension->path(), 54 id, extension->path(),
55 base::Bind(&UpdateDataProvider::RunInstallCallback, this)); 55 base::Bind(&UpdateDataProvider::RunInstallCallback, this));
56 } 56 }
57 } 57 }
58 58
59 void UpdateDataProvider::RunInstallCallback(const std::string& extension_id, 59 void UpdateDataProvider::RunInstallCallback(const std::string& extension_id,
60 const base::FilePath& temp_dir) { 60 const base::FilePath& temp_dir) {
61 if (!context_) { 61 if (!context_) {
62 content::BrowserThread::PostBlockingPoolTask( 62 content::BrowserThread::PostBlockingPoolTask(
63 FROM_HERE, 63 FROM_HERE,
64 base::Bind(base::IgnoreResult(&base::DeleteFile), temp_dir, false)); 64 base::Bind(base::IgnoreResult(&base::DeleteFile), temp_dir, false));
65 return; 65 return;
66 } else { 66 } else {
67 callback_.Run(context_, extension_id, temp_dir); 67 callback_.Run(context_, extension_id, temp_dir);
68 } 68 }
69 } 69 }
70 70
71 } // namespace extensions 71 } // namespace extensions
OLDNEW
« no previous file with comments | « components/update_client/utils_unittest.cc ('k') | ios/chrome/browser/component_updater/ios_component_updater_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698