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

Unified Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h

Issue 11414230: Declarative Web Request: firstPartyForCookiesUrl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added event order Created 8 years 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
Index: chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h
index 922dba7f111ffdc12352c2e06703c3fa828e3197..b6f9c85aa210f852082fb4024e839ddfefee9367 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h
@@ -37,6 +37,7 @@ class WebRequestCondition {
public:
WebRequestCondition(
scoped_refptr<URLMatcherConditionSet> url_matcher_conditions,
+ scoped_refptr<URLMatcherConditionSet> first_party_url_matcher_conditions,
const WebRequestConditionAttributes& condition_attributes);
~WebRequestCondition();
@@ -44,11 +45,13 @@ class WebRequestCondition {
// the description |condition| passed by the extension API.
static scoped_ptr<WebRequestCondition> Create(
URLMatcherConditionFactory* url_matcher_condition_factory,
+ URLMatcherConditionFactory* first_party_url_matcher_condition_factory,
Jeffrey Yasskin 2012/12/18 03:09:58 Why are there two condition_factories when the oth
vabr (Chromium) 2013/01/21 10:57:48 This has now changed to multiple factories and mul
const base::Value& condition,
std::string* error);
// Returns whether the request is a match, given that the URLMatcher found
- // a match for |url_matcher_conditions_|.
+ // a match for |url_matcher_conditions_| and
+ // |first_party_url_matcher_conditions_|.
bool IsFulfilled(const WebRequestRule::RequestData& request_data) const;
// Returns a URLMatcherConditionSet::ID which is the canonical representation
@@ -58,6 +61,9 @@ class WebRequestCondition {
URLMatcherConditionSet::ID url_matcher_condition_set_id() const {
return url_matcher_conditions_->id();
}
+ URLMatcherConditionSet::ID first_party_url_matcher_condition_set_id() const {
+ return first_party_url_matcher_conditions_->id();
+ }
// Returns the set of conditions that are checked on the URL. This is the
// primary trigger for WebRequestCondition and therefore never empty.
@@ -66,6 +72,12 @@ class WebRequestCondition {
scoped_refptr<URLMatcherConditionSet> url_matcher_condition_set() const {
return url_matcher_conditions_;
}
+ // Returns the set of conditions that are checked on the first party for
+ // cookies URL. This is also never empty.
+ scoped_refptr<URLMatcherConditionSet>
+ first_party_url_matcher_condition_set() const {
+ return first_party_url_matcher_conditions_;
+ }
// Returns the condition attributes checked by this condition.
const WebRequestConditionAttributes condition_attributes() const {
@@ -79,6 +91,7 @@ class WebRequestCondition {
private:
scoped_refptr<URLMatcherConditionSet> url_matcher_conditions_;
+ scoped_refptr<URLMatcherConditionSet> first_party_url_matcher_conditions_;
WebRequestConditionAttributes condition_attributes_;
// Bit vector indicating all RequestStage during which all
@@ -104,6 +117,7 @@ class WebRequestConditionSet {
// Sets |error| and returns NULL in case of an error.
static scoped_ptr<WebRequestConditionSet> Create(
URLMatcherConditionFactory* url_matcher_condition_factory,
+ URLMatcherConditionFactory* first_party_url_matcher_condition_factory,
const AnyVector& conditions,
std::string* error);
@@ -120,9 +134,12 @@ class WebRequestConditionSet {
URLMatcherConditionSet::ID url_match,
const WebRequestRule::RequestData& request_data) const;
- // Appends the URLMatcherConditionSet from all conditions to |condition_sets|.
+ // Append the URLMatcherConditionSet for request URL, and for the first party
+ // for cookies URL, respectively, from all conditions to |condition_sets|.
void GetURLMatcherConditionSets(
URLMatcherConditionSet::Vector* condition_sets) const;
+ void GetFirstPartyURLMatcherConditionSets(
+ URLMatcherConditionSet::Vector* condition_sets) const;
private:
Conditions conditions_;

Powered by Google App Engine
This is Rietveld 408576698