@@ -479,34 +479,34 @@ public void handleMessage(Message msg) {
479479 String databaseIdentifier =
480480 (String ) map .get ("databaseIdentifier" );
481481 String url = (String ) map .get ("url" );
482- long currentQuota =
483- ((Long ) map .get ("currentQuota " )).longValue ();
484- long totalUsedQuota =
485- ((Long ) map .get ("totalUsedQuota " )).longValue ();
486- long estimatedSize =
487- ((Long ) map .get ("estimatedSize " )).longValue ();
482+ long quota =
483+ ((Long ) map .get ("quota " )).longValue ();
484+ long totalQuota =
485+ ((Long ) map .get ("totalQuota " )).longValue ();
486+ long estimatedDatabaseSize =
487+ ((Long ) map .get ("estimatedDatabaseSize " )).longValue ();
488488 WebStorage .QuotaUpdater quotaUpdater =
489489 (WebStorage .QuotaUpdater ) map .get ("quotaUpdater" );
490490
491491 mWebChromeClient .onExceededDatabaseQuota (url ,
492- databaseIdentifier , currentQuota , estimatedSize ,
493- totalUsedQuota , quotaUpdater );
492+ databaseIdentifier , quota , estimatedDatabaseSize ,
493+ totalQuota , quotaUpdater );
494494 }
495495 break ;
496496
497497 case REACHED_APPCACHE_MAXSIZE :
498498 if (mWebChromeClient != null ) {
499499 HashMap <String , Object > map =
500500 (HashMap <String , Object >) msg .obj ;
501- long spaceNeeded =
502- ((Long ) map .get ("spaceNeeded " )).longValue ();
503- long totalUsedQuota =
504- ((Long ) map .get ("totalUsedQuota " )).longValue ();
501+ long requiredStorage =
502+ ((Long ) map .get ("requiredStorage " )).longValue ();
503+ long quota =
504+ ((Long ) map .get ("quota " )).longValue ();
505505 WebStorage .QuotaUpdater quotaUpdater =
506506 (WebStorage .QuotaUpdater ) map .get ("quotaUpdater" );
507507
508- mWebChromeClient .onReachedMaxAppCacheSize (spaceNeeded ,
509- totalUsedQuota , quotaUpdater );
508+ mWebChromeClient .onReachedMaxAppCacheSize (requiredStorage ,
509+ quota , quotaUpdater );
510510 }
511511 break ;
512512
@@ -1422,29 +1422,31 @@ public boolean onJsBeforeUnload(String url, String message) {
14221422 * @param url The URL that caused the quota overflow.
14231423 * @param databaseIdentifier The identifier of the database that the
14241424 * transaction that caused the overflow was running on.
1425- * @param currentQuota The current quota the origin is allowed.
1426- * @param estimatedSize The estimated size of the database.
1427- * @param totalUsedQuota is the sum of all origins' quota.
1425+ * @param quota The current quota the origin is allowed.
1426+ * @param estimatedDatabaseSize The estimated size of the database.
1427+ * @param totalQuota is the sum of all origins' quota.
14281428 * @param quotaUpdater An instance of a class encapsulating a callback
14291429 * to WebViewCore to run when the decision to allow or deny more
14301430 * quota has been made.
14311431 */
14321432 public void onExceededDatabaseQuota (
1433- String url , String databaseIdentifier , long currentQuota ,
1434- long estimatedSize , long totalUsedQuota ,
1433+ String url , String databaseIdentifier , long quota ,
1434+ long estimatedDatabaseSize , long totalQuota ,
14351435 WebStorage .QuotaUpdater quotaUpdater ) {
14361436 if (mWebChromeClient == null ) {
1437- quotaUpdater .updateQuota (currentQuota );
1437+ // Native-side logic prevents the quota being updated to a smaller
1438+ // value.
1439+ quotaUpdater .updateQuota (quota );
14381440 return ;
14391441 }
14401442
14411443 Message exceededQuota = obtainMessage (EXCEEDED_DATABASE_QUOTA );
14421444 HashMap <String , Object > map = new HashMap ();
14431445 map .put ("databaseIdentifier" , databaseIdentifier );
14441446 map .put ("url" , url );
1445- map .put ("currentQuota " , currentQuota );
1446- map .put ("estimatedSize " , estimatedSize );
1447- map .put ("totalUsedQuota " , totalUsedQuota );
1447+ map .put ("quota " , quota );
1448+ map .put ("estimatedDatabaseSize " , estimatedDatabaseSize );
1449+ map .put ("totalQuota " , totalQuota );
14481450 map .put ("quotaUpdater" , quotaUpdater );
14491451 exceededQuota .obj = map ;
14501452 sendMessage (exceededQuota );
@@ -1453,24 +1455,26 @@ public void onExceededDatabaseQuota(
14531455 /**
14541456 * Called by WebViewCore to inform the Java side that the appcache has
14551457 * exceeded its max size.
1456- * @param spaceNeeded is the amount of disk space that would be needed
1457- * in order for the last appcache operation to succeed.
1458- * @param totalUsedQuota is the sum of all origins' quota .
1458+ * @param requiredStorage is the amount of storage, in bytes, that would be
1459+ * needed in order for the last appcache operation to succeed.
1460+ * @param quota is the current quota (for all origins) .
14591461 * @param quotaUpdater An instance of a class encapsulating a callback
14601462 * to WebViewCore to run when the decision to allow or deny a bigger
14611463 * app cache size has been made.
14621464 */
1463- public void onReachedMaxAppCacheSize (long spaceNeeded ,
1464- long totalUsedQuota , WebStorage .QuotaUpdater quotaUpdater ) {
1465+ public void onReachedMaxAppCacheSize (long requiredStorage ,
1466+ long quota , WebStorage .QuotaUpdater quotaUpdater ) {
14651467 if (mWebChromeClient == null ) {
1466- quotaUpdater .updateQuota (0 );
1468+ // Native-side logic prevents the quota being updated to a smaller
1469+ // value.
1470+ quotaUpdater .updateQuota (quota );
14671471 return ;
14681472 }
14691473
14701474 Message msg = obtainMessage (REACHED_APPCACHE_MAXSIZE );
14711475 HashMap <String , Object > map = new HashMap ();
1472- map .put ("spaceNeeded " , spaceNeeded );
1473- map .put ("totalUsedQuota " , totalUsedQuota );
1476+ map .put ("requiredStorage " , requiredStorage );
1477+ map .put ("quota " , quota );
14741478 map .put ("quotaUpdater" , quotaUpdater );
14751479 msg .obj = map ;
14761480 sendMessage (msg );
0 commit comments