From dcc8cf2e65d1aa555cce12431a16547e66b469ee Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 27 Apr 2010 16:31:00 +0100 Subject: Merge webkit.org at r58033 : Initial merge by git Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1 --- WebCore/page/Page.cpp | 56 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 15 deletions(-) (limited to 'WebCore/page/Page.cpp') diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp index d348d73..ee5c052 100644 --- a/WebCore/page/Page.cpp +++ b/WebCore/page/Page.cpp @@ -30,10 +30,10 @@ #include "ContextMenuController.h" #include "DOMWindow.h" #include "DragController.h" -#include "ExceptionCode.h" #include "EditorClient.h" -#include "EventNames.h" #include "Event.h" +#include "EventNames.h" +#include "ExceptionCode.h" #include "FileSystem.h" #include "FocusController.h" #include "Frame.h" @@ -52,12 +52,14 @@ #include "PageGroup.h" #include "PluginData.h" #include "PluginHalter.h" +#include "PluginView.h" #include "ProgressTracker.h" -#include "RenderWidget.h" #include "RenderTheme.h" +#include "RenderWidget.h" #include "ScriptController.h" #include "SelectionController.h" #include "Settings.h" +#include "SharedBuffer.h" #include "StringHash.h" #include "TextResourceDecoder.h" #include "Widget.h" @@ -70,8 +72,8 @@ #include "StorageNamespace.h" #endif -#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC) -#include "JavaScriptDebugServer.h" +#if ENABLE(JAVASCRIPT_DEBUGGER) +#include "ScriptDebugServer.h" #endif #if ENABLE(WML) @@ -151,9 +153,6 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi , m_areMemoryCacheClientCallsEnabled(true) , m_mediaVolume(1) , m_javaScriptURLsAreAllowed(true) -#if ENABLE(INSPECTOR) - , m_parentInspectorController(0) -#endif , m_didLoadUserStyleSheet(false) , m_userStyleSheetModificationTime(0) , m_group(0) @@ -192,8 +191,8 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi m_pluginHalter->setPluginAllowedRunTime(m_settings->pluginAllowedRunTime()); } -#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC) - JavaScriptDebugServer::shared().pageCreated(this); +#if ENABLE(JAVASCRIPT_DEBUGGER) + ScriptDebugServer::shared().pageCreated(this); #endif #ifndef NDEBUG @@ -212,8 +211,6 @@ Page::~Page() m_editorClient->pageDestroyed(); #if ENABLE(INSPECTOR) - if (m_parentInspectorController) - m_parentInspectorController->pageDestroyed(); m_inspectorController->inspectedPageDestroyed(); #endif @@ -310,7 +307,7 @@ void Page::goToItem(HistoryItem* item, FrameLoadType type) { // Abort any current load unless we're navigating the current document to a new state object HistoryItem* currentItem = m_mainFrame->loader()->history()->currentItem(); - if (!item->stateObject() || !currentItem || item->documentSequenceNumber() != currentItem->documentSequenceNumber()) { + if (!item->stateObject() || !currentItem || item->documentSequenceNumber() != currentItem->documentSequenceNumber() || item == currentItem) { // Define what to do with any open database connections. By default we stop them and terminate the database thread. DatabasePolicy databasePolicy = DatabasePolicyStop; @@ -407,7 +404,7 @@ void Page::refreshPlugins(bool reload) PluginData* Page::pluginData() const { - if (!settings()->arePluginsEnabled()) + if (!mainFrame()->loader()->allowPlugins(NotAboutToInstantiatePlugin)) return 0; if (!m_pluginData) m_pluginData = PluginData::create(this); @@ -725,7 +722,7 @@ void Page::setDebugger(JSC::Debugger* debugger) StorageNamespace* Page::sessionStorage(bool optionalCreate) { if (!m_sessionStorage && optionalCreate) - m_sessionStorage = StorageNamespace::sessionStorageNamespace(this); + m_sessionStorage = StorageNamespace::sessionStorageNamespace(this, m_settings->sessionStorageQuota()); return m_sessionStorage.get(); } @@ -793,6 +790,35 @@ InspectorTimelineAgent* Page::inspectorTimelineAgent() const } #endif +void Page::privateBrowsingStateChanged() +{ + bool privateBrowsingEnabled = m_settings->privateBrowsingEnabled(); + + // Collect the PluginViews in to a vector to ensure that action the plug-in takes + // from below privateBrowsingStateChanged does not affect their lifetime. + + Vector, 32> pluginViews; + for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) { + FrameView* view = frame->view(); + if (!view) + return; + + const HashSet >* children = view->children(); + ASSERT(children); + + HashSet >::const_iterator end = children->end(); + for (HashSet >::const_iterator it = children->begin(); it != end; ++it) { + Widget* widget = (*it).get(); + if (!widget->isPluginView()) + continue; + pluginViews.append(static_cast(widget)); + } + } + + for (size_t i = 0; i < pluginViews.size(); i++) + pluginViews[i]->privateBrowsingStateChanged(privateBrowsingEnabled); +} + void Page::pluginAllowedRunTimeChanged() { if (m_pluginHalter) -- cgit v1.1