You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/10/24 17:10:03 UTC

[1/2] android commit: CB-5193 Fix Android WebSQL sometime throwing SECURITY_ERR.

Updated Branches:
  refs/heads/2.9.x 1dfbebf98 -> bb08abc0b
  refs/heads/master 4437d7f3c -> 6e4ef508e


CB-5193 Fix Android WebSQL sometime throwing SECURITY_ERR.

Turns out our Quota logic has been wrong all along. If we were to
actually track the quota needed, we'd need to store a map of
dbName->quota for all dbNames. Instead, we just set a really high quota
since we don't ever want to decline storage.

I *think* this fixes all of the SECURITY_ERR exceptions we've been
seeing. Even those on Honeycomb / ICS.


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/6e4ef508
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/6e4ef508
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/6e4ef508

Branch: refs/heads/master
Commit: 6e4ef508e8f9f2d396515bd1d7465481d2f1285c
Parents: 4437d7f
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Oct 24 11:08:02 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Oct 24 11:08:02 2013 -0400

----------------------------------------------------------------------
 .../org/apache/cordova/CordovaChromeClient.java | 22 +-------------------
 1 file changed, 1 insertion(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/6e4ef508/framework/src/org/apache/cordova/CordovaChromeClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaChromeClient.java b/framework/src/org/apache/cordova/CordovaChromeClient.java
index cc22b7f..a089cfd 100755
--- a/framework/src/org/apache/cordova/CordovaChromeClient.java
+++ b/framework/src/org/apache/cordova/CordovaChromeClient.java
@@ -280,33 +280,13 @@ public class CordovaChromeClient extends WebChromeClient {
 
     /**
      * Handle database quota exceeded notification.
-     *
-     * @param url
-     * @param databaseIdentifier
-     * @param currentQuota
-     * @param estimatedSize
-     * @param totalUsedQuota
-     * @param quotaUpdater
      */
     @Override
     public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
             long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
     {
         LOG.d(TAG, "onExceededDatabaseQuota estimatedSize: %d  currentQuota: %d  totalUsedQuota: %d", estimatedSize, currentQuota, totalUsedQuota);
-
-        if (estimatedSize < MAX_QUOTA)
-        {
-            //increase for 1Mb
-            long newQuota = estimatedSize;
-            LOG.d(TAG, "calling quotaUpdater.updateQuota newQuota: %d", newQuota);
-            quotaUpdater.updateQuota(newQuota);
-        }
-        else
-        {
-            // Set the quota to whatever it is and force an error
-            // TODO: get docs on how to handle this properly
-            quotaUpdater.updateQuota(currentQuota);
-        }
+        quotaUpdater.updateQuota(MAX_QUOTA);
     }
 
     // console.log in api level 7: http://developer.android.com/guide/developing/debug-tasks.html


[2/2] android commit: CB-5193 Fix Android WebSQL sometime throwing SECURITY_ERR.

Posted by ag...@apache.org.
CB-5193 Fix Android WebSQL sometime throwing SECURITY_ERR.

Turns out our Quota logic has been wrong all along. If we were to
actually track the quota needed, we'd need to store a map of
dbName->quota for all dbNames. Instead, we just set a really high quota
since we don't ever want to decline storage.

I *think* this fixes all of the SECURITY_ERR exceptions we've been
seeing. Even those on Honeycomb / ICS.
(cherry picked from commit 6e4ef508e8f9f2d396515bd1d7465481d2f1285c)


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/bb08abc0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/bb08abc0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/bb08abc0

Branch: refs/heads/2.9.x
Commit: bb08abc0b9fddc160d345de9479923bef5414015
Parents: 1dfbebf
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Oct 24 11:08:02 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Oct 24 11:09:54 2013 -0400

----------------------------------------------------------------------
 .../org/apache/cordova/CordovaChromeClient.java | 22 +-------------------
 1 file changed, 1 insertion(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/bb08abc0/framework/src/org/apache/cordova/CordovaChromeClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaChromeClient.java b/framework/src/org/apache/cordova/CordovaChromeClient.java
index 3c0abd1..d71ee04 100755
--- a/framework/src/org/apache/cordova/CordovaChromeClient.java
+++ b/framework/src/org/apache/cordova/CordovaChromeClient.java
@@ -275,33 +275,13 @@ public class CordovaChromeClient extends WebChromeClient {
 
     /**
      * Handle database quota exceeded notification.
-     *
-     * @param url
-     * @param databaseIdentifier
-     * @param currentQuota
-     * @param estimatedSize
-     * @param totalUsedQuota
-     * @param quotaUpdater
      */
     @Override
     public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
             long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
     {
         LOG.d(TAG, "onExceededDatabaseQuota estimatedSize: %d  currentQuota: %d  totalUsedQuota: %d", estimatedSize, currentQuota, totalUsedQuota);
-
-        if (estimatedSize < MAX_QUOTA)
-        {
-            //increase for 1Mb
-            long newQuota = estimatedSize;
-            LOG.d(TAG, "calling quotaUpdater.updateQuota newQuota: %d", newQuota);
-            quotaUpdater.updateQuota(newQuota);
-        }
-        else
-        {
-            // Set the quota to whatever it is and force an error
-            // TODO: get docs on how to handle this properly
-            quotaUpdater.updateQuota(currentQuota);
-        }
+        quotaUpdater.updateQuota(MAX_QUOTA);
     }
 
     // console.log in api level 7: http://developer.android.com/guide/developing/debug-tasks.html