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

Unified Diff: chrome/browser/extensions/external_registry_loader_win.cc

Issue 2809293004: Fix windows registry loader to carry over prefs from file thread correctly (Closed)
Patch Set: add test Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/external_registry_loader_win.cc
diff --git a/chrome/browser/extensions/external_registry_loader_win.cc b/chrome/browser/extensions/external_registry_loader_win.cc
index 0c1088480c2f2fc7d76b71ff0e094b469b24a53e..6f331080d34cf8a44a471ea63bb44eae9eb68c81 100644
--- a/chrome/browser/extensions/external_registry_loader_win.cc
+++ b/chrome/browser/extensions/external_registry_loader_win.cc
@@ -190,17 +190,20 @@ ExternalRegistryLoader::LoadPrefsOnFileThread() {
void ExternalRegistryLoader::LoadOnFileThread() {
base::TimeTicks start_time = base::TimeTicks::Now();
- prefs_ = LoadPrefsOnFileThread();
+ std::unique_ptr<base::DictionaryValue> prefs = LoadPrefsOnFileThread();
LOCAL_HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWin",
base::TimeTicks::Now() - start_time);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&ExternalRegistryLoader::CompleteLoadAndStartWatchingRegistry,
- this));
+ this, base::Passed(&prefs)));
}
-void ExternalRegistryLoader::CompleteLoadAndStartWatchingRegistry() {
+void ExternalRegistryLoader::CompleteLoadAndStartWatchingRegistry(
+ std::unique_ptr<base::DictionaryValue> prefs) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(prefs);
+ prefs_ = std::move(prefs);
LoadFinished();
Devlin 2017/04/12 19:32:06 I *think* this is safe - or rather, I think this w
lazyboy 2017/04/12 20:56:22 I was actually thinking about that while writing t
// Attempt to watch registry if we haven't already.

Powered by Google App Engine
This is Rietveld 408576698