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

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: Fixed browser_tests build 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.
Jeffrey Yasskin 2013/11/09 02:47:22 We don't generally update copyright years: http://
Fady Samuel 2013/11/10 03:39:56 Done.
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 content::BrowserThread::PostTask( 92 content::BrowserThread::PostTask(
91 owner_thread, 93 owner_thread,
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 for (i = identifiers.begin(); i != identifiers.end(); ++i) 341 for (i = identifiers.begin(); i != identifiers.end(); ++i)
340 used_rule_identifiers_[extension_id].erase(*i); 342 used_rule_identifiers_[extension_id].erase(*i);
341 } 343 }
342 344
343 void RulesRegistry::RemoveAllUsedRuleIdentifiers( 345 void RulesRegistry::RemoveAllUsedRuleIdentifiers(
344 const std::string& extension_id) { 346 const std::string& extension_id) {
345 used_rule_identifiers_.erase(extension_id); 347 used_rule_identifiers_.erase(extension_id);
346 } 348 }
347 349
348 } // namespace extensions 350 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698