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

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: Back to one matcher Created 7 years, 11 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
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 fd8c4c1ac57e523fbe81e82fbdd7bb99588e8d4c..1f429b376ca3d47a390f44412c7a438eed307dde 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h
@@ -22,16 +22,16 @@ namespace extensions {
// Container for information about a URLRequest to determine which
// rules apply to the request.
struct DeclarativeWebRequestData {
- DeclarativeWebRequestData(net::URLRequest* request, RequestStage stage)
- : request(request), stage(stage),
- original_response_headers(NULL) {}
+ DeclarativeWebRequestData(net::URLRequest* request, RequestStage stage);
DeclarativeWebRequestData(
- net::URLRequest* request, RequestStage stage,
- const net::HttpResponseHeaders* original_response_headers)
- : request(request), stage(stage),
- original_response_headers(original_response_headers) {}
+ net::URLRequest* request,
+ RequestStage stage,
+ const net::HttpResponseHeaders* original_response_headers);
+ ~DeclarativeWebRequestData();
net::URLRequest* request;
RequestStage stage;
+ std::set<URLMatcherConditionSet::ID> url_match_ids;
vabr (Chromium) 2013/01/22 14:54:30 Adding the sets caused the need for off-lined cons
+ std::set<URLMatcherConditionSet::ID> first_party_url_match_ids;
// Additional information about requests that is not
// available in all request stages.
const net::HttpResponseHeaders* original_response_headers;
@@ -60,6 +60,7 @@ class WebRequestCondition {
WebRequestCondition(
scoped_refptr<URLMatcherConditionSet> url_matcher_conditions,
+ scoped_refptr<URLMatcherConditionSet> first_party_url_matcher_conditions,
const WebRequestConditionAttributes& condition_attributes);
~WebRequestCondition();
@@ -70,22 +71,14 @@ class WebRequestCondition {
const base::Value& condition,
std::string* error);
- // Returns whether the request matches this condition. |url_matches| lists
- // the IDs that match the request's URL.
- bool IsFulfilled(const std::set<URLMatcherConditionSet::ID> &url_matches,
- const DeclarativeWebRequestData& request_data) const;
+ // Returns whether the request matches this condition.
+ bool IsFulfilled(
+ const std::set<URLMatcherConditionSet::ID>& /*url_matches*/,
vabr (Chromium) 2013/01/22 14:54:30 Now that we ignore |url_matches| in favour of the
+ const DeclarativeWebRequestData& request_data) const;
- // True if this condition has a url filter.
- bool has_url_matcher_condition_set() const {
- return url_matcher_conditions_ != NULL;
- }
-
- // If this Condition has a url filter, appends it to |condition_sets|.
+ // If this condition has url attributes, appends them to |condition_sets|.
void GetURLMatcherConditionSets(
- URLMatcherConditionSet::Vector* condition_sets) const {
- if (url_matcher_conditions_)
- condition_sets->push_back(url_matcher_conditions_);
- }
+ URLMatcherConditionSet::Vector* condition_sets) const;
// Returns the condition attributes checked by this condition.
const WebRequestConditionAttributes condition_attributes() const {
@@ -98,9 +91,9 @@ class WebRequestCondition {
int stages() const { return applicable_request_stages_; }
private:
- // Represents the 'url' attribute of this condition. If NULL, then there was
- // no 'url' attribute in this condition.
+ // URL attributes of this condition.
scoped_refptr<URLMatcherConditionSet> url_matcher_conditions_;
+ scoped_refptr<URLMatcherConditionSet> first_party_url_matcher_conditions_;
// All non-UrlFilter attributes of this condition.
WebRequestConditionAttributes condition_attributes_;

Powered by Google App Engine
This is Rietveld 408576698