Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: webkit/dom_storage/dom_storage_host.cc

Issue 10629008: DomStorage - Temporary workaround for overly aggressive "bad message termination". (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/dom_storage/dom_storage_host.cc
===================================================================
--- webkit/dom_storage/dom_storage_host.cc (revision 143424)
+++ webkit/dom_storage/dom_storage_host.cc (working copy)
@@ -30,8 +30,12 @@
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 @@
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 @@
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698