OLD | NEW |
---|---|
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 Loading... | |
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_ |
OLD | NEW |