diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-30 19:22:09 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-30 19:22:09 +0000 |
commit | 19b4951ec6174ab3ab9be6889be32ac6e4b8317c (patch) | |
tree | 0d5581cf4f6d3d137ec8ca56eb50691cda3b9d9f /webkit/dom_storage | |
parent | bab4326dcf49aeab45abf7214b08ee486cba0842 (diff) | |
download | chromium_src-19b4951ec6174ab3ab9be6889be32ac6e4b8317c.zip chromium_src-19b4951ec6174ab3ab9be6889be32ac6e4b8317c.tar.gz chromium_src-19b4951ec6174ab3ab9be6889be32ac6e4b8317c.tar.bz2 |
Fix the DomStorage is "wicked slow" bug by adding a renderer side cache and using a predominantly async IPC message protocol.
- use DomStorageCachedArea + DomStorageProxy
- an ipc message throttling mechanism to defend against misbehaving usage
- less chatty storage event propagation
- diable sudden termination when domstorage messages are pending to allow changes to be flushed thru to the backend on page unload
- deleted the obsolete sync message types and handlers
BUG=94382,128482
Review URL: https://chromiumcodereview.appspot.com/10383123
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139602 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/dom_storage')
-rw-r--r-- | webkit/dom_storage/dom_storage_area.cc | 8 | ||||
-rw-r--r-- | webkit/dom_storage/dom_storage_types.h | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/webkit/dom_storage/dom_storage_area.cc b/webkit/dom_storage/dom_storage_area.cc index 43f22f1..ab4d5f8 100644 --- a/webkit/dom_storage/dom_storage_area.cc +++ b/webkit/dom_storage/dom_storage_area.cc @@ -58,7 +58,7 @@ DomStorageArea::DomStorageArea( : namespace_id_(namespace_id), origin_(origin), directory_(directory), task_runner_(task_runner), - map_(new DomStorageMap(kPerAreaQuota)), + map_(new DomStorageMap(kPerAreaQuota + kPerAreaOverQuotaAllowance)), is_initial_import_done_(true), is_shutdown_(false), commit_batches_in_flight_(0) { @@ -137,7 +137,7 @@ bool DomStorageArea::Clear() { if (map_->Length() == 0) return false; - map_ = new DomStorageMap(kPerAreaQuota); + map_ = new DomStorageMap(kPerAreaQuota + kPerAreaOverQuotaAllowance); if (backing_.get()) { CommitBatch* commit_batch = CreateCommitBatchIfNeeded(); @@ -176,7 +176,7 @@ void DomStorageArea::DeleteOrigin() { Clear(); return; } - map_ = new DomStorageMap(kPerAreaQuota); + map_ = new DomStorageMap(kPerAreaQuota + kPerAreaOverQuotaAllowance); if (backing_.get()) { is_initial_import_done_ = false; backing_.reset(new DomStorageDatabase(backing_->file_path())); @@ -195,7 +195,7 @@ void DomStorageArea::PurgeMemory() { // Drop the in memory cache, we'll reload when needed. is_initial_import_done_ = false; - map_ = new DomStorageMap(kPerAreaQuota); + map_ = new DomStorageMap(kPerAreaQuota + kPerAreaOverQuotaAllowance); // Recreate the database object, this frees up the open sqlite connection // and its page cache. diff --git a/webkit/dom_storage/dom_storage_types.h b/webkit/dom_storage/dom_storage_types.h index d2b65bf..155b9f4 100644 --- a/webkit/dom_storage/dom_storage_types.h +++ b/webkit/dom_storage/dom_storage_types.h @@ -15,8 +15,15 @@ namespace dom_storage { // The quota for each storage area. Suggested by the spec. +// This value is enforced in renderer processes. const size_t kPerAreaQuota = 5 * 1024 * 1024; +// In the browser process we allow some overage to +// accomodate concurrent writes from different renderers +// that were allowed because the limit imposed in the renderer +// wasn't exceeded. +const size_t kPerAreaOverQuotaAllowance = 100 * 1024; + // Value to indicate the localstorage namespace vs non-zero // values for sessionstorage namespaces. const int64 kLocalStorageNamespaceId = 0; |