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

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

Issue 28273006: <webview>: Implement declarativeWebRequest API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged 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) 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 #include "chrome/browser/extensions/api/declarative/rules_registry.h" 5 #include "chrome/browser/extensions/api/declarative/rules_registry.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 69
70 namespace extensions { 70 namespace extensions {
71 71
72 // RulesRegistry 72 // RulesRegistry
73 73
74 RulesRegistry::RulesRegistry( 74 RulesRegistry::RulesRegistry(
75 Profile* profile, 75 Profile* profile,
76 const std::string& event_name, 76 const std::string& event_name,
77 content::BrowserThread::ID owner_thread, 77 content::BrowserThread::ID owner_thread,
78 RulesCacheDelegate* cache_delegate) 78 RulesCacheDelegate* cache_delegate,
79 const WebViewKey& webview_key)
79 : profile_(profile), 80 : profile_(profile),
80 owner_thread_(owner_thread), 81 owner_thread_(owner_thread),
81 event_name_(event_name), 82 event_name_(event_name),
83 webview_key_(webview_key),
82 weak_ptr_factory_(profile ? this : NULL), 84 weak_ptr_factory_(profile ? this : NULL),
83 process_changed_rules_requested_(profile ? NOT_SCHEDULED_FOR_PROCESSING 85 process_changed_rules_requested_(profile ? NOT_SCHEDULED_FOR_PROCESSING
84 : NEVER_PROCESS), 86 : NEVER_PROCESS),
85 last_generated_rule_identifier_id_(0) { 87 last_generated_rule_identifier_id_(0) {
86 if (cache_delegate) { 88 if (cache_delegate) {
87 cache_delegate_ = cache_delegate->GetWeakPtr(); 89 cache_delegate_ = cache_delegate->GetWeakPtr();
88 cache_delegate->Init(this); 90 cache_delegate->Init(this);
89 } else { 91 } else {
90 ready_.Signal(); 92 ready_.Signal();
91 } 93 }
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 for (i = identifiers.begin(); i != identifiers.end(); ++i) 338 for (i = identifiers.begin(); i != identifiers.end(); ++i)
337 used_rule_identifiers_[extension_id].erase(*i); 339 used_rule_identifiers_[extension_id].erase(*i);
338 } 340 }
339 341
340 void RulesRegistry::RemoveAllUsedRuleIdentifiers( 342 void RulesRegistry::RemoveAllUsedRuleIdentifiers(
341 const std::string& extension_id) { 343 const std::string& extension_id) {
342 used_rule_identifiers_.erase(extension_id); 344 used_rule_identifiers_.erase(extension_id);
343 } 345 }
344 346
345 } // namespace extensions 347 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698