summaryrefslogtreecommitdiffstats
path: root/WebCore/page/Page.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:31:00 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:12 +0100
commitdcc8cf2e65d1aa555cce12431a16547e66b469ee (patch)
tree92a8d65cd5383bca9749f5327fb5e440563926e6 /WebCore/page/Page.cpp
parentccac38a6b48843126402088a309597e682f40fe6 (diff)
downloadexternal_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz
external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebCore/page/Page.cpp')
-rw-r--r--WebCore/page/Page.cpp56
1 files changed, 41 insertions, 15 deletions
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<RefPtr<PluginView>, 32> pluginViews;
+ for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+ FrameView* view = frame->view();
+ if (!view)
+ return;
+
+ const HashSet<RefPtr<Widget> >* children = view->children();
+ ASSERT(children);
+
+ HashSet<RefPtr<Widget> >::const_iterator end = children->end();
+ for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it != end; ++it) {
+ Widget* widget = (*it).get();
+ if (!widget->isPluginView())
+ continue;
+ pluginViews.append(static_cast<PluginView*>(widget));
+ }
+ }
+
+ for (size_t i = 0; i < pluginViews.size(); i++)
+ pluginViews[i]->privateBrowsingStateChanged(privateBrowsingEnabled);
+}
+
void Page::pluginAllowedRunTimeChanged()
{
if (m_pluginHalter)