From b632adfaf445ff6f0c07bfc54671d204ad0e5a67 Mon Sep 17 00:00:00 2001 From: Selim Gurun Date: Thu, 28 Jun 2012 11:21:05 -0700 Subject: Update documentation to clarify AppCache usage Bug: 5869022 Change-Id: I46abecfb0e8975cc924458f444f95cdabaa3f712 --- core/java/android/webkit/WebSettings.java | 7 +++++-- core/java/android/webkit/WebStorage.java | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'core') diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index f2a041a..5e5e23c 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -1005,8 +1005,11 @@ public abstract class WebSettings { } /** - * Sets the maximum size for the Application Caches content. The default is - * {@link Long#MAX_VALUE}. + * Sets the maximum size for the Application Cache content. The passed size + * will be rounded to the nearest value that the database can support, so + * this should be viewed as a guide, not a hard limit. Setting the + * size to a value less than current database size does not cause the + * database to be trimmed. The default size is {@link Long.MAX_VALUE}. * * @param appCacheMaxSize the maximum size in bytes */ diff --git a/core/java/android/webkit/WebStorage.java b/core/java/android/webkit/WebStorage.java index 76674f4..1e955bd 100644 --- a/core/java/android/webkit/WebStorage.java +++ b/core/java/android/webkit/WebStorage.java @@ -23,17 +23,22 @@ import java.util.Map; * {@link WebView}. It manages the Application Cache API, the Web SQL Database * API and the HTML5 Web Storage API. * - * The Web SQL Database API provides storage which is private to a given - * origin, where an origin comprises the host, scheme and port of a URI. - * Similarly, use of the Application Cache API can be attributed to an origin. - * This class provides access to the storage use and quotas for these APIs for - * a given origin. Origins are represented using {@link WebStorage.Origin}. + * The Application Cache API provides a mechanism to create and maintain an + * application cache to power offline Web applications. Use of the Application + * Cache API can be attributed to an origin {@link WebStorage.Origin}, however + * it is not possible to set per-origin quotas. Note that there can be only + * one application cache per application. + * + * The Web SQL Database API provides storage which is private to a given origin. + * Similar to the Application Cache, use of the Web SQL Database can be attributed + * to an origin. It is also possible to set per-origin quotas. */ public class WebStorage { /** * Encapsulates a callback function which is used to provide a new quota - * for a JavaScript storage API. See + * for a JavaScript storage API. + * See * {@link WebChromeClient#onExceededDatabaseQuota} and * {@link WebChromeClient#onReachedMaxAppCacheSize}. */ @@ -54,6 +59,7 @@ public class WebStorage { /** * This class encapsulates information about the amount of storage * currently used by an origin for the JavaScript storage APIs. + * An origin comprises the host, scheme and port of a URI. * See {@link WebStorage} for details. */ public static class Origin { -- cgit v1.1