From 0927546d815284c21672db126b40c4f1e891f76b Mon Sep 17 00:00:00 2001 From: Selim Gurun Date: Wed, 14 Mar 2012 16:07:10 -0700 Subject: Remove gmail specific mime code from webview Bug: 6019611 Remove gmail specific mime code from webview so the query parameters can be passed to asset files. The changes were added in honeycomb timeframe (see commit 7d2f6c10941c9083e9ec30fb08444a5755ff8bc9). The changes seem not in use anymore (tested for some attachments following the original commit above), also talked to gmail team and they also do not think it is in use. Also it seems a hack to modify webview for one app in such a way. Get rid of an unused private variable. Change-Id: Ic74414eaa0d6a2be77eefdd0b8a053f655b285ff --- Source/WebKit/android/WebCoreSupport/WebRequest.cpp | 14 +++----------- Source/WebKit/android/WebCoreSupport/WebRequest.h | 1 - 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Source/WebKit/android/WebCoreSupport/WebRequest.cpp b/Source/WebKit/android/WebCoreSupport/WebRequest.cpp index fea7afa..4c479e3 100644 --- a/Source/WebKit/android/WebCoreSupport/WebRequest.cpp +++ b/Source/WebKit/android/WebCoreSupport/WebRequest.cpp @@ -81,7 +81,6 @@ base::LazyInstance s_packageName(base::LINKER_INITIALIZED); WebRequest::WebRequest(WebUrlLoaderClient* loader, const WebResourceRequest& webResourceRequest) : m_urlLoader(loader) - , m_androidUrl(false) , m_url(webResourceRequest.url()) , m_userAgent(webResourceRequest.userAgent()) , m_loadState(Created) @@ -108,7 +107,6 @@ WebRequest::WebRequest(WebUrlLoaderClient* loader, const WebResourceRequest& web WebRequest::WebRequest(WebUrlLoaderClient* loader, const WebResourceRequest& webResourceRequest, UrlInterceptResponse* intercept) : m_urlLoader(loader) , m_interceptResponse(intercept) - , m_androidUrl(true) , m_url(webResourceRequest.url()) , m_userAgent(webResourceRequest.userAgent()) , m_loadState(Created) @@ -293,15 +291,9 @@ void WebRequest::handleInterceptedURL() // Get the MIME type from the URL. "text/html" is a last resort, hopefully overridden. std::string mimeType("text/html"); if (mime == "") { - // Gmail appends the MIME to the end of the URL, with a ? separator. - size_t mimeTypeIndex = m_url.find_last_of('?'); - if (mimeTypeIndex != std::string::npos) { - mimeType.assign(m_url.begin() + mimeTypeIndex + 1, m_url.end()); - } else { - // Get the MIME type from the file extension, if any. - FilePath path(m_url); - net::GetMimeTypeFromFile(path, &mimeType); - } + // Get the MIME type from the file extension, if any. + FilePath path(m_url); + net::GetMimeTypeFromFile(path, &mimeType); } else { // Set from the intercept response. mimeType = mime; diff --git a/Source/WebKit/android/WebCoreSupport/WebRequest.h b/Source/WebKit/android/WebCoreSupport/WebRequest.h index 285e577..d9054e9 100644 --- a/Source/WebKit/android/WebCoreSupport/WebRequest.h +++ b/Source/WebKit/android/WebCoreSupport/WebRequest.h @@ -107,7 +107,6 @@ private: OwnPtr m_request; scoped_refptr m_networkBuffer; scoped_ptr m_interceptResponse; - bool m_androidUrl; std::string m_url; std::string m_userAgent; LoadState m_loadState; -- cgit v1.1