diff options
author | Leon Scroggins <scroggo@google.com> | 2010-03-23 15:39:46 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2010-03-24 10:25:40 -0400 |
commit | 1bb1a911c35c9df5fdbcaca13f97aa29dcec6cfb (patch) | |
tree | ac3635e9059cdf1f10e3dc2a2022aca8dec5fc63 /core/java/android/webkit/BrowserFrame.java | |
parent | 7f49b9e47416808d7ef5de77b4094fd83f50134d (diff) | |
download | frameworks_base-1bb1a911c35c9df5fdbcaca13f97aa29dcec6cfb.zip frameworks_base-1bb1a911c35c9df5fdbcaca13f97aa29dcec6cfb.tar.gz frameworks_base-1bb1a911c35c9df5fdbcaca13f97aa29dcec6cfb.tar.bz2 |
If failUrl(now historyUrl) is null, use "about:blank" instead of "".
This prevents a crash that is caused by calling
WebView.loadDataWithBaseUrl with a null failUrl (which I have renamed
to historyUrl). Also update the docs to be more accurate.
Fixes the general case of bug 2522457
Change-Id: I832351ce1e0016b00e924a2f9b0097ae15fba34a
Diffstat (limited to 'core/java/android/webkit/BrowserFrame.java')
-rw-r--r-- | core/java/android/webkit/BrowserFrame.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java index 344b390..6983d9f 100644 --- a/core/java/android/webkit/BrowserFrame.java +++ b/core/java/android/webkit/BrowserFrame.java @@ -213,21 +213,19 @@ class BrowserFrame extends Handler { /** * Load the content as if it was loaded by the provided base URL. The - * failUrl is used as the history entry for the load data. If null or - * an empty string is passed for the failUrl, then no history entry is - * created. + * historyUrl is used as the history entry for the load data. * * @param baseUrl Base URL used to resolve relative paths in the content * @param data Content to render in the browser * @param mimeType Mimetype of the data being passed in * @param encoding Character set encoding of the provided data. - * @param failUrl URL to use if the content fails to load or null. + * @param historyUrl URL to use as the history entry. */ public void loadData(String baseUrl, String data, String mimeType, - String encoding, String failUrl) { + String encoding, String historyUrl) { mLoadInitFromJava = true; - if (failUrl == null) { - failUrl = ""; + if (historyUrl == null || historyUrl.length() == 0) { + historyUrl = "about:blank"; } if (data == null) { data = ""; @@ -241,7 +239,7 @@ class BrowserFrame extends Handler { if (mimeType == null || mimeType.length() == 0) { mimeType = "text/html"; } - nativeLoadData(baseUrl, data, mimeType, encoding, failUrl); + nativeLoadData(baseUrl, data, mimeType, encoding, historyUrl); mLoadInitFromJava = false; } @@ -916,7 +914,7 @@ class BrowserFrame extends Handler { private native void nativePostUrl(String url, byte[] postData); private native void nativeLoadData(String baseUrl, String data, - String mimeType, String encoding, String failUrl); + String mimeType, String encoding, String historyUrl); /** * Stop loading the current page. |