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

Unified Diff: extensions/browser/api/declarative/rules_registry.h

Issue 744663002: Fix WeakPtrFactory member ordering in extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated changes Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | extensions/browser/api/declarative/rules_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/declarative/rules_registry.h
diff --git a/extensions/browser/api/declarative/rules_registry.h b/extensions/browser/api/declarative/rules_registry.h
index fa0e745a444d34f780b13dc0232ebe6fb8aecd94..4772823f6539d7d18b4bd33b6033d6ccf0fefc56 100644
--- a/extensions/browser/api/declarative/rules_registry.h
+++ b/extensions/browser/api/declarative/rules_registry.h
@@ -241,19 +241,6 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
// are loaded on startup.
OneShotEvent ready_;
- // The factory needs to be declared before |cache_delegate_|, so that it can
- // produce a pointer as a construction argument for |cache_delegate_|.
- base::WeakPtrFactory<RulesRegistry> weak_ptr_factory_;
-
- // |cache_delegate_| is owned by the registry service. If |cache_delegate_| is
- // NULL, then the storage functionality is disabled (this is used in tests).
- // This registry cannot own |cache_delegate_| because during the time after
- // rules registry service shuts down on UI thread, and the registry is
- // destroyed on its thread, the use of the |cache_delegate_| would not be
- // safe. The registry only ever associates with one RulesCacheDelegate
- // instance.
- base::WeakPtr<RulesCacheDelegate> cache_delegate_;
-
ProcessStateMap process_changed_rules_requested_;
// Returns whether any existing rule is registered with identifier |rule_id|
@@ -288,6 +275,19 @@ class RulesRegistry : public base::RefCountedThreadSafe<RulesRegistry> {
RuleIdentifiersMap used_rule_identifiers_;
int last_generated_rule_identifier_id_;
+ // The factory needs to be declared before |cache_delegate_|, so that it can
+ // produce a pointer as a construction argument for |cache_delegate_|.
+ base::WeakPtrFactory<RulesRegistry> weak_ptr_factory_;
+
+ // |cache_delegate_| is owned by the registry service. If |cache_delegate_| is
+ // NULL, then the storage functionality is disabled (this is used in tests).
+ // This registry cannot own |cache_delegate_| because during the time after
+ // rules registry service shuts down on UI thread, and the registry is
+ // destroyed on its thread, the use of the |cache_delegate_| would not be
+ // safe. The registry only ever associates with one RulesCacheDelegate
+ // instance.
+ base::WeakPtr<RulesCacheDelegate> cache_delegate_;
+
DISALLOW_COPY_AND_ASSIGN(RulesRegistry);
};
« no previous file with comments | « no previous file | extensions/browser/api/declarative/rules_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698