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

Side by Side Diff: chrome/browser/extensions/external_registry_loader_win.h

Issue 2809293004: Fix windows registry loader to carry over prefs from file thread correctly (Closed)
Patch Set: add TODO 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_REGISTRY_LOADER_WIN_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_REGISTRY_LOADER_WIN_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_REGISTRY_LOADER_WIN_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_REGISTRY_LOADER_WIN_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/win/registry.h" 10 #include "base/win/registry.h"
11 #include "chrome/browser/extensions/external_loader.h" 11 #include "chrome/browser/extensions/external_loader.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 14
15 class ExternalRegistryLoader : public ExternalLoader { 15 class ExternalRegistryLoader : public ExternalLoader {
16 public: 16 public:
17 ExternalRegistryLoader(); 17 ExternalRegistryLoader();
18 18
19 protected: 19 protected:
20 ~ExternalRegistryLoader() override {} // protected for unit test. 20 ~ExternalRegistryLoader() override {} // protected for unit test.
21 21
22 void StartLoading() override; 22 void StartLoading() override;
23 23
24 // Overridden to mock registry reading in unit tests.
25 virtual std::unique_ptr<base::DictionaryValue> LoadPrefsOnFileThread();
26
24 private: 27 private:
25 friend class base::RefCountedThreadSafe<ExternalLoader>; 28 friend class base::RefCountedThreadSafe<ExternalLoader>;
26 29
27 std::unique_ptr<base::DictionaryValue> LoadPrefsOnFileThread();
28 void LoadOnFileThread(); 30 void LoadOnFileThread();
29 void CompleteLoadAndStartWatchingRegistry(); 31 void CompleteLoadAndStartWatchingRegistry(
32 std::unique_ptr<base::DictionaryValue> prefs);
30 void UpdatePrefsOnFileThread(); 33 void UpdatePrefsOnFileThread();
31 void OnRegistryKeyChanged(base::win::RegKey* key); 34 void OnRegistryKeyChanged(base::win::RegKey* key);
32 35
33 // Whether or not we attempted to observe registry. 36 // Whether or not we attempted to observe registry.
34 bool attempted_watching_registry_; 37 bool attempted_watching_registry_;
35 38
36 base::win::RegKey hklm_key_; 39 base::win::RegKey hklm_key_;
37 base::win::RegKey hkcu_key_; 40 base::win::RegKey hkcu_key_;
38 41
39 DISALLOW_COPY_AND_ASSIGN(ExternalRegistryLoader); 42 DISALLOW_COPY_AND_ASSIGN(ExternalRegistryLoader);
40 }; 43 };
41 44
42 } // namespace extensions 45 } // namespace extensions
43 46
44 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_REGISTRY_LOADER_WIN_H_ 47 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_REGISTRY_LOADER_WIN_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_loader.h ('k') | chrome/browser/extensions/external_registry_loader_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698