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

Unified Diff: chrome/browser/renderer_host/resource_message_filter.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
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/resource_message_filter.cc
===================================================================
--- chrome/browser/renderer_host/resource_message_filter.cc (revision 20880)
+++ chrome/browser/renderer_host/resource_message_filter.cc (working copy)
@@ -18,6 +18,7 @@
#include "chrome/browser/net/dns_global.h"
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/privacy_blacklist/blacklist.h"
#include "chrome/browser/renderer_host/audio_renderer_host.h"
#include "chrome/browser/renderer_host/browser_render_process_host.h"
#include "chrome/browser/renderer_host/file_system_accessor.h"
@@ -424,8 +425,22 @@
const std::string& cookie) {
URLRequestContext* context = url.SchemeIs(chrome::kExtensionScheme) ?
extensions_request_context_.get() : request_context_.get();
- if (context->cookie_policy()->CanSetCookie(url, first_party_for_cookies))
- context->cookie_store()->SetCookie(url, cookie);
+ if (context->cookie_policy()->CanSetCookie(url, first_party_for_cookies)) {
+ if (context->blacklist()) {
+ Blacklist::Match* match = context->blacklist()->findMatch(url);
+ if (match) {
+ if (match->attributes() & Blacklist::kDontPersistCookies) {
+ context->cookie_store()->SetCookie(url,
+ Blacklist::StripCookieExpiry(cookie));
+ } else if (!(match->attributes() & Blacklist::kDontStoreCookies)) {
+ context->cookie_store()->SetCookie(url, cookie);
+ }
+ delete match;
+ }
+ } else {
+ context->cookie_store()->SetCookie(url, cookie);
+ }
+ }
}
void ResourceMessageFilter::OnGetCookies(const GURL& url,
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698