Do not allow file:// access when it is disabled. Do not merge.

Cherry pick of If2793f31cb37e0d3af15cb18e818bfa4058167fd

If WebSettings is configured to disallow access to file://
URLs, then block them.

Bug: 5773763
Change-Id: I0ab84cde90c955d31077329fddebc25978287c64
This commit is contained in:
Ben Murdoch
2011-12-16 18:08:30 +00:00
parent 30ad699c0e
commit b2c63abcdc

View File

@@ -941,6 +941,13 @@ class BrowserFrame extends Handler {
if (androidResource != null) {
return new WebResourceResponse(null, null, androidResource);
}
// Note that we check this after looking for an android_asset or
// android_res URL, as we allow those even if file access is disabled.
if (!mSettings.getAllowFileAccess() && url.startsWith("file://")) {
return new WebResourceResponse(null, null, null);
}
WebResourceResponse response = mCallbackProxy.shouldInterceptRequest(url);
if (response == null && "browser:incognito".equals(url)) {
try {