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

Side by Side Diff: chrome/browser/extensions/api/declarative/rules_cache_delegate.h

Issue 216513002: Replace DCHECK(BrowserThread::CurrentlyOn) with DCHECK_CURRENTLY_ON in extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_API_DECLARATIVE_RULES_CACHE_DELEGATE_H__ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_CACHE_DELEGATE_H__
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_CACHE_DELEGATE_H__ 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_CACHE_DELEGATE_H__
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 24 matching lines...) Expand all
35 static std::string GetRulesStoredKey(const std::string& event_name, 35 static std::string GetRulesStoredKey(const std::string& event_name,
36 bool incognito); 36 bool incognito);
37 37
38 // Initialize the storage functionality. 38 // Initialize the storage functionality.
39 void Init(RulesRegistry* registry); 39 void Init(RulesRegistry* registry);
40 40
41 void WriteToStorage(const std::string& extension_id, 41 void WriteToStorage(const std::string& extension_id,
42 scoped_ptr<base::Value> value); 42 scoped_ptr<base::Value> value);
43 43
44 base::WeakPtr<RulesCacheDelegate> GetWeakPtr() { 44 base::WeakPtr<RulesCacheDelegate> GetWeakPtr() {
45 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 45 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
46 return weak_ptr_factory_.GetWeakPtr(); 46 return weak_ptr_factory_.GetWeakPtr();
47 } 47 }
48 48
49 private: 49 private:
50 FRIEND_TEST_ALL_PREFIXES(RulesRegistryWithCacheTest, 50 FRIEND_TEST_ALL_PREFIXES(RulesRegistryWithCacheTest,
51 DeclarativeRulesStored); 51 DeclarativeRulesStored);
52 FRIEND_TEST_ALL_PREFIXES(RulesRegistryWithCacheTest, 52 FRIEND_TEST_ALL_PREFIXES(RulesRegistryWithCacheTest,
53 RulesStoredFlagMultipleRegistries); 53 RulesStoredFlagMultipleRegistries);
54 54
55 static const char kRulesStoredKey[]; 55 static const char kRulesStoredKey[];
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // We notified the RulesRegistry that the rules are loaded. 101 // We notified the RulesRegistry that the rules are loaded.
102 bool notified_registry_; 102 bool notified_registry_;
103 103
104 // Use this factory to generate weak pointers bound to the UI thread. 104 // Use this factory to generate weak pointers bound to the UI thread.
105 base::WeakPtrFactory<RulesCacheDelegate> weak_ptr_factory_; 105 base::WeakPtrFactory<RulesCacheDelegate> weak_ptr_factory_;
106 }; 106 };
107 107
108 } // namespace extensions 108 } // namespace extensions
109 109
110 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_CACHE_DELEGATE_H__ 110 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_RULES_CACHE_DELEGATE_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698