Unify private browsing with sessions.
authormhock@apple.com <mhock@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Apr 2014 20:07:33 +0000 (20:07 +0000)
committermhock@apple.com <mhock@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Apr 2014 20:07:33 +0000 (20:07 +0000)
commit0a249f3bfd5f680122b8e74848be7630f6cc0194
treed77f0ad9da5eab21546a47789fb2dc82ddc72a17
parentdf009672a1bdff2b776ceea7ae90f994ac715c6c
Unify private browsing with sessions.
https://bugs.webkit.org/show_bug.cgi?id=130099

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Unless otherwise noted, the following consists solely of mechanical changes to replace querying WebCore::Settings::privateBrowsingEnabled() with Page::usesEphemeralSession().

* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::allowDatabaseAccess):
* WebCore.exp.in: Remove Settings::setPrivateBrowsingEnabled, add Page::legacyPrivateBrowsingEnabled.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* loader/HistoryController.cpp:
(WebCore::HistoryController::updateForStandardLoad):
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
(WebCore::HistoryController::updateForClientRedirect):
(WebCore::HistoryController::updateForSameDocumentNavigation):
(WebCore::HistoryController::pushState):
(WebCore::HistoryController::replaceState):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::cacheForMainRequest):
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
(WebCore::ApplicationCacheGroup::update):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::isApplicationCacheEnabled):
* loader/icon/IconController.cpp:
(WebCore::IconController::continueLoadWithDecision):
* page/Page.cpp:
(WebCore::Page::Page): Initialize with defaultSessionID.
(WebCore::Page::legacyPrivateBrowsingEnabled): Legacy setting for private browsing.
(WebCore::Page::privateBrowsingStateChanged): Move implementation to setSessionID.
(WebCore::Page::sessionID): Simplify to just return m_sessionID.
(WebCore::Page::setSessionID): Also perform privateBrowsingStateChanged action.a
(WebCore::Page::privateBrowsingStateChanged): Deleted.
(WebCore::Page::checkSubframeCountConsistency): Deleted.
* page/Page.h:
* page/PageConsole.cpp:
(WebCore::PageConsole::addMessage):
(WebCore::PageConsole::messageWithTypeAndLevel):
* page/Settings.cpp: Remove privateBrowsingEnabled setting.
(WebCore::Settings::Settings):
(WebCore::Settings::setPrivateBrowsingEnabled): Page reflects setting using session.
* page/Settings.h:
* plugins/PluginView.cpp:
(WebCore::PluginView::getValue):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::addSearchResult):
* storage/Storage.cpp:
(WebCore::Storage::isDisabledByPrivateBrowsing):

Source/WebKit/efl:

* ewk/ewk_view.cpp:
(_ewk_view_priv_new): Change WebCore::Settings::privateBrowsingEnabled() to Page::sessionID().isEphemeral().
(ewk_view_setting_private_browsing_set): Change WebCore::Settings::setPrivateBrowsingEnabled() to Page::enableLegacyPrivateBrowsing().

Source/WebKit/gtk:

* WebCoreSupport/FrameLoaderClientGtk.cpp: Change WebCore::Settings::privateBrowsingEnabled() to Page:usesEphemeralSession().
(WebKit::FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
* webkit/webkitwebview.cpp: Change Settings::setPrivateBrowsingEnabled() to Page::enablePrivateBrowsing().
(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm: Change WebCore::Settings::privateBrowsingEnabled() to Page::sessionID().isEphemeral().
(WebFrameLoaderClient::updateGlobalHistoryItemForPage):
* WebCoreSupport/WebFrameNetworkingContext.mm: Ditto.
(WebFrameNetworkingContext::storageSession):
* WebView/WebView.mm: Change WebCore::Settings::setPrivateBrowsingEnabled() to Page::enableLegacyPrivateBrowsing().
(-[WebView _preferencesChanged:]):

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp: Change WebCore::Settings::privateBrowsingEnabled() to Page::sessionID().isEphemeral().
(WebFrameLoaderClient::updateGlobalHistoryItemForPage):
* WebCoreSupport/WebFrameNetworkingContext.cpp: Ditto.
(WebFrameNetworkingContext::storageSession):
* WebView.cpp: Change WebCore::Settings::setPrivateBrowsingEnabled() to Page::enableLegacyPrivateBrowsing().
(WebView::notifyPreferencesChanged):

Source/WebKit2:

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: Change WebPage::isUsingEphemeralSession() to WebPage::usesEphemeralSession().
(WKBundlePageIsUsingEphemeralSession):
* WebProcess/InjectedBundle/InjectedBundle.cpp: Change Settings::setPrivateBrowsingEnabled() to Page::enableLegacyPrivateBrowsing().
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/Plugins/PluginView.cpp: Change Settings::privateBrowsingEnabled() to Page::usesEphemeralSession().
(WebKit::PluginView::isPrivateBrowsingEnabled):
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: Ditto.
(WebKit::WebFrameNetworkingContext::storageSession):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::usesEphemeralSession): Renamed from isUsingEphemeralSession.
(WebKit::WebPage::setSessionID): Ensure session before setting.
(WebKit::WebPage::updatePreferences): Set session to legacy private session if needed.
(WebKit::WebPage::sessionID): Moved to header.
(WebKit::WebPage::isUsingEphemeralSession): Renamed to usesEphemeralSession.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::sessionID): Just call down to m_page.

Tools:

Add an API test for ephemeral sessions similar to PrivateBrowsingPushStateNoHistoryCallback.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/EphemeralSessionPushStateNoHistoryCallback.cpp:
(TestWebKitAPI::didNavigateWithNavigationData):
(TestWebKitAPI::didSameDocumentNavigationForFrame):
(TestWebKitAPI::TEST):

* TestWebKitAPI/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp: Also test to make sure private browsing can be disabled.
(TestWebKitAPI::didNavigateWithoutNavigationData):
(TestWebKitAPI::didNavigateWithNavigationData):
(TestWebKitAPI::didSameDocumentNavigationForFrame):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
40 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
Source/WebCore/WebCore.exp.in
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/loader/HistoryController.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
Source/WebCore/loader/appcache/ApplicationCacheHost.cpp
Source/WebCore/loader/icon/IconController.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PageConsole.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/plugins/PluginView.cpp
Source/WebCore/rendering/RenderSearchField.cpp
Source/WebCore/storage/Storage.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/EphemeralSessionPushStateNoHistoryCallback.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp