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

Side by Side Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_rule.cc

Issue 9844028: Implement rules removal for WebRequestRulesRegistry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 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 (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 "chrome/browser/extensions/api/declarative_webrequest/webrequest_rule.h " 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_rule.h "
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_action .h" 8 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_action .h"
9 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit ion.h" 9 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit ion.h"
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 WebRequestActionSet::Create(rule->actions, error); 51 WebRequestActionSet::Create(rule->actions, error);
52 if (!error->empty()) 52 if (!error->empty())
53 return error_result.Pass(); 53 return error_result.Pass();
54 CHECK(actions.get()); 54 CHECK(actions.get());
55 55
56 if (!CheckConsistency(conditions.get(), actions.get(), error)) { 56 if (!CheckConsistency(conditions.get(), actions.get(), error)) {
57 DCHECK(!error->empty()); 57 DCHECK(!error->empty());
58 return error_result.Pass(); 58 return error_result.Pass();
59 } 59 }
60 60
61 GlobalRuleId rule_id = make_pair(extension_id, *(rule->id)); 61 GlobalRuleId rule_id(extension_id, *(rule->id));
62 return scoped_ptr<WebRequestRule>( 62 return scoped_ptr<WebRequestRule>(
63 new WebRequestRule(rule_id, conditions.Pass(), actions.Pass())); 63 new WebRequestRule(rule_id, conditions.Pass(), actions.Pass()));
64 } 64 }
65 65
66 } // namespace extensions 66 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698