diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-23 00:30:38 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-23 00:30:38 +0000 |
commit | 85c65278c30f0559e0cfe5ea6c9245a5a084f0ad (patch) | |
tree | 1debbe9f591b24c06df4b904f7ccc62208904292 /webkit/dom_storage | |
parent | d9fa3e909f8e841522a8fecf226bc2c9f515e0d9 (diff) | |
download | chromium_src-85c65278c30f0559e0cfe5ea6c9245a5a084f0ad.zip chromium_src-85c65278c30f0559e0cfe5ea6c9245a5a084f0ad.tar.gz chromium_src-85c65278c30f0559e0cfe5ea6c9245a5a084f0ad.tar.bz2 |
DomStorage - Temporary workaround for overly aggressive "bad message termination". Instead of forcibly crashing the renderer allow it to proceed with more limited session storage functionality (no mutation events, values generally wont survive a page reload).
BUG=134003
Review URL: https://chromiumcodereview.appspot.com/10629008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/dom_storage')
-rw-r--r-- | webkit/dom_storage/dom_storage_host.cc | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/webkit/dom_storage/dom_storage_host.cc b/webkit/dom_storage/dom_storage_host.cc index 301726d..ca0ac80 100644 --- a/webkit/dom_storage/dom_storage_host.cc +++ b/webkit/dom_storage/dom_storage_host.cc @@ -30,8 +30,12 @@ bool DomStorageHost::OpenStorageArea(int connection_id, int namespace_id, return false; // Indicates the renderer gave us very bad data. NamespaceAndArea references; references.namespace_ = context_->GetStorageNamespace(namespace_id); - if (!references.namespace_) - return true; // TODO(michaeln): investigate returning false here + if (!references.namespace_) { + // TODO(michaeln): Fix crbug/134003 and return false here. + // Until then return true to avoid crashing the renderer for + // sending a bad message. + return true; + } references.area_ = references.namespace_->OpenStorageArea(origin); DCHECK(references.area_); connections_[connection_id] = references; @@ -50,10 +54,14 @@ void DomStorageHost::CloseStorageArea(int connection_id) { bool DomStorageHost::ExtractAreaValues( int connection_id, ValuesMap* map) { map->clear(); - AreaMap::iterator found = connections_.find(connection_id); - if (found == connections_.end()) - return false; // Indicates the renderer gave us very bad data. - found->second.area_->ExtractValues(map); + DomStorageArea* area = GetOpenArea(connection_id); + if (!area) { + // TODO(michaeln): Fix crbug/134003 and return false here. + // Until then return true to avoid crashing the renderer + // for sending a bad message. + return true; + } + area->ExtractValues(map); return true; } @@ -84,8 +92,12 @@ bool DomStorageHost::SetAreaItem( const string16& value, const GURL& page_url, NullableString16* old_value) { DomStorageArea* area = GetOpenArea(connection_id); - if (!area) - return false; + if (!area) { + // TODO(michaeln): Fix crbug/134003 and return false here. + // Until then return true to allow the renderer to operate + // to a limited degree out of its cache. + return true; + } if (!area->SetItem(key, value, old_value)) return false; if (old_value->is_null() || old_value->string() != value) |