summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-30 16:11:27 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-30 16:11:27 +0000
commita307e31e82d2b9006802d4381dc5f3da2b993a8d (patch)
treee46d5b0b6ea59aa1fb7d47f917bc837b37dd88b8 /chrome/browser/renderer_host
parent48a74f65c7775737ccee06a34eb5f73a5172172f (diff)
downloadchromium_src-a307e31e82d2b9006802d4381dc5f3da2b993a8d.zip
chromium_src-a307e31e82d2b9006802d4381dc5f3da2b993a8d.tar.gz
chromium_src-a307e31e82d2b9006802d4381dc5f3da2b993a8d.tar.bz2
Integrate BlacklistManager with Profile.
Now each Profile has a BlacklistManager that maintains a compiled Blacklist for that Profile. The system does not yet pause user-initiated web requests until the blacklist system is ready. However, the code is not supposed to be ready, and is hidden behind a --enable-privacy-blacklists command-line flag. TEST=Covered by browser_test. BUG=21541 Review URL: http://codereview.chromium.org/371063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.cc4
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc17
2 files changed, 11 insertions, 10 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc
index 7203cd9..036d907 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc
@@ -421,8 +421,8 @@ void ResourceDispatcherHost::BeginRequest(
std::string url = request_data.url.spec();
// Note that context can still be NULL here when running unit tests.
- Blacklist::Match* match = context && context->blacklist() ?
- context->blacklist()->findMatch(request_data.url) : NULL;
+ Blacklist::Match* match = context && context->GetBlacklist() ?
+ context->GetBlacklist()->findMatch(request_data.url) : NULL;
if (match && match->IsBlocked(request_data.url)) {
// This is a special path where calling happens without the URLRequest
// being created, so we must delete the match ourselves. Ensures this
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index cb29433..8006960 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -25,7 +25,7 @@
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/privacy_blacklist/blacklist.h"
-#include "chrome/browser/privacy_blacklist/blacklist_observer.h"
+#include "chrome/browser/privacy_blacklist/blacklist_ui.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/database_dispatcher_host.h"
@@ -211,7 +211,7 @@ void ResourceMessageFilter::OnFilterAdded(IPC::Channel* channel) {
channel_ = channel;
// Add the observers to intercept.
- registrar_.Add(this, NotificationType::BLACKLIST_BLOCKED_RESOURCE,
+ registrar_.Add(this, NotificationType::BLACKLIST_NONVISUAL_RESOURCE_BLOCKED,
NotificationService::AllSources());
}
@@ -465,16 +465,16 @@ void ResourceMessageFilter::OnSetCookie(const GURL& url,
ChromeURLRequestContext* context = GetRequestContextForURL(url);
if (context->cookie_policy()->CanSetCookie(url, first_party_for_cookies)) {
- if (context->blacklist()) {
- Blacklist::Match* match = context->blacklist()->findMatch(url);
- if (match) {
+ const Blacklist* blacklist = context->GetBlacklist();
+ if (blacklist) {
+ scoped_ptr<Blacklist::Match> match(blacklist->findMatch(url));
+ if (match.get()) {
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;
return;
}
}
@@ -1020,8 +1020,9 @@ void ResourceMessageFilter::OnUpdateSpellingPanelWithMisspelledWord(
void ResourceMessageFilter::Observe(NotificationType type,
const NotificationSource &source,
const NotificationDetails &details) {
- if (type == NotificationType::BLACKLIST_BLOCKED_RESOURCE) {
- BlacklistObserver::ContentBlocked(Details<const URLRequest>(details).ptr());
+ if (type == NotificationType::BLACKLIST_NONVISUAL_RESOURCE_BLOCKED) {
+ BlacklistUI::OnNonvisualContentBlocked(
+ Details<const URLRequest>(details).ptr());
}
}