| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_USER_SCRIPT_MASTER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 class RenderProcessHost; | 26 class RenderProcessHost; |
| 27 } | 27 } |
| 28 | 28 |
| 29 class Profile; | 29 class Profile; |
| 30 | 30 |
| 31 typedef std::map<std::string, ExtensionSet::ExtensionPathAndDefaultLocale> | 31 typedef std::map<std::string, ExtensionSet::ExtensionPathAndDefaultLocale> |
| 32 ExtensionsInfo; | 32 ExtensionsInfo; |
| 33 | 33 |
| 34 namespace extensions { |
| 35 |
| 34 // Manages a segment of shared memory that contains the user scripts the user | 36 // Manages a segment of shared memory that contains the user scripts the user |
| 35 // has installed. Lives on the UI thread. | 37 // has installed. Lives on the UI thread. |
| 36 class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>, | 38 class UserScriptMaster : public base::RefCountedThreadSafe<UserScriptMaster>, |
| 37 public content::NotificationObserver { | 39 public content::NotificationObserver { |
| 38 public: | 40 public: |
| 39 explicit UserScriptMaster(Profile* profile); | 41 explicit UserScriptMaster(Profile* profile); |
| 40 | 42 |
| 41 // Kicks off a process on the file thread to reload scripts from disk | 43 // Kicks off a process on the file thread to reload scripts from disk |
| 42 // into a new chunk of shared memory and notify renderers. | 44 // into a new chunk of shared memory and notify renderers. |
| 43 virtual void StartLoad(); | 45 virtual void StartLoad(); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // that we're currently mid-load and then start over again once the load | 162 // that we're currently mid-load and then start over again once the load |
| 161 // finishes. This boolean tracks whether another load is pending. | 163 // finishes. This boolean tracks whether another load is pending. |
| 162 bool pending_load_; | 164 bool pending_load_; |
| 163 | 165 |
| 164 // The profile for which the scripts managed here are installed. | 166 // The profile for which the scripts managed here are installed. |
| 165 Profile* profile_; | 167 Profile* profile_; |
| 166 | 168 |
| 167 DISALLOW_COPY_AND_ASSIGN(UserScriptMaster); | 169 DISALLOW_COPY_AND_ASSIGN(UserScriptMaster); |
| 168 }; | 170 }; |
| 169 | 171 |
| 172 } // namespace extensions |
| 173 |
| 170 #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ | 174 #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_MASTER_H_ |
| OLD | NEW |