| 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 #include "extensions/browser/api/declarative/rules_registry.h" | 5 #include "extensions/browser/api/declarative/rules_registry.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 UMA_HISTOGRAM_TIMES("Extensions.DeclarativeRulesStorageInitialization", | 325 UMA_HISTOGRAM_TIMES("Extensions.DeclarativeRulesStorageInitialization", |
| 326 base::Time::Now() - storage_init_time); | 326 base::Time::Now() - storage_init_time); |
| 327 } | 327 } |
| 328 | 328 |
| 329 ready_.Signal(); | 329 ready_.Signal(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 void RulesRegistry::ProcessChangedRules(const std::string& extension_id) { | 332 void RulesRegistry::ProcessChangedRules(const std::string& extension_id) { |
| 333 DCHECK_CURRENTLY_ON(owner_thread()); | 333 DCHECK_CURRENTLY_ON(owner_thread()); |
| 334 | 334 |
| 335 DCHECK(ContainsKey(process_changed_rules_requested_, extension_id)); | 335 DCHECK(base::ContainsKey(process_changed_rules_requested_, extension_id)); |
| 336 process_changed_rules_requested_[extension_id] = NOT_SCHEDULED_FOR_PROCESSING; | 336 process_changed_rules_requested_[extension_id] = NOT_SCHEDULED_FOR_PROCESSING; |
| 337 | 337 |
| 338 std::vector<linked_ptr<api::events::Rule>> new_rules; | 338 std::vector<linked_ptr<api::events::Rule>> new_rules; |
| 339 GetRules(extension_id, rules_, &new_rules); | 339 GetRules(extension_id, rules_, &new_rules); |
| 340 content::BrowserThread::PostTask( | 340 content::BrowserThread::PostTask( |
| 341 content::BrowserThread::UI, FROM_HERE, | 341 content::BrowserThread::UI, FROM_HERE, |
| 342 base::Bind(&RulesCacheDelegate::WriteToStorage, cache_delegate_, | 342 base::Bind(&RulesCacheDelegate::WriteToStorage, cache_delegate_, |
| 343 extension_id, base::Passed(RulesToValue(new_rules)))); | 343 extension_id, base::Passed(RulesToValue(new_rules)))); |
| 344 } | 344 } |
| 345 | 345 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 for (i = identifiers.begin(); i != identifiers.end(); ++i) | 427 for (i = identifiers.begin(); i != identifiers.end(); ++i) |
| 428 used_rule_identifiers_[extension_id].erase(*i); | 428 used_rule_identifiers_[extension_id].erase(*i); |
| 429 } | 429 } |
| 430 | 430 |
| 431 void RulesRegistry::RemoveAllUsedRuleIdentifiers( | 431 void RulesRegistry::RemoveAllUsedRuleIdentifiers( |
| 432 const std::string& extension_id) { | 432 const std::string& extension_id) { |
| 433 used_rule_identifiers_.erase(extension_id); | 433 used_rule_identifiers_.erase(extension_id); |
| 434 } | 434 } |
| 435 | 435 |
| 436 } // namespace extensions | 436 } // namespace extensions |
| OLD | NEW |