diff options
author | ager@chromium.org <ager@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-01 06:35:57 +0000 |
---|---|---|
committer | ager@chromium.org <ager@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-01 06:35:57 +0000 |
commit | a9ce3a07feb5a0793fd6279c384b9f822788c317 (patch) | |
tree | 1992418b2b8f7c45d4d4297d5edf1a2cc751ed46 /webkit | |
parent | e28ae78d7236757bdd75d8dffd567391678eedc2 (diff) | |
download | chromium_src-a9ce3a07feb5a0793fd6279c384b9f822788c317.zip chromium_src-a9ce3a07feb5a0793fd6279c384b9f822788c317.tar.gz chromium_src-a9ce3a07feb5a0793fd6279c384b9f822788c317.tar.bz2 |
Keep JS wrappers for non-node objects associated with a DOMWindow
alive across GCs.
This change needs a WebKit change to go in first which adds frame and
type accessors to these objects.
Review URL: http://codereview.chromium.org/49038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/port/bindings/v8/v8_custom.h | 28 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_proxy.cpp | 43 | ||||
-rw-r--r-- | webkit/tools/layout_tests/test_expectations.txt | 3 |
3 files changed, 65 insertions, 9 deletions
diff --git a/webkit/port/bindings/v8/v8_custom.h b/webkit/port/bindings/v8/v8_custom.h index a891e2e..ca30a30 100644 --- a/webkit/port/bindings/v8/v8_custom.h +++ b/webkit/port/bindings/v8/v8_custom.h @@ -121,14 +121,34 @@ class V8Custom { kDefaultWrapperInternalFieldCount + 1; #endif - static const int kDOMWindowHistoryIndex = + static const int kDOMWindowConsoleIndex = kDefaultWrapperInternalFieldCount + 0; - static const int kDOMWindowNavigatorIndex = + static const int kDOMWindowHistoryIndex = kDefaultWrapperInternalFieldCount + 1; - static const int kDOMWindowLocationIndex = + static const int kDOMWindowLocationbarIndex = kDefaultWrapperInternalFieldCount + 2; - static const int kDOMWindowInternalFieldCount = + static const int kDOMWindowMenubarIndex = kDefaultWrapperInternalFieldCount + 3; + static const int kDOMWindowNavigatorIndex = + kDefaultWrapperInternalFieldCount + 4; + static const int kDOMWindowPersonalbarIndex = + kDefaultWrapperInternalFieldCount + 5; + static const int kDOMWindowScreenIndex = + kDefaultWrapperInternalFieldCount + 6; + static const int kDOMWindowScrollbarsIndex = + kDefaultWrapperInternalFieldCount + 7; + static const int kDOMWindowSelectionIndex = + kDefaultWrapperInternalFieldCount + 8; + static const int kDOMWindowStatusbarIndex = + kDefaultWrapperInternalFieldCount + 9; + static const int kDOMWindowToolbarIndex = + kDefaultWrapperInternalFieldCount + 10; + static const int kDOMWindowLocationIndex = + kDefaultWrapperInternalFieldCount + 11; + static const int kDOMWindowDOMSelectionIndex = + kDefaultWrapperInternalFieldCount + 12; + static const int kDOMWindowInternalFieldCount = + kDefaultWrapperInternalFieldCount + 13; static const int kStyleSheetOwnerNodeIndex = kDefaultWrapperInternalFieldCount + 0; diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp index deb47fd..54d24a9 100644 --- a/webkit/port/bindings/v8/v8_proxy.cpp +++ b/webkit/port/bindings/v8/v8_proxy.cpp @@ -2369,13 +2369,17 @@ v8::Handle<v8::Value> V8Proxy::ToV8Object(V8ClassIndex::V8WrapperType type, void else SetJSWrapperForDOMObject(imp, result); - // Special case for non-node objects History, Location and - // Navigator. Both Safari and FF let Location and Navigator JS - // wrappers survive GC. To mimic their behaviors, V8 creates + // Special case for non-node objects associated with a + // DOMWindow. Both Safari and FF let the JS wrappers for these + // objects survive GC. To mimic their behavior, V8 creates // hidden references from the DOMWindow to these wrapper // objects. These references get cleared when the DOMWindow is // reused by a new page. switch (type) { + case V8ClassIndex::CONSOLE: + SetHiddenWindowReference(static_cast<Console*>(imp)->frame(), + V8Custom::kDOMWindowConsoleIndex, result); + break; case V8ClassIndex::HISTORY: SetHiddenWindowReference(static_cast<History*>(imp)->frame(), V8Custom::kDOMWindowHistoryIndex, result); @@ -2384,10 +2388,43 @@ v8::Handle<v8::Value> V8Proxy::ToV8Object(V8ClassIndex::V8WrapperType type, void SetHiddenWindowReference(static_cast<Navigator*>(imp)->frame(), V8Custom::kDOMWindowNavigatorIndex, result); break; + case V8ClassIndex::SCREEN: + SetHiddenWindowReference(static_cast<Screen*>(imp)->frame(), + V8Custom::kDOMWindowScreenIndex, result); + break; case V8ClassIndex::LOCATION: SetHiddenWindowReference(static_cast<Location*>(imp)->frame(), V8Custom::kDOMWindowLocationIndex, result); break; + case V8ClassIndex::DOMSELECTION: + SetHiddenWindowReference(static_cast<DOMSelection*>(imp)->frame(), + V8Custom::kDOMWindowDOMSelectionIndex, result); + break; + case V8ClassIndex::BARINFO: { + BarInfo* barinfo = static_cast<BarInfo*>(imp); + Frame* frame = barinfo->frame(); + switch (barinfo->type()) { + case BarInfo::Locationbar: + SetHiddenWindowReference(frame, V8Custom::kDOMWindowLocationbarIndex, result); + break; + case BarInfo::Menubar: + SetHiddenWindowReference(frame, V8Custom::kDOMWindowMenubarIndex, result); + break; + case BarInfo::Personalbar: + SetHiddenWindowReference(frame, V8Custom::kDOMWindowPersonalbarIndex, result); + break; + case BarInfo::Scrollbars: + SetHiddenWindowReference(frame, V8Custom::kDOMWindowScrollbarsIndex, result); + break; + case BarInfo::Statusbar: + SetHiddenWindowReference(frame, V8Custom::kDOMWindowStatusbarIndex, result); + break; + case BarInfo::Toolbar: + SetHiddenWindowReference(frame, V8Custom::kDOMWindowToolbarIndex, result); + break; + } + break; + } default: break; } diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt index 9b2f6c6..fccb3e1 100644 --- a/webkit/tools/layout_tests/test_expectations.txt +++ b/webkit/tools/layout_tests/test_expectations.txt @@ -1957,7 +1957,6 @@ LINUX : LayoutTests/fast/overflow/hit-test-overflow-controls.html = FAIL // Regressions from merge 41217:41268 // New tests -DEFER : LayoutTests/fast/dom/Window/customized-property-survives-gc.html = FAIL DEFER : LayoutTests/fast/dom/Window/webkitConvertPoint.html = FAIL DEFER LINUX WIN : LayoutTests/fast/gradients/background-clipped.html = FAIL @@ -2426,4 +2425,4 @@ WIN : LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-post.html = FA WIN : LayoutTests/http/tests/security/cross-frame-access-protocol-explicit-domain.html = FAIL WIN : LayoutTests/http/tests/security/cross-frame-access-protocol.html = FAIL WIN : LayoutTests/http/tests/ssl/verify-ssl-enabled.php = FAIL -WIN MAC LINUX : LayoutTests/fast/loader/simultaneous-reloads-assert.html = TIMEOUT
\ No newline at end of file +WIN MAC LINUX : LayoutTests/fast/loader/simultaneous-reloads-assert.html = TIMEOUT |