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

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

Issue 1495403002: Observe adding external extensions via windows registry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move prefs to OnUpdated's param, instead of storing, to avoid multi-thread issues Created 4 years, 11 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_LOADER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // By default, return an empty path, which indicates that relative paths 51 // By default, return an empty path, which indicates that relative paths
52 // are not allowed. 52 // are not allowed.
53 virtual const base::FilePath GetBaseCrxFilePath(); 53 virtual const base::FilePath GetBaseCrxFilePath();
54 54
55 protected: 55 protected:
56 virtual ~ExternalLoader(); 56 virtual ~ExternalLoader();
57 57
58 // Notifies the provider that the list of extensions has been loaded. 58 // Notifies the provider that the list of extensions has been loaded.
59 virtual void LoadFinished(); 59 virtual void LoadFinished();
60 60
61 // Notifies the provider that the list of extensions has been updated.
62 virtual void OnUpdated(scoped_ptr<base::DictionaryValue> updated_prefs);
lazyboy 2016/01/26 23:44:43 @asargent, as we discussed offline, I've made the
63
61 // Used for passing the list of extensions from the method that loads them 64 // Used for passing the list of extensions from the method that loads them
62 // to |LoadFinished|. To ensure thread safety, the rules are the following: 65 // to |LoadFinished|. To ensure thread safety, the rules are the following:
63 // if this value is written on another thread than the UI, then it should 66 // if this value is written on another thread than the UI, then it should
64 // only be written in a task that was posted from |StartLoading|. After that, 67 // only be written in a task that was posted from |StartLoading|. After that,
65 // this task should invoke |LoadFinished| with a PostTask. This scheme of 68 // this task should invoke |LoadFinished| with a PostTask. This scheme of
66 // posting tasks will avoid concurrent access and imply the necessary memory 69 // posting tasks will avoid concurrent access and imply the necessary memory
67 // barriers. 70 // barriers.
68 scoped_ptr<base::DictionaryValue> prefs_; 71 scoped_ptr<base::DictionaryValue> prefs_;
69 72
70 private: 73 private:
71 friend class base::RefCountedThreadSafe<ExternalLoader>; 74 friend class base::RefCountedThreadSafe<ExternalLoader>;
72 75
73 ExternalProviderImpl* owner_; // weak 76 ExternalProviderImpl* owner_; // weak
74 77
75 DISALLOW_COPY_AND_ASSIGN(ExternalLoader); 78 DISALLOW_COPY_AND_ASSIGN(ExternalLoader);
76 }; 79 };
77 80
78 } // namespace extensions 81 } // namespace extensions
79 82
80 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_ 83 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_LOADER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/extensions/external_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698