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

Unified Diff: webkit/browser/dom_storage/dom_storage_host.cc

Issue 22320010: Revert "Undo band-aid which was ignoring wrong SessionStorage association." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/browser/dom_storage/dom_storage_host.cc
diff --git a/webkit/browser/dom_storage/dom_storage_host.cc b/webkit/browser/dom_storage/dom_storage_host.cc
index 18c480e384058ac70009a94ba8867df82f74da4d..9b6da6703853e98cb7148194a97c7452ed693d6d 100644
--- a/webkit/browser/dom_storage/dom_storage_host.cc
+++ b/webkit/browser/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_.get())
- return false;
+ if (!references.namespace_.get()) {
+ // 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_.get());
connections_[connection_id] = references;
@@ -50,8 +54,12 @@ bool DomStorageHost::ExtractAreaValues(
int connection_id, ValuesMap* map) {
map->clear();
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 avoid crashing the renderer
+ // for sending a bad message.
+ return true;
+ }
if (!area->IsLoadedInMemory()) {
DomStorageNamespace* ns = GetNamespace(connection_id);
DCHECK(ns);
@@ -93,8 +101,12 @@ bool DomStorageHost::SetAreaItem(
const base::string16& value, const GURL& page_url,
base::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