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

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: Sync with trunk 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 347908436fd092e45dbb5a83a8820f3df9dd630e..80d501bc6b0b7f71d78bdfedf0fff979cc0356b0 100644
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.h
@@ -22,18 +22,19 @@ 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();
+
// The network request that is currently being processed.
net::URLRequest* request;
// The stage (progress) of the network request.
RequestStage stage;
+ std::set<URLMatcherConditionSet::ID> url_match_ids;
+ 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;
@@ -62,6 +63,7 @@ class WebRequestCondition {
WebRequestCondition(
scoped_refptr<URLMatcherConditionSet> url_matcher_conditions,
+ scoped_refptr<URLMatcherConditionSet> first_party_url_matcher_conditions,
const WebRequestConditionAttributes& condition_attributes);
~WebRequestCondition();
@@ -72,22 +74,12 @@ 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;
-
- // True if this condition has a url filter.
- bool has_url_matcher_condition_set() const {
- return url_matcher_conditions_ != NULL;
- }
+ // Returns whether the request matches this condition.
+ bool IsFulfilled(const DeclarativeWebRequestData& request_data) const;
- // 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 {
@@ -100,9 +92,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