summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-08-11 13:12:34 -0700
committerJean-Baptiste Queru <jbq@google.com>2009-08-11 13:12:34 -0700
commitac1e59d887651220f5367cc7fa4207b34eab774d (patch)
tree971ee29f4bceffd00248b4aa17a7413078e4f14d /core/java/android/webkit
parent5c1207be90fdf296c1b83034b7c68915e1749284 (diff)
downloadframeworks_base-ac1e59d887651220f5367cc7fa4207b34eab774d.zip
frameworks_base-ac1e59d887651220f5367cc7fa4207b34eab774d.tar.gz
frameworks_base-ac1e59d887651220f5367cc7fa4207b34eab774d.tar.bz2
donut snapshot
Diffstat (limited to 'core/java/android/webkit')
-rw-r--r--core/java/android/webkit/GearsPermissionsManager.java8
-rw-r--r--core/java/android/webkit/LoadListener.java15
-rw-r--r--core/java/android/webkit/WebSettings.java1
3 files changed, 22 insertions, 2 deletions
diff --git a/core/java/android/webkit/GearsPermissionsManager.java b/core/java/android/webkit/GearsPermissionsManager.java
index e70e449..6549cb8 100644
--- a/core/java/android/webkit/GearsPermissionsManager.java
+++ b/core/java/android/webkit/GearsPermissionsManager.java
@@ -139,7 +139,13 @@ class GearsPermissionsManager {
file = new File(file.getAbsolutePath() + File.separator
+ GEARS_DATABASE_DIR + File.separator + GEARS_DATABASE_FILE);
// Remember whether or not we need to create the LocationAccess table.
- boolean needToCreateTables = !file.exists();
+ boolean needToCreateTables = false;
+ if (!file.exists()) {
+ needToCreateTables = true;
+ // Create the path or else SQLiteDatabase.openOrCreateDatabase()
+ // may throw on the device.
+ file.getParentFile().mkdirs();
+ }
// If the database file does not yet exist and the system location
// setting says that the Gears origins need to be removed from the
// location permission table, it means that we don't actually need
diff --git a/core/java/android/webkit/LoadListener.java b/core/java/android/webkit/LoadListener.java
index 9ca2909..c3f3594 100644
--- a/core/java/android/webkit/LoadListener.java
+++ b/core/java/android/webkit/LoadListener.java
@@ -106,6 +106,7 @@ class LoadListener extends Handler implements EventHandler {
private String mErrorDescription;
private SslError mSslError;
private RequestHandle mRequestHandle;
+ private RequestHandle mSslErrorRequestHandle;
// Request data. It is only valid when we are doing a load from the
// cache. It is needed if the cache returns a redirect
@@ -693,7 +694,7 @@ class LoadListener extends Handler implements EventHandler {
* IMPORTANT: as this is called from network thread, can't call native
* directly
*/
- public void handleSslErrorRequest(SslError error) {
+ public boolean handleSslErrorRequest(SslError error) {
if (WebView.LOGV_ENABLED) {
Log.v(LOGTAG,
"LoadListener.handleSslErrorRequest(): url:" + url() +
@@ -701,6 +702,15 @@ class LoadListener extends Handler implements EventHandler {
" certificate: " + error.getCertificate());
}
sendMessageInternal(obtainMessage(MSG_SSL_ERROR, error));
+ // if it has been canceled, return false so that the network thread
+ // won't be blocked. If it is not canceled, save the mRequestHandle
+ // so that if it is canceled when MSG_SSL_ERROR is handled, we can
+ // still call handleSslErrorResponse which will call restartConnection
+ // to unblock the network thread.
+ if (!mCancelled) {
+ mSslErrorRequestHandle = mRequestHandle;
+ }
+ return !mCancelled;
}
// Handle the ssl error on the WebCore thread.
@@ -708,7 +718,10 @@ class LoadListener extends Handler implements EventHandler {
if (!mCancelled) {
mSslError = error;
Network.getInstance(mContext).handleSslErrorRequest(this);
+ } else if (mSslErrorRequestHandle != null) {
+ mSslErrorRequestHandle.handleSslErrorResponse(true);
}
+ mSslErrorRequestHandle = null;
}
/**
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index c5012f1..a038b55 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -199,6 +199,7 @@ public class WebSettings {
switch (msg.what) {
case SYNC:
synchronized (WebSettings.this) {
+ checkGearsPermissions();
if (mBrowserFrame.mNativeFrame != 0) {
nativeSync(mBrowserFrame.mNativeFrame);
}