Commit 61176efe authored by piman@chromium.org's avatar piman@chromium.org

Remove IsProtocolSupportedForMedia.

scherkus says:
The protocol whitelist (added in r26746) was originally required to prevent issuing requests to the resource loader bridge that it didn't support (i.e., data://). To complicate matters there were protocols such as chrome-extension:// that required the embedder to override. None of this is required anymore since we switched to using Chromium WebKit API's resource loader in r69429.

BUG=98755
TEST=Chrome, DRT, test_shell, test_shell_tests

Review URL: http://codereview.chromium.org/8616008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111075 0039d316-1c4b-4281-b951-d872f2087c98
parent 2fa83c40
......@@ -719,11 +719,6 @@ bool ChromeContentRendererClient::HandleSetCookieRequest(
return false;
}
bool ChromeContentRendererClient::IsProtocolSupportedForMedia(
const GURL& url) {
return url.SchemeIs(chrome::kExtensionScheme);
}
void ChromeContentRendererClient::SetExtensionDispatcher(
ExtensionDispatcher* extension_dispatcher) {
extension_dispatcher_.reset(extension_dispatcher);
......
......@@ -91,7 +91,6 @@ class ChromeContentRendererClient : public content::ContentRendererClient {
const GURL& url,
const GURL& first_party_for_cookies,
const std::string& value) OVERRIDE;
virtual bool IsProtocolSupportedForMedia(const GURL& url) OVERRIDE;
// TODO(mpcomplete): remove after we collect histogram data.
// http://crbug.com/100411
......
......@@ -144,10 +144,6 @@ class ContentRendererClient {
const GURL& first_party_for_cookies,
const std::string& value) = 0;
// True if the protocol implemented to serve |url| supports features required
// by the media engine.
virtual bool IsProtocolSupportedForMedia(const GURL& url) = 0;
virtual void RegisterPPAPIInterfaceFactories(
webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) = 0;
};
......
......@@ -118,10 +118,6 @@ bool MockContentRendererClient::HandleSetCookieRequest(
return false;
}
bool MockContentRendererClient::IsProtocolSupportedForMedia(const GURL& url) {
return false;
}
void MockContentRendererClient::RegisterPPAPIInterfaceFactories(
webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) {
}
......
......@@ -66,7 +66,6 @@ class MockContentRendererClient : public ContentRendererClient {
const GURL& url,
const GURL& first_party_for_cookies,
const std::string& value) OVERRIDE;
virtual bool IsProtocolSupportedForMedia(const GURL& url) OVERRIDE;
virtual void RegisterPPAPIInterfaceFactories(
webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) OVERRIDE;
......
......@@ -157,19 +157,6 @@ void GetPlugins(bool refresh,
new ViewHostMsg_GetPlugins(refresh, plugins));
}
bool IsProtocolSupportedForMedia(const GURL& url) {
// If new protocol is to be added here, we need to make sure the response is
// validated accordingly in the media engine.
if (url.SchemeIsFile() || url.SchemeIs(chrome::kHttpScheme) ||
url.SchemeIs(chrome::kHttpsScheme) ||
url.SchemeIs(chrome::kDataScheme) ||
url.SchemeIs(chrome::kFileSystemScheme) ||
url.SchemeIs(chrome::kBlobScheme))
return true;
return
content::GetContentClient()->renderer()->IsProtocolSupportedForMedia(url);
}
// static factory function
ResourceLoaderBridge* ResourceLoaderBridge::Create(
const ResourceLoaderBridge::RequestInfo& request_info) {
......
......@@ -117,10 +117,6 @@ bool ShellContentRendererClient::HandleSetCookieRequest(
return false;
}
bool ShellContentRendererClient::IsProtocolSupportedForMedia(const GURL& url) {
return false;
}
void ShellContentRendererClient::RegisterPPAPIInterfaceFactories(
webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) {
}
......
......@@ -63,7 +63,6 @@ class ShellContentRendererClient : public ContentRendererClient {
const GURL& url,
const GURL& first_party_for_cookies,
const std::string& value) OVERRIDE;
virtual bool IsProtocolSupportedForMedia(const GURL& url) OVERRIDE;
virtual void RegisterPPAPIInterfaceFactories(
webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) OVERRIDE;
};
......
......@@ -201,10 +201,6 @@ void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data);
void GetPlugins(bool refresh,
std::vector<webkit::WebPluginInfo>* plugins);
// Returns true if the protocol implemented to serve |url| supports features
// required by the media engine.
bool IsProtocolSupportedForMedia(const GURL& url);
// Returns the locale that this instance of webkit is running as. This is of
// the form language-country (e.g., en-US or pt-BR).
std::string GetWebKitLocale();
......
......@@ -9,7 +9,6 @@
#include "media/base/media_log.h"
#include "net/base/net_errors.h"
#include "webkit/media/web_data_source_factory.h"
#include "webkit/glue/webkit_glue.h"
using WebKit::WebFrame;
......@@ -105,9 +104,6 @@ void BufferedDataSource::Initialize(const std::string& url,
if (url_.SchemeIs(kDataScheme)) {
callback.Run(media::DATASOURCE_ERROR_URL_NOT_SUPPORTED);
return;
} else if (!webkit_glue::IsProtocolSupportedForMedia(url_)) {
callback.Run(media::PIPELINE_ERROR_NETWORK);
return;
}
DCHECK(!callback.is_null());
......
......@@ -16,7 +16,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoaderOptions.h"
#include "webkit/glue/multipart_response_delegate.h"
#include "webkit/glue/webkit_glue.h"
using WebKit::WebFrame;
using WebKit::WebString;
......@@ -358,13 +357,6 @@ void BufferedResourceLoader::willSendRequest(
if (single_origin_)
single_origin_ = url_.GetOrigin() == GURL(newRequest.url()).GetOrigin();
if (!webkit_glue::IsProtocolSupportedForMedia(newRequest.url())) {
// Set the url in the request to an invalid value (empty url).
newRequest.setURL(WebKit::WebURL());
DoneStart(net::ERR_ADDRESS_INVALID);
return;
}
url_ = newRequest.url();
}
......
......@@ -17,7 +17,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoaderOptions.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/media/web_data_source_factory.h"
using WebKit::WebString;
......@@ -96,7 +95,7 @@ void SimpleDataSource::Initialize(
// Validate the URL.
url_ = GURL(url);
if (!url_.is_valid() || !webkit_glue::IsProtocolSupportedForMedia(url_)) {
if (!url_.is_valid()) {
DoneInitialization_Locked(false);
return;
}
......
......@@ -6,7 +6,6 @@
#include "base/base_paths.h"
#include "base/path_service.h"
#include "googleurl/src/gurl.h"
#include "webkit/glue/user_agent.h"
#include "webkit/plugins/npapi/plugin_list.h"
......@@ -39,15 +38,6 @@ void GetPlugins(bool refresh,
void AppendToLog(const char*, int, const char*) {
}
bool IsProtocolSupportedForMedia(const GURL& url) {
if (url.SchemeIsFile() ||
url.SchemeIs("http") ||
url.SchemeIs("https") ||
url.SchemeIs("data"))
return true;
return false;
}
bool GetPluginFinderURL(std::string* plugin_finder_url) {
return false;
}
......
......@@ -627,19 +627,8 @@ WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() {
return geolocation_client_mock_.get();
}
//-----------------------------------------------------------------------------
namespace webkit_glue {
bool IsProtocolSupportedForMedia(const GURL& url) {
if (url.SchemeIsFile() ||
url.SchemeIs("http") ||
url.SchemeIs("https") ||
url.SchemeIs("data"))
return true;
return false;
}
void GetPlugins(bool refresh,
std::vector<webkit::WebPluginInfo>* plugins) {
if (refresh)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment