Chromium Code Reviews| Index: chrome/browser/component_updater/sth_set_component_installer.cc |
| diff --git a/chrome/browser/component_updater/sth_set_component_installer.cc b/chrome/browser/component_updater/sth_set_component_installer.cc |
| index b6ced0134ef16a261d8719e72d851bbaeb5ac705..4a80ff1b70779c25cf21285a56616ee883fd9acf 100644 |
| --- a/chrome/browser/component_updater/sth_set_component_installer.cc |
| +++ b/chrome/browser/component_updater/sth_set_component_installer.cc |
| @@ -16,8 +16,10 @@ |
| #include "base/values.h" |
| #include "base/version.h" |
| #include "chrome/browser/net/sth_distributor_provider.h" |
| +#include "chrome/common/chrome_features.h" |
| #include "components/component_updater/component_updater_paths.h" |
| #include "components/safe_json/safe_json_parser.h" |
| +#include "components/variations/variations_associated_data.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "crypto/sha2.h" |
| #include "net/cert/ct_log_response_parser.h" |
| @@ -74,12 +76,21 @@ void STHSetComponentInstallerTraits::ComponentReady( |
| const base::Version& version, |
| const base::FilePath& install_dir, |
| std::unique_ptr<base::DictionaryValue> manifest) { |
| - if (!content::BrowserThread::PostBlockingPoolTask( |
| - FROM_HERE, |
| - base::Bind(&STHSetComponentInstallerTraits::LoadSTHsFromDisk, |
| - base::Unretained(this), GetInstalledPath(install_dir), |
| - version))) { |
| - NOTREACHED(); |
| + if (variations::GetVariationParamValueByFeature(features::kSTHSetComponent, |
| + "delayed_load") == "yes") { |
|
gab
2016/07/12 20:09:25
Flip this condition around (i.e. make the default
Eran Messeri
2016/07/13 10:51:55
Done.
|
| + content::BrowserThread::PostAfterStartupTask( |
|
gab
2016/07/12 20:09:24
Actually, IIUC from https://codereview.chromium.or
Eran Messeri
2016/07/13 10:51:55
Yes, loading the STHs can be delayed by 5-10 minut
gab
2016/07/13 17:29:08
Ok then please use:
// STHs perform an async sani
gab
2016/07/14 14:46:03
ping (shall we do a mega delay? that won't result
Eran Messeri
2016/07/18 09:36:06
To follow up, since we came to the conclusion we c
|
| + FROM_HERE, content::BrowserThread::GetBlockingPool(), |
| + base::Bind(&STHSetComponentInstallerTraits::LoadSTHsFromDisk, |
| + base::Unretained(this), GetInstalledPath(install_dir), |
|
Alexei Svitkine (slow)
2016/07/12 19:59:27
As an aside, why is this used base::Unretained()?
Eran Messeri
2016/07/13 10:51:55
There are no guarantees, so I've switched to a Wea
|
| + version)); |
| + } else { |
| + if (!content::BrowserThread::PostBlockingPoolTask( |
| + FROM_HERE, |
| + base::Bind(&STHSetComponentInstallerTraits::LoadSTHsFromDisk, |
|
gab
2016/07/12 20:09:24
Extract:
const base::Closure load_sths_closure =
Eran Messeri
2016/07/13 10:51:55
Done.
|
| + base::Unretained(this), GetInstalledPath(install_dir), |
| + version))) { |
| + NOTREACHED(); |
|
gab
2016/07/12 20:09:24
This NOTREACHED() is not necessary. PostTask() wil
Eran Messeri
2016/07/13 10:51:55
Thanks for the explanation, removed. Does it make
gab
2016/07/13 17:29:08
There are far more places that don't have NOTREACH
|
| + } |
| } |
| } |