| 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 EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ | 5 #ifndef EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ |
| 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ | 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 class Extension; | 34 class Extension; |
| 35 class RulesCacheDelegate; | 35 class RulesCacheDelegate; |
| 36 | 36 |
| 37 // A base class for RulesRegistries that takes care of storing the | 37 // A base class for RulesRegistries that takes care of storing the |
| 38 // RulesRegistry::Rule objects. It contains all the methods that need to run on | 38 // RulesRegistry::Rule objects. It contains all the methods that need to run on |
| 39 // the registry thread; methods that need to run on the UI thread are separated | 39 // the registry thread; methods that need to run on the UI thread are separated |
| 40 // in the RulesCacheDelegate object. | 40 // in the RulesCacheDelegate object. |
| 41 class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> { | 41 class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> { |
| 42 public: | 42 public: |
| 43 typedef extensions::core_api::events::Rule Rule; | 43 typedef extensions::api::events::Rule Rule; |
| 44 | 44 |
| 45 enum Defaults { DEFAULT_PRIORITY = 100 }; | 45 enum Defaults { DEFAULT_PRIORITY = 100 }; |
| 46 // After the RulesCacheDelegate object (the part of the registry which runs on | 46 // After the RulesCacheDelegate object (the part of the registry which runs on |
| 47 // the UI thread) is created, a pointer to it is passed to |*ui_part|. | 47 // the UI thread) is created, a pointer to it is passed to |*ui_part|. |
| 48 // In tests, |browser_context| and |ui_part| can be NULL (at the same time). | 48 // In tests, |browser_context| and |ui_part| can be NULL (at the same time). |
| 49 // In that case the storage functionality disabled (no RulesCacheDelegate | 49 // In that case the storage functionality disabled (no RulesCacheDelegate |
| 50 // object created). | 50 // object created). |
| 51 RulesRegistry(content::BrowserContext* browser_context, | 51 RulesRegistry(content::BrowserContext* browser_context, |
| 52 const std::string& event_name, | 52 const std::string& event_name, |
| 53 content::BrowserThread::ID owner_thread, | 53 content::BrowserThread::ID owner_thread, |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 base::WeakPtr<RulesCacheDelegate> cache_delegate_; | 295 base::WeakPtr<RulesCacheDelegate> cache_delegate_; |
| 296 | 296 |
| 297 base::WeakPtrFactory<RulesRegistry> weak_ptr_factory_; | 297 base::WeakPtrFactory<RulesRegistry> weak_ptr_factory_; |
| 298 | 298 |
| 299 DISALLOW_COPY_AND_ASSIGN(RulesRegistry); | 299 DISALLOW_COPY_AND_ASSIGN(RulesRegistry); |
| 300 }; | 300 }; |
| 301 | 301 |
| 302 } // namespace extensions | 302 } // namespace extensions |
| 303 | 303 |
| 304 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ | 304 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_RULES_REGISTRY_H__ |
| OLD | NEW |