diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 18:38:09 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 18:38:09 +0000 |
commit | 8a58f9a5e0b7e62d38ceef9c6a3b691a8593e7d9 (patch) | |
tree | 36f7876f1b49e7edf492198c79a587090e7e6233 /chrome/common/resource_dispatcher.cc | |
parent | 6e42e7275a6eb6d374e74367aa6c55c1df36568a (diff) | |
download | chromium_src-8a58f9a5e0b7e62d38ceef9c6a3b691a8593e7d9.zip chromium_src-8a58f9a5e0b7e62d38ceef9c6a3b691a8593e7d9.tar.gz chromium_src-8a58f9a5e0b7e62d38ceef9c6a3b691a8593e7d9.tar.bz2 |
Remove the mostly-unused FilterPolicy class. Convert the only actually-used bit, FILTER_EXTENSION_MESSAGES, into a bool that's only passed to places that really need it.
Also renames ExtensionMessageFilterPeer to ExtensionLocalizationPeer in hopes of making its one use more apparent. I added a couple comments too.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2105006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/resource_dispatcher.cc')
-rw-r--r-- | chrome/common/resource_dispatcher.cc | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc index b8f306c..7b2e96d 100644 --- a/chrome/common/resource_dispatcher.cc +++ b/chrome/common/resource_dispatcher.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,7 +12,7 @@ #include "base/message_loop.h" #include "base/shared_memory.h" #include "base/string_util.h" -#include "chrome/common/extensions/extension_message_filter_peer.h" +#include "chrome/common/extensions/extension_localization_peer.h" #include "chrome/common/render_messages.h" #include "chrome/common/security_filter_peer.h" #include "net/base/net_errors.h" @@ -336,35 +336,18 @@ void ResourceDispatcher::OnReceivedResponse( } PendingRequestInfo& request_info = it->second; - request_info.filter_policy = response_head.filter_policy; - webkit_glue::ResourceLoaderBridge::Peer* peer = request_info.peer; - webkit_glue::ResourceLoaderBridge::Peer* new_peer = NULL; - if (request_info.filter_policy == FilterPolicy::FILTER_EXTENSION_MESSAGES) { - new_peer = ExtensionMessageFilterPeer::CreateExtensionMessageFilterPeer( - peer, - message_sender(), - response_head.mime_type, - request_info.filter_policy, - request_info.url); - } else if (request_info.filter_policy != FilterPolicy::DONT_FILTER) { - // TODO(jcampan): really pass the loader bridge. - new_peer = SecurityFilterPeer::CreateSecurityFilterPeer( - NULL, - peer, - request_info.resource_type, - response_head.mime_type, - request_info.filter_policy, - net::ERR_INSECURE_RESPONSE); - } - - if (new_peer) { - request_info.peer = new_peer; - peer = new_peer; + if (response_head.replace_extension_localization_templates) { + webkit_glue::ResourceLoaderBridge::Peer* new_peer = + ExtensionLocalizationPeer::CreateExtensionLocalizationPeer( + request_info.peer, message_sender(), response_head.mime_type, + request_info.url); + if (new_peer) + request_info.peer = new_peer; } RESOURCE_LOG("Dispatching response for " << - peer->GetURLForDebugging().possibly_invalid_spec()); - peer->OnReceivedResponse(response_head, false); + request_info.peer->GetURLForDebugging().possibly_invalid_spec()); + request_info.peer->OnReceivedResponse(response_head, false); } void ResourceDispatcher::OnReceivedCachedMetadata( |