Commit 477c47c8 authored by beidson@apple.com's avatar beidson@apple.com

2008-04-17 Brady Eidson <beidson@apple.com>

        Reviewed by Anders

        The SessionStorage for a Page has to be copied every time a new Page is created.

        I thought I had the right choke point for creating new Pages at FrameLoader::createWindow(),
        but it just so happens there was another - in the ContextMenuController.

        The *real* choke point for this, then, is in the Chrome itself.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::createWindow): Don't do the SessionStorage copy here...

        * page/Chrome.cpp:
        (WebCore::Chrome::createWindow): Do it here, instead!



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4aa4ecf4
2008-04-17 Brady Eidson <beidson@apple.com>
Reviewed by Anders
The SessionStorage for a Page has to be copied every time a new Page is created.
I thought I had the right choke point for creating new Pages at FrameLoader::createWindow(),
but it just so happens there was another - in the ContextMenuController.
The *real* choke point for this, then, is in the Chrome itself.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::createWindow): Don't do the SessionStorage copy here...
* page/Chrome.cpp:
(WebCore::Chrome::createWindow): Do it here, instead!
2008-04-17 Alice Liu <alice.liu@apple.com>
Reviewed by Jon Honeycutt.
......@@ -99,11 +99,6 @@
#include "SVGViewSpec.h"
#endif
#if ENABLE(DOM_STORAGE)
#include "SessionStorage.h"
#include "StorageArea.h"
#endif
using KJS::UString;
using KJS::JSLock;
using KJS::JSValue;
......@@ -339,11 +334,6 @@ Frame* FrameLoader::createWindow(FrameLoader* frameLoaderForFrameLookup, const F
if (!page)
return 0;
#if ENABLE(DOM_STORAGE)
if (SessionStorage* oldSessionStorage = oldPage->sessionStorage(false))
page->setSessionStorage(oldSessionStorage->copy(page));
#endif
Frame* frame = page->mainFrame();
if (request.frameName() != "_blank")
frame->tree()->setName(request.frameName());
......
......@@ -42,6 +42,10 @@
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
#if ENABLE(DOM_STORAGE)
#include "SessionStorage.h"
#endif
namespace WebCore {
using namespace HTMLNames;
......@@ -112,7 +116,15 @@ void Chrome::takeFocus(FocusDirection direction) const
Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features) const
{
return m_client->createWindow(frame, request, features);
Page* newPage = m_client->createWindow(frame, request, features);
#if ENABLE(DOM_STORAGE)
if (newPage) {
if (SessionStorage* oldSessionStorage = m_page->sessionStorage(false))
newPage->setSessionStorage(oldSessionStorage->copy(newPage));
}
#endif
return newPage;
}
void Chrome::show() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment