summaryrefslogtreecommitdiff
path: root/chromium/content/browser/dom_storage
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/dom_storage')
-rw-r--r--chromium/content/browser/dom_storage/dom_storage_browsertest.cc3
-rw-r--r--chromium/content/browser/dom_storage/dom_storage_host.cc24
-rw-r--r--chromium/content/browser/dom_storage/dom_storage_namespace.h2
-rw-r--r--chromium/content/browser/dom_storage/session_storage_database.cc2
-rw-r--r--chromium/content/browser/dom_storage/session_storage_database_unittest.cc1
5 files changed, 21 insertions, 11 deletions
diff --git a/chromium/content/browser/dom_storage/dom_storage_browsertest.cc b/chromium/content/browser/dom_storage/dom_storage_browsertest.cc
index 79955a8bf17..54da50a7272 100644
--- a/chromium/content/browser/dom_storage/dom_storage_browsertest.cc
+++ b/chromium/content/browser/dom_storage/dom_storage_browsertest.cc
@@ -25,8 +25,7 @@ class DOMStorageBrowserTest : public ContentBrowserTest {
// a #pass or #fail ref.
Shell* the_browser = incognito ? CreateOffTheRecordBrowser() : shell();
NavigateToURLBlockUntilNavigationsComplete(the_browser, test_url, 2);
- std::string result =
- the_browser->web_contents()->GetLastCommittedURL().ref();
+ std::string result = the_browser->web_contents()->GetURL().ref();
if (result != "pass") {
std::string js_result;
ASSERT_TRUE(ExecuteScriptAndExtractString(
diff --git a/chromium/content/browser/dom_storage/dom_storage_host.cc b/chromium/content/browser/dom_storage/dom_storage_host.cc
index 14d288d8653..296d52ec6d7 100644
--- a/chromium/content/browser/dom_storage/dom_storage_host.cc
+++ b/chromium/content/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, DOMStorageValuesMap* 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)
diff --git a/chromium/content/browser/dom_storage/dom_storage_namespace.h b/chromium/content/browser/dom_storage/dom_storage_namespace.h
index 8e67b032bb4..5860685f807 100644
--- a/chromium/content/browser/dom_storage/dom_storage_namespace.h
+++ b/chromium/content/browser/dom_storage/dom_storage_namespace.h
@@ -13,8 +13,6 @@
#include "content/common/content_export.h"
#include "url/gurl.h"
-class GURL;
-
namespace content {
class DOMStorageArea;
diff --git a/chromium/content/browser/dom_storage/session_storage_database.cc b/chromium/content/browser/dom_storage/session_storage_database.cc
index bac3df7a67b..5fb0c90da3b 100644
--- a/chromium/content/browser/dom_storage/session_storage_database.cc
+++ b/chromium/content/browser/dom_storage/session_storage_database.cc
@@ -326,7 +326,7 @@ leveldb::Status SessionStorageDatabase::TryToOpen(leveldb::DB** db) {
// The directory exists but a valid leveldb database might not exist inside it
// (e.g., a subset of the needed files might be missing). Handle this
// situation gracefully by creating the database now.
- options.max_open_files = 0; // Use minimum.
+ options.max_open_files = 64; // Use minimum.
options.create_if_missing = true;
#if defined(OS_WIN)
return leveldb::DB::Open(options, WideToUTF8(file_path_.value()), db);
diff --git a/chromium/content/browser/dom_storage/session_storage_database_unittest.cc b/chromium/content/browser/dom_storage/session_storage_database_unittest.cc
index 2f86c3b9918..9722d72925c 100644
--- a/chromium/content/browser/dom_storage/session_storage_database_unittest.cc
+++ b/chromium/content/browser/dom_storage/session_storage_database_unittest.cc
@@ -219,6 +219,7 @@ void SessionStorageDatabaseTest::CheckDatabaseConsistency() const {
for (DataMap::const_iterator it = data.begin(); it != data.end(); ++it) {
std::string namespace_id;
+ std::string origin;
if (IsNamespaceKey(it->first, &namespace_id)) {
found_namespace_ids.insert(namespace_id);
++valid_keys;