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

Unified Diff: chrome/browser/extensions/api/declarative/declarative_rule.h

Issue 14358004: Almost all actions in Declarative Web Request require all_urls host permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: All URLs -> all hosts; also rebased Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/declarative_rule_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative/declarative_rule.h
diff --git a/chrome/browser/extensions/api/declarative/declarative_rule.h b/chrome/browser/extensions/api/declarative/declarative_rule.h
index e9411550432e17d8ecf20952078e05fdd8c64355..a2dd1f572dd7287f7b6e4a9b5f628e6bc6da0f45 100644
--- a/chrome/browser/extensions/api/declarative/declarative_rule.h
+++ b/chrome/browser/extensions/api/declarative/declarative_rule.h
@@ -15,6 +15,7 @@
#include <string>
#include <vector>
+#include "base/callback.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/stl_util.h"
@@ -190,9 +191,9 @@ class DeclarativeRule {
// Checks whether the set of |conditions| and |actions| are consistent.
// Returns true in case of consistency and MUST set |error| otherwise.
- typedef bool (*ConsistencyChecker)(const ConditionSet* conditions,
- const ActionSet* actions,
- std::string* error);
+ typedef base::Callback<bool(const ConditionSet* conditions,
+ const ActionSet* actions,
+ std::string* error)> ConsistencyChecker;
DeclarativeRule(const GlobalRuleId& id,
const Tags& tags,
@@ -448,8 +449,8 @@ DeclarativeRule<ConditionT, ActionT>::Create(
return error_result.Pass();
CHECK(actions.get());
- if (check_consistency &&
- !check_consistency(conditions.get(), actions.get(), error)) {
+ if (!check_consistency.is_null() &&
+ !check_consistency.Run(conditions.get(), actions.get(), error)) {
DCHECK(!error->empty());
return error_result.Pass();
}
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/declarative_rule_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698