diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 06:15:41 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-07 06:15:41 +0000 |
commit | 6e07be78163c534e1ac425104ad8d47042b5d116 (patch) | |
tree | 17122c1923f121245896b149a386ee2335acd56f /chrome/browser/in_process_webkit | |
parent | 952cb7063b41fc2afaa9d1c265d38158b0e7d3e0 (diff) | |
download | chromium_src-6e07be78163c534e1ac425104ad8d47042b5d116.zip chromium_src-6e07be78163c534e1ac425104ad8d47042b5d116.tar.gz chromium_src-6e07be78163c534e1ac425104ad8d47042b5d116.tar.bz2 |
Fix a major DOM Storage memory leak and try again to enable the UI tests.
TBR=michaeln
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/251109
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28237 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/in_process_webkit')
5 files changed, 8 insertions, 12 deletions
diff --git a/chrome/browser/in_process_webkit/dom_storage_uitest.cc b/chrome/browser/in_process_webkit/dom_storage_uitest.cc index 84a7e3b..1828679 100644 --- a/chrome/browser/in_process_webkit/dom_storage_uitest.cc +++ b/chrome/browser/in_process_webkit/dom_storage_uitest.cc @@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(jorlow): Reenable when https://bugs.webkit.org/show_bug.cgi?id=28094 -// is fixed. Until then, this will cause crashes even if the -// individual tests are disabled. -#if 0 - #include "chrome/common/chrome_switches.h" #include "chrome/test/ui/ui_layout_test.h" @@ -19,7 +14,7 @@ // TODO(jorlow): Enable these tests when we remove them from the // test_exceptions.txt file. static const char* kSubDirFiles[] = { - "clear.html", + //"clear.html", "delete-removal.html", "enumerate-storage.html", "enumerate-with-length-and-key.html", @@ -31,7 +26,7 @@ static const char* kSubDirFiles[] = { //"simple-events.html", "simple-usage.html", //"string-conversion.html", -// "window-open.html" + //"window-open.html" }; class DOMStorageTest : public UILayoutTest { @@ -76,5 +71,3 @@ TEST_F(DOMStorageTest, SessionStorageLayoutTests) { for (size_t i=0; i<arraysize(kSubDirFiles); ++i) RunLayoutTest(kSubDirFiles[i], false); } - -#endif diff --git a/chrome/browser/in_process_webkit/storage_area.cc b/chrome/browser/in_process_webkit/storage_area.cc index 11369c5..885b0b15 100644 --- a/chrome/browser/in_process_webkit/storage_area.cc +++ b/chrome/browser/in_process_webkit/storage_area.cc @@ -15,6 +15,7 @@ StorageArea::StorageArea(const string16& origin, WebStorageArea* storage_area, : origin_(origin), storage_area_(storage_area), id_(id) { + DCHECK(storage_area_.get()); } StorageArea::~StorageArea() { diff --git a/chrome/browser/in_process_webkit/storage_area.h b/chrome/browser/in_process_webkit/storage_area.h index d6c6615..7aaf73a 100644 --- a/chrome/browser/in_process_webkit/storage_area.h +++ b/chrome/browser/in_process_webkit/storage_area.h @@ -7,6 +7,7 @@ #include "base/hash_tables.h" #include "base/nullable_string16.h" +#include "base/scoped_ptr.h" namespace WebKit { class WebStorageArea; @@ -35,7 +36,7 @@ class StorageArea { string16 origin_; // The storage area we wrap. - WebKit::WebStorageArea* storage_area_; + scoped_ptr<WebKit::WebStorageArea> storage_area_; // Our storage area id. Unique to our parent WebKitContext. int64 id_; diff --git a/chrome/browser/in_process_webkit/storage_namespace.cc b/chrome/browser/in_process_webkit/storage_namespace.cc index c2fe982..7bab75f 100644 --- a/chrome/browser/in_process_webkit/storage_namespace.cc +++ b/chrome/browser/in_process_webkit/storage_namespace.cc @@ -49,7 +49,7 @@ StorageNamespace::StorageNamespace(DOMStorageContext* dom_storage_context, id_(id), dom_storage_type_(dom_storage_type) { DCHECK(dom_storage_context_); - DCHECK(storage_namespace_); + DCHECK(storage_namespace_.get()); dom_storage_context_->RegisterStorageNamespace(this); } diff --git a/chrome/browser/in_process_webkit/storage_namespace.h b/chrome/browser/in_process_webkit/storage_namespace.h index 856f5de..1a9ea54 100644 --- a/chrome/browser/in_process_webkit/storage_namespace.h +++ b/chrome/browser/in_process_webkit/storage_namespace.h @@ -7,6 +7,7 @@ #include "base/string16.h" #include "base/hash_tables.h" +#include "base/scoped_ptr.h" #include "chrome/common/dom_storage_type.h" class DOMStorageContext; @@ -51,7 +52,7 @@ class StorageNamespace { DOMStorageContext* dom_storage_context_; // The WebKit storage namespace we manage. - WebKit::WebStorageNamespace* storage_namespace_; + scoped_ptr<WebKit::WebStorageNamespace> storage_namespace_; // Our id. Unique to our parent WebKitContext class. int64 id_; |