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

Unified Diff: chrome/browser/renderer_host/resource_dispatcher_host.cc

Issue 149737: Blacklist API change for allowing multiple rule matches... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/renderer_host/resource_dispatcher_host.cc
===================================================================
--- chrome/browser/renderer_host/resource_dispatcher_host.cc (revision 20880)
+++ chrome/browser/renderer_host/resource_dispatcher_host.cc (working copy)
@@ -358,10 +358,11 @@
}
// Note that context can still be NULL here when running unit tests.
- const Blacklist::Entry* entry = context && context->blacklist() ?
+ Blacklist::Match* match = context && context->blacklist() ?
context->blacklist()->findMatch(request_data.url) : NULL;
- if (entry && entry->IsBlocked(request_data.url)) {
+ if (match && match->IsBlocked(request_data.url)) {
// TODO(idanan): Send a ResourceResponse to replace the blocked resource.
+ delete match;
return;
}
@@ -392,14 +393,13 @@
// Construct the request.
URLRequest* request = new URLRequest(request_data.url, this);
- if (entry && entry->attributes()) {
- request->SetUserData((void*)&Blacklist::kRequestDataKey,
- new Blacklist::RequestData(entry));
+ if (match) {
+ request->SetUserData((void*)&Blacklist::kRequestDataKey, match);
}
request->set_method(request_data.method);
request->set_first_party_for_cookies(request_data.first_party_for_cookies);
- if (!entry || !(entry->attributes() & Blacklist::kDontSendReferrer))
+ if (!match || !(match->attributes() & Blacklist::kDontSendReferrer))
request->set_referrer(request_data.referrer.spec());
request->SetExtraRequestHeaders(request_data.headers);
« no previous file with comments | « chrome/browser/privacy_blacklist/blacklist_unittest.cc ('k') | chrome/browser/renderer_host/resource_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698