Diff
Modified: trunk/Source/WebKit2/ChangeLog (163596 => 163597)
--- trunk/Source/WebKit2/ChangeLog 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/ChangeLog 2014-02-07 02:12:18 UTC (rev 163597)
@@ -1,3 +1,50 @@
+2014-02-06 Anders Carlsson <[email protected]>
+
+ Begin work on making preferences per page instead of per page group
+ https://bugs.webkit.org/show_bug.cgi?id=128349
+
+ Reviewed by Andreas Kling.
+
+ * UIProcess/API/C/WKPageGroup.cpp:
+ (WKPageGroupGetPreferences):
+ * UIProcess/API/C/mac/WKPagePrivateMac.cpp:
+ (WKPageIsURLKnownHSTSHost):
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _preferencesDidChange]):
+ (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::createWebPage):
+ * UIProcess/WebInspectorProxy.cpp:
+ (WebKit::WebInspectorPageGroups::createInspectorPageGroup):
+ (WebKit::WebInspectorProxy::attach):
+ (WebKit::WebInspectorProxy::detach):
+ (WebKit::WebInspectorProxy::setAttachedWindowHeight):
+ (WebKit::WebInspectorProxy::setAttachedWindowWidth):
+ (WebKit::WebInspectorProxy::createInspectorPage):
+ (WebKit::WebInspectorProxy::shouldOpenAttached):
+ * UIProcess/WebPageGroup.cpp:
+ (WebKit::WebPageGroup::preferences):
+ * UIProcess/WebPageGroup.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::create):
+ (WebKit::WebPageProxy::WebPageProxy):
+ (WebKit::WebPageProxy::isProcessSuppressible):
+ (WebKit::WebPageProxy::canShowMIMEType):
+ (WebKit::WebPageProxy::preferencesDidChange):
+ (WebKit::WebPageProxy::creationParameters):
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::preferences):
+ (WebKit::WebPageProxy::setPreferences):
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::createWebPage):
+ * UIProcess/mac/ViewGestureController.mm:
+ (WebKit::ViewGestureController::beginSwipeGesture):
+ * UIProcess/mac/WebInspectorProxyMac.mm:
+ (WebKit::WebInspectorProxy::createInspectorWindow):
+ (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+ (WebKit::WebInspectorProxy::windowFrameDidChange):
+ (WebKit::WebInspectorProxy::platformAttach):
+
2014-02-06 Gavin Barraclough <[email protected]>
Remove ChildProcess::m_activeTasks
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp 2014-02-07 02:12:18 UTC (rev 163597)
@@ -55,7 +55,7 @@
WKPreferencesRef WKPageGroupGetPreferences(WKPageGroupRef pageGroupRef)
{
- return toAPI(toImpl(pageGroupRef)->preferences());
+ return toAPI(&toImpl(pageGroupRef)->preferences());
}
void WKPageGroupAddUserStyleSheet(WKPageGroupRef pageGroupRef, WKStringRef sourceRef, WKURLRef baseURL, WKArrayRef whitelistedURLPatterns, WKArrayRef blacklistedURLPatterns, WKUserContentInjectedFrames injectedFrames)
Modified: trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.cpp (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.cpp 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.cpp 2014-02-07 02:12:18 UTC (rev 163597)
@@ -42,7 +42,7 @@
bool WKPageIsURLKnownHSTSHost(WKPageRef page, WKURLRef url)
{
WebPageProxy* webPageProxy = toImpl(page);
- bool privateBrowsingEnabled = webPageProxy->pageGroup().preferences()->privateBrowsingEnabled();
+ bool privateBrowsingEnabled = webPageProxy->pageGroup().preferences().privateBrowsingEnabled();
return webPageProxy->process().context().isURLKnownHSTSHost(toImpl(url)->string(), privateBrowsingEnabled);
}
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2014-02-07 02:12:18 UTC (rev 163597)
@@ -2241,7 +2241,7 @@
- (void)_preferencesDidChange
{
- BOOL needsViewFrameInWindowCoordinates = _data->_page->pageGroup().preferences()->pluginsEnabled();
+ BOOL needsViewFrameInWindowCoordinates = _data->_page->preferences().pluginsEnabled();
if (!!needsViewFrameInWindowCoordinates == !!_data->_needsViewFrameInWindowCoordinates)
return;
@@ -2947,7 +2947,7 @@
_data->_intrinsicContentSize = NSMakeSize(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric);
- _data->_needsViewFrameInWindowCoordinates = _data->_page->pageGroup().preferences()->pluginsEnabled();
+ _data->_needsViewFrameInWindowCoordinates = _data->_page->preferences().pluginsEnabled();
[self _registerDraggedTypes];
Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/WebContext.cpp 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp 2014-02-07 02:12:18 UTC (rev 163597)
@@ -785,7 +785,7 @@
PassRefPtr<WebPageProxy> WebContext::createWebPage(PageClient& pageClient, WebPageGroup* pageGroup, WebPageProxy* relatedPage)
{
WebPageGroup* group = pageGroup ? pageGroup : &m_defaultPageGroup.get();
- return createWebPage(pageClient, group, group->preferences()->privateBrowsingEnabled() ? API::Session::legacyPrivateSession() : API::Session::defaultSession(), relatedPage);
+ return createWebPage(pageClient, group, group->preferences().privateBrowsingEnabled() ? API::Session::legacyPrivateSession() : API::Session::defaultSession(), relatedPage);
}
DownloadProxy* WebContext::download(WebPageProxy* initiatingPage, const ResourceRequest& request)
Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp 2014-02-07 02:12:18 UTC (rev 163597)
@@ -105,11 +105,11 @@
#ifndef NDEBUG
// Allow developers to inspect the Web Inspector in debug builds.
- pageGroup->preferences()->setDeveloperExtrasEnabled(true);
- pageGroup->preferences()->setLogsPageMessagesToSystemConsoleEnabled(true);
+ pageGroup->preferences().setDeveloperExtrasEnabled(true);
+ pageGroup->preferences().setLogsPageMessagesToSystemConsoleEnabled(true);
#endif
- pageGroup->preferences()->setApplicationChromeModeEnabled(true);
+ pageGroup->preferences().setApplicationChromeModeEnabled(true);
return pageGroup.release();
}
@@ -270,10 +270,10 @@
m_isAttached = true;
m_attachmentSide = side;
- inspectorPageGroup()->preferences()->setInspectorAttachmentSide(side);
+ inspectorPageGroup()->preferences().setInspectorAttachmentSide(side);
if (m_isVisible)
- inspectorPageGroup()->preferences()->setInspectorStartsAttached(true);
+ inspectorPageGroup()->preferences().setInspectorStartsAttached(true);
switch (m_attachmentSide) {
case AttachmentSideBottom:
@@ -296,7 +296,7 @@
m_isAttached = false;
if (m_isVisible)
- inspectorPageGroup()->preferences()->setInspectorStartsAttached(false);
+ inspectorPageGroup()->preferences().setInspectorStartsAttached(false);
m_page->process().send(Messages::WebInspector::Detached(), m_page->pageID());
@@ -305,13 +305,13 @@
void WebInspectorProxy::setAttachedWindowHeight(unsigned height)
{
- inspectorPageGroup()->preferences()->setInspectorAttachedHeight(height);
+ inspectorPageGroup()->preferences().setInspectorAttachedHeight(height);
platformSetAttachedWindowHeight(height);
}
void WebInspectorProxy::setAttachedWindowWidth(unsigned width)
{
- inspectorPageGroup()->preferences()->setInspectorAttachedWidth(width);
+ inspectorPageGroup()->preferences().setInspectorAttachedWidth(width);
platformSetAttachedWindowWidth(width);
}
@@ -429,7 +429,7 @@
return;
m_isAttached = shouldOpenAttached();
- m_attachmentSide = static_cast<AttachmentSide>(inspectorPageGroup()->preferences()->inspectorAttachmentSide());
+ m_attachmentSide = static_cast<AttachmentSide>(inspectorPageGroup()->preferences().inspectorAttachmentSide());
WebPageProxy* inspectorPage = platformCreateInspectorPage();
ASSERT(inspectorPage);
@@ -563,7 +563,7 @@
bool WebInspectorProxy::shouldOpenAttached()
{
- return inspectorPageGroup()->preferences()->inspectorStartsAttached() && canAttach();
+ return inspectorPageGroup()->preferences().inspectorStartsAttached() && canAttach();
}
#if ENABLE(INSPECTOR_SERVER)
Modified: trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp 2014-02-07 02:12:18 UTC (rev 163597)
@@ -114,7 +114,7 @@
}
}
-WebPreferences* WebPageGroup::preferences() const
+WebPreferences& WebPageGroup::preferences() const
{
if (!m_preferences) {
if (!m_data.identifer.isNull())
@@ -123,7 +123,8 @@
m_preferences = WebPreferences::create();
m_preferences->addPageGroup(const_cast<WebPageGroup*>(this));
}
- return m_preferences.get();
+
+ return *m_preferences;
}
void WebPageGroup::preferencesDidChange()
Modified: trunk/Source/WebKit2/UIProcess/WebPageGroup.h (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/WebPageGroup.h 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/WebPageGroup.h 2014-02-07 02:12:18 UTC (rev 163597)
@@ -56,7 +56,7 @@
const WebPageGroupData& data() { return m_data; }
void setPreferences(WebPreferences*);
- WebPreferences* preferences() const;
+ WebPreferences& preferences() const;
void preferencesDidChange();
void addUserStyleSheet(const String& source, const String& baseURL, API::Array* whitelist, API::Array* blacklist, WebCore::UserContentInjectedFrames, WebCore::UserStyleLevel);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2014-02-07 02:12:18 UTC (rev 163597)
@@ -241,18 +241,19 @@
}
#endif // !LOG_DISABLED
-PassRefPtr<WebPageProxy> WebPageProxy::create(PageClient& pageClient, WebProcessProxy& process, WebPageGroup& pageGroup, API::Session& session, uint64_t pageID)
+PassRefPtr<WebPageProxy> WebPageProxy::create(PageClient& pageClient, WebProcessProxy& process, WebPageGroup& pageGroup, WebPreferences& preferences, API::Session& session, uint64_t pageID)
{
- return adoptRef(new WebPageProxy(pageClient, process, pageGroup, session, pageID));
+ return adoptRef(new WebPageProxy(pageClient, process, pageGroup, preferences, session, pageID));
}
-WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, WebPageGroup& pageGroup, API::Session& session, uint64_t pageID)
+WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, WebPageGroup& pageGroup, WebPreferences& preferences, API::Session& session, uint64_t pageID)
: m_pageClient(pageClient)
, m_loaderClient(std::make_unique<API::LoaderClient>())
, m_policyClient(std::make_unique<API::PolicyClient>())
, m_uiClient(std::make_unique<API::UIClient>())
, m_process(process)
, m_pageGroup(pageGroup)
+ , m_preferences(preferences)
, m_mainFrame(nullptr)
, m_userAgent(standardUserAgent())
, m_geolocationPermissionRequestManager(*this)
@@ -552,7 +553,7 @@
bool WebPageProxy::isProcessSuppressible() const
{
- return (m_viewState & ViewState::IsVisuallyIdle) && m_pageGroup->preferences()->pageVisibilityBasedProcessSuppressionEnabled();
+ return (m_viewState & ViewState::IsVisuallyIdle) && m_preferences->pageVisibilityBasedProcessSuppressionEnabled();
}
void WebPageProxy::close()
@@ -855,7 +856,7 @@
#if ENABLE(NETSCAPE_PLUGIN_API)
String newMimeType = mimeType;
PluginModuleInfo plugin = m_process->context().pluginInfoStore().findPlugin(newMimeType, URL());
- if (!plugin.path.isNull() && m_pageGroup->preferences()->pluginsEnabled())
+ if (!plugin.path.isNull() && m_preferences->pluginsEnabled())
return true;
#endif // ENABLE(NETSCAPE_PLUGIN_API)
@@ -2064,7 +2065,7 @@
// even if nothing changed in UI process, so that overrides get removed.
// Preferences need to be updated during synchronous printing to make "print backgrounds" preference work when toggled from a print dialog checkbox.
- m_process->send(Messages::WebPage::PreferencesDidChange(pageGroup().preferences()->store()), m_pageID, m_isPerformingDOMPrintOperation ? IPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
+ m_process->send(Messages::WebPage::PreferencesDidChange(m_preferences->store()), m_pageID, m_isPerformingDOMPrintOperation ? IPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
}
void WebPageProxy::didCreateMainFrame(uint64_t frameID)
@@ -3908,7 +3909,7 @@
parameters.viewSize = m_pageClient.viewSize();
parameters.viewState = m_viewState;
parameters.drawingAreaType = m_drawingArea->type();
- parameters.store = m_pageGroup->preferences()->store();
+ parameters.store = m_preferences->store();
parameters.pageGroupData = m_pageGroup->data();
parameters.drawsBackground = m_drawsBackground;
parameters.drawsTransparentBackground = m_drawsTransparentBackground;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-02-07 02:12:18 UTC (rev 163597)
@@ -54,6 +54,7 @@
#include "WebHitTestResult.h"
#include "WebPageContextMenuClient.h"
#include "WebPageCreationParameters.h"
+#include "WebPreferences.h"
#include <WebCore/AlternativeTextClient.h> // FIXME: Needed by WebPageProxyMessages.h for DICTATION_ALTERNATIVES.
#include "WebPageProxyMessages.h"
#include "WebPopupMenuProxy.h"
@@ -330,7 +331,7 @@
, public IPC::MessageSender {
public:
- static PassRefPtr<WebPageProxy> create(PageClient&, WebProcessProxy&, WebPageGroup&, API::Session&, uint64_t pageID);
+ static PassRefPtr<WebPageProxy> create(PageClient&, WebProcessProxy&, WebPageGroup&, WebPreferences&, API::Session&, uint64_t pageID);
virtual ~WebPageProxy();
void setSession(API::Session&);
@@ -723,6 +724,9 @@
WebProcessProxy& process() { return m_process.get(); }
PlatformProcessIdentifier processIdentifier() const;
+ WebPreferences& preferences() { return m_preferences.get(); }
+ void setPreferences(WebPreferences& preferences) { m_preferences = preferences; }
+
WebPageGroup& pageGroup() { return m_pageGroup.get(); }
bool isValid() const;
@@ -872,7 +876,7 @@
#endif
private:
- WebPageProxy(PageClient&, WebProcessProxy&, WebPageGroup&, API::Session&, uint64_t pageID);
+ WebPageProxy(PageClient&, WebProcessProxy&, WebPageGroup&, WebPreferences&, API::Session&, uint64_t pageID);
void platformInitialize();
void updateViewState(WebCore::ViewState::Flags flagsToUpdate = WebCore::ViewState::AllFlags);
@@ -1193,6 +1197,8 @@
Ref<WebProcessProxy> m_process;
Ref<WebPageGroup> m_pageGroup;
+ Ref<WebPreferences> m_preferences;
+
RefPtr<WebFrameProxy> m_mainFrame;
RefPtr<WebFrameProxy> m_focusedFrame;
RefPtr<WebFrameProxy> m_frameSetLargestFrame;
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2014-02-07 02:12:18 UTC (rev 163597)
@@ -39,6 +39,7 @@
#include "WebContext.h"
#include "WebNavigationDataStore.h"
#include "WebNotificationManagerProxy.h"
+#include "WebPageGroup.h"
#include "WebPageProxy.h"
#include "WebPluginSiteDataManager.h"
#include "WebProcessMessages.h"
@@ -170,7 +171,7 @@
PassRefPtr<WebPageProxy> WebProcessProxy::createWebPage(PageClient& pageClient, WebPageGroup& pageGroup, API::Session& session)
{
uint64_t pageID = generatePageID();
- RefPtr<WebPageProxy> webPage = WebPageProxy::create(pageClient, *this, pageGroup, session, pageID);
+ RefPtr<WebPageProxy> webPage = WebPageProxy::create(pageClient, *this, pageGroup, pageGroup.preferences(), session, pageID);
m_pageMap.set(pageID, webPage.get());
globalPageMap().set(pageID, webPage.get());
#if PLATFORM(MAC)
Modified: trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.mm (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.mm 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.mm 2014-02-07 02:12:18 UTC (rev 163597)
@@ -402,7 +402,7 @@
[m_swipeSnapshotLayer setName:@"Gesture Swipe Snapshot Layer"];
[m_swipeSnapshotLayer web_disableAllActions];
- if (m_webPageProxy.pageGroup().preferences()->viewGestureDebuggingEnabled()) {
+ if (m_webPageProxy.preferences().viewGestureDebuggingEnabled()) {
CAFilter* filter = [CAFilter filterWithType:kCAFilterGaussianBlur];
[filter setValue:[NSNumber numberWithFloat:3] forKey:@"inputRadius"];
[m_swipeSnapshotLayer setFilters:@[filter]];
Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (163596 => 163597)
--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm 2014-02-07 02:04:27 UTC (rev 163596)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm 2014-02-07 02:12:18 UTC (rev 163597)
@@ -285,7 +285,7 @@
NSRect windowFrame = NSMakeRect(0, 0, initialWindowWidth, initialWindowHeight);
// Restore the saved window frame, if there was one.
- NSString *savedWindowFrameString = page()->pageGroup().preferences()->inspectorWindowFrame();
+ NSString *savedWindowFrameString = page()->pageGroup().preferences().inspectorWindowFrame();
NSRect savedWindowFrame = NSRectFromString(savedWindowFrameString);
if (!NSIsEmptyRect(savedWindowFrame))
windowFrame = savedWindowFrame;
@@ -375,16 +375,16 @@
switch (m_attachmentSide) {
case AttachmentSideBottom:
- initialRect = NSMakeRect(0, 0, NSWidth(inspectedViewFrame), inspectorPageGroup()->preferences()->inspectorAttachedHeight());
+ initialRect = NSMakeRect(0, 0, NSWidth(inspectedViewFrame), inspectorPageGroup()->preferences().inspectorAttachedHeight());
break;
case AttachmentSideRight:
- initialRect = NSMakeRect(0, 0, inspectorPageGroup()->preferences()->inspectorAttachedWidth(), NSHeight(inspectedViewFrame));
+ initialRect = NSMakeRect(0, 0, inspectorPageGroup()->preferences().inspectorAttachedWidth(), NSHeight(inspectedViewFrame));
break;
}
} else {
initialRect = NSMakeRect(0, 0, initialWindowWidth, initialWindowHeight);
- NSString *windowFrameString = page()->pageGroup().preferences()->inspectorWindowFrame();
+ NSString *windowFrameString = page()->pageGroup().preferences().inspectorWindowFrame();
NSRect windowFrame = NSRectFromString(windowFrameString);
if (!NSIsEmptyRect(windowFrame))
initialRect = [NSWindow contentRectForFrameRect:windowFrame styleMask:windowStyleMask];
@@ -606,7 +606,7 @@
return;
NSString *frameString = NSStringFromRect([m_inspectorWindow frame]);
- page()->pageGroup().preferences()->setInspectorWindowFrame(frameString);
+ page()->pageGroup().preferences().setInspectorWindowFrame(frameString);
}
void WebInspectorProxy::inspectedViewFrameDidChange(CGFloat currentDimension)
@@ -689,10 +689,10 @@
switch (m_attachmentSide) {
case AttachmentSideBottom:
- currentDimension = inspectorPageGroup()->preferences()->inspectorAttachedHeight();
+ currentDimension = inspectorPageGroup()->preferences().inspectorAttachedHeight();
break;
case AttachmentSideRight:
- currentDimension = inspectorPageGroup()->preferences()->inspectorAttachedWidth();
+ currentDimension = inspectorPageGroup()->preferences().inspectorAttachedWidth();
break;
}