@@ -513,34 +513,34 @@ public void handleMessage(Message msg) {
513513 String databaseIdentifier =
514514 (String ) map .get ("databaseIdentifier" );
515515 String url = (String ) map .get ("url" );
516- long currentQuota =
517- ((Long ) map .get ("currentQuota " )).longValue ();
518- long totalUsedQuota =
519- ((Long ) map .get ("totalUsedQuota " )).longValue ();
520- long estimatedSize =
521- ((Long ) map .get ("estimatedSize " )).longValue ();
516+ long quota =
517+ ((Long ) map .get ("quota " )).longValue ();
518+ long totalQuota =
519+ ((Long ) map .get ("totalQuota " )).longValue ();
520+ long estimatedDatabaseSize =
521+ ((Long ) map .get ("estimatedDatabaseSize " )).longValue ();
522522 WebStorage .QuotaUpdater quotaUpdater =
523523 (WebStorage .QuotaUpdater ) map .get ("quotaUpdater" );
524524
525525 mWebChromeClient .onExceededDatabaseQuota (url ,
526- databaseIdentifier , currentQuota , estimatedSize ,
527- totalUsedQuota , quotaUpdater );
526+ databaseIdentifier , quota , estimatedDatabaseSize ,
527+ totalQuota , quotaUpdater );
528528 }
529529 break ;
530530
531531 case REACHED_APPCACHE_MAXSIZE :
532532 if (mWebChromeClient != null ) {
533533 HashMap <String , Object > map =
534534 (HashMap <String , Object >) msg .obj ;
535- long spaceNeeded =
536- ((Long ) map .get ("spaceNeeded " )).longValue ();
537- long totalUsedQuota =
538- ((Long ) map .get ("totalUsedQuota " )).longValue ();
535+ long requiredStorage =
536+ ((Long ) map .get ("requiredStorage " )).longValue ();
537+ long quota =
538+ ((Long ) map .get ("quota " )).longValue ();
539539 WebStorage .QuotaUpdater quotaUpdater =
540540 (WebStorage .QuotaUpdater ) map .get ("quotaUpdater" );
541541
542- mWebChromeClient .onReachedMaxAppCacheSize (spaceNeeded ,
543- totalUsedQuota , quotaUpdater );
542+ mWebChromeClient .onReachedMaxAppCacheSize (requiredStorage ,
543+ quota , quotaUpdater );
544544 }
545545 break ;
546546
@@ -1462,29 +1462,31 @@ public boolean onJsBeforeUnload(String url, String message) {
14621462 * @param url The URL that caused the quota overflow.
14631463 * @param databaseIdentifier The identifier of the database that the
14641464 * transaction that caused the overflow was running on.
1465- * @param currentQuota The current quota the origin is allowed.
1466- * @param estimatedSize The estimated size of the database.
1467- * @param totalUsedQuota is the sum of all origins' quota.
1465+ * @param quota The current quota the origin is allowed.
1466+ * @param estimatedDatabaseSize The estimated size of the database.
1467+ * @param totalQuota is the sum of all origins' quota.
14681468 * @param quotaUpdater An instance of a class encapsulating a callback
14691469 * to WebViewCore to run when the decision to allow or deny more
14701470 * quota has been made.
14711471 */
14721472 public void onExceededDatabaseQuota (
1473- String url , String databaseIdentifier , long currentQuota ,
1474- long estimatedSize , long totalUsedQuota ,
1473+ String url , String databaseIdentifier , long quota ,
1474+ long estimatedDatabaseSize , long totalQuota ,
14751475 WebStorage .QuotaUpdater quotaUpdater ) {
14761476 if (mWebChromeClient == null ) {
1477- quotaUpdater .updateQuota (currentQuota );
1477+ // Native-side logic prevents the quota being updated to a smaller
1478+ // value.
1479+ quotaUpdater .updateQuota (quota );
14781480 return ;
14791481 }
14801482
14811483 Message exceededQuota = obtainMessage (EXCEEDED_DATABASE_QUOTA );
14821484 HashMap <String , Object > map = new HashMap ();
14831485 map .put ("databaseIdentifier" , databaseIdentifier );
14841486 map .put ("url" , url );
1485- map .put ("currentQuota " , currentQuota );
1486- map .put ("estimatedSize " , estimatedSize );
1487- map .put ("totalUsedQuota " , totalUsedQuota );
1487+ map .put ("quota " , quota );
1488+ map .put ("estimatedDatabaseSize " , estimatedDatabaseSize );
1489+ map .put ("totalQuota " , totalQuota );
14881490 map .put ("quotaUpdater" , quotaUpdater );
14891491 exceededQuota .obj = map ;
14901492 sendMessage (exceededQuota );
@@ -1493,24 +1495,26 @@ public void onExceededDatabaseQuota(
14931495 /**
14941496 * Called by WebViewCore to inform the Java side that the appcache has
14951497 * exceeded its max size.
1496- * @param spaceNeeded is the amount of disk space that would be needed
1497- * in order for the last appcache operation to succeed.
1498- * @param totalUsedQuota is the sum of all origins' quota .
1498+ * @param requiredStorage is the amount of storage, in bytes, that would be
1499+ * needed in order for the last appcache operation to succeed.
1500+ * @param quota is the current quota (for all origins) .
14991501 * @param quotaUpdater An instance of a class encapsulating a callback
15001502 * to WebViewCore to run when the decision to allow or deny a bigger
15011503 * app cache size has been made.
15021504 */
1503- public void onReachedMaxAppCacheSize (long spaceNeeded ,
1504- long totalUsedQuota , WebStorage .QuotaUpdater quotaUpdater ) {
1505+ public void onReachedMaxAppCacheSize (long requiredStorage ,
1506+ long quota , WebStorage .QuotaUpdater quotaUpdater ) {
15051507 if (mWebChromeClient == null ) {
1506- quotaUpdater .updateQuota (0 );
1508+ // Native-side logic prevents the quota being updated to a smaller
1509+ // value.
1510+ quotaUpdater .updateQuota (quota );
15071511 return ;
15081512 }
15091513
15101514 Message msg = obtainMessage (REACHED_APPCACHE_MAXSIZE );
15111515 HashMap <String , Object > map = new HashMap ();
1512- map .put ("spaceNeeded " , spaceNeeded );
1513- map .put ("totalUsedQuota " , totalUsedQuota );
1516+ map .put ("requiredStorage " , requiredStorage );
1517+ map .put ("quota " , quota );
15141518 map .put ("quotaUpdater" , quotaUpdater );
15151519 msg .obj = map ;
15161520 sendMessage (msg );
0 commit comments