summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-01-11 21:00:47 +0000
committerKristian Monsen <kristianm@google.com>2011-01-12 11:35:53 +0000
commit5bc439a352fa4a52aa5be1eab0dc72420f40d49f (patch)
treedeb12f4b6c6fa1abd874f22ca13070b2fa784532 /WebKit
parent100a4c5bbcdd1cdafdc6add279f6d7ed4dec3796 (diff)
downloadexternal_webkit-5bc439a352fa4a52aa5be1eab0dc72420f40d49f.zip
external_webkit-5bc439a352fa4a52aa5be1eab0dc72420f40d49f.tar.gz
external_webkit-5bc439a352fa4a52aa5be1eab0dc72420f40d49f.tar.bz2
Only use the name part when opening files that start with file://
Part of fix for bug 2862096 Fix for bug 3280996 Change-Id: I82d872aff834524fb105f42e83eee580d6c98c0b
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/WebCoreSupport/WebResourceRequest.cpp7
-rw-r--r--WebKit/android/WebCoreSupport/WebResourceRequest.h3
-rw-r--r--WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp2
3 files changed, 12 insertions, 0 deletions
diff --git a/WebKit/android/WebCoreSupport/WebResourceRequest.cpp b/WebKit/android/WebCoreSupport/WebResourceRequest.cpp
index 9b70fce..c6e428c 100644
--- a/WebKit/android/WebCoreSupport/WebResourceRequest.cpp
+++ b/WebKit/android/WebCoreSupport/WebResourceRequest.cpp
@@ -91,6 +91,13 @@ WebResourceRequest::WebResourceRequest(const WebCore::ResourceRequest& resourceR
m_userAgent = resourceRequest.httpUserAgent().utf8().data();
m_url = resourceRequest.url().string().utf8().data();
+ normalizeUrl(m_url);
+}
+
+void WebResourceRequest::normalizeUrl(std::string& url) {
+ // Chrome does not understand file url's
+ if (url.find("file://") == 0)
+ url.erase(0, 7);
}
} // namespace android
diff --git a/WebKit/android/WebCoreSupport/WebResourceRequest.h b/WebKit/android/WebCoreSupport/WebResourceRequest.h
index 38f37b5..b1eaeed 100644
--- a/WebKit/android/WebCoreSupport/WebResourceRequest.h
+++ b/WebKit/android/WebCoreSupport/WebResourceRequest.h
@@ -71,6 +71,9 @@ public:
return m_loadFlags;
}
+ // Changes file url's to files paths
+ static void normalizeUrl(std::string& url);
+
private:
std::string m_method;
std::string m_referrer;
diff --git a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
index 29a97cc..537863f 100644
--- a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
+++ b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
@@ -134,6 +134,8 @@ WebUrlLoaderClient::WebUrlLoaderClient(WebFrame* webFrame, WebCore::ResourceHand
// Chromium check if it is a directory by checking
// element.m_fileLength, that doesn't work in Android
std::string filename = element.m_filename.utf8().data();
+ // If the filename start with file:// strip that part out, chromium doesn't understand it
+ WebResourceRequest::normalizeUrl(filename);
if (filename.size() > 0) {
base::Thread* thread = ioThread();
if (thread)