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

Side by Side Diff: chrome/browser/extensions/api/declarative/test_rules_registry.cc

Issue 53273002: Decouple RulesCacheDelegate from RulesRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_rules_registry_with_cache
Patch Set: Merge with ToT Created 7 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 unified diff | Download patch
OLDNEW
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 #include <string> 5 #include <string>
6 6
7 #include "chrome/browser/extensions/api/declarative/test_rules_registry.h" 7 #include "chrome/browser/extensions/api/declarative/test_rules_registry.h"
8 8
9 namespace extensions { 9 namespace extensions {
10 10
11 TestRulesRegistry::TestRulesRegistry(content::BrowserThread::ID owner_thread, 11 TestRulesRegistry::TestRulesRegistry(content::BrowserThread::ID owner_thread,
12 const std::string& event_name) 12 const std::string& event_name)
13 : RulesRegistry(NULL /*profile*/, 13 : RulesRegistry(NULL /*profile*/,
14 event_name, 14 event_name,
15 owner_thread, 15 owner_thread) {}
16 false /*log_storage_init_delay, this is ignored*/,
17 NULL /*ui_part*/) {}
18 16
19 TestRulesRegistry::TestRulesRegistry( 17 TestRulesRegistry::TestRulesRegistry(
20 Profile* profile, 18 Profile* profile,
21 const std::string& event_name, 19 const std::string& event_name,
22 content::BrowserThread::ID owner_thread, 20 content::BrowserThread::ID owner_thread,
23 scoped_ptr<RulesCacheDelegate>* ui_part) 21 scoped_ptr<RulesCacheDelegate>* ui_part)
24 : RulesRegistry(profile, 22 : RulesRegistry(profile,
25 event_name, 23 event_name,
26 owner_thread, 24 owner_thread) {}
27 false /*log_storage_init_delay*/,
28 ui_part) {}
29 25
30 std::string TestRulesRegistry::AddRulesImpl( 26 std::string TestRulesRegistry::AddRulesImpl(
31 const std::string& extension_id, 27 const std::string& extension_id,
32 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) { 28 const std::vector<linked_ptr<RulesRegistry::Rule> >& rules) {
33 return result_; 29 return result_;
34 } 30 }
35 31
36 std::string TestRulesRegistry::RemoveRulesImpl( 32 std::string TestRulesRegistry::RemoveRulesImpl(
37 const std::string& extension_id, 33 const std::string& extension_id,
38 const std::vector<std::string>& rule_identifiers) { 34 const std::vector<std::string>& rule_identifiers) {
39 return result_; 35 return result_;
40 } 36 }
41 37
42 std::string TestRulesRegistry::RemoveAllRulesImpl( 38 std::string TestRulesRegistry::RemoveAllRulesImpl(
43 const std::string& extension_id) { 39 const std::string& extension_id) {
44 return result_; 40 return result_;
45 } 41 }
46 42
47 void TestRulesRegistry::SetResult(const std::string& result) { 43 void TestRulesRegistry::SetResult(const std::string& result) {
48 result_ = result; 44 result_ = result;
49 } 45 }
50 46
51 TestRulesRegistry::~TestRulesRegistry() {} 47 TestRulesRegistry::~TestRulesRegistry() {}
52 48
53 } // namespace extensions 49 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698