Source/WebCore: Part of WebKit2: Need a way to send notifications to client when...
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Mar 2011 18:44:50 +0000 (18:44 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Mar 2011 18:44:50 +0000 (18:44 +0000)
commite18b49c4e31b6a6dc665ca2da919253b0da2d206
tree202b08c941e724de1b42f7340d3ab5d3b110ad26
parent90eb35ed8f4c47dd2d801f27f5d6661a62247397
Source/WebCore: Part of WebKit2: Need a way to send notifications to client when cookies change
https://bugs.webkit.org/show_bug.cgi?id=55427
<rdar://problem/9056027>

Reviewed by Adam Roben.

Add functions on CookieStorage that allow listening for changes in cookies. When
the cookies are changed, they call through to CookiesStrategy::notifyCookiesChanged.

No change in behavior requiring tests.

* platform/CookiesStrategy.h: Added.
(WebCore::CookiesStrategy::~CookiesStrategy):

* platform/PlatformStrategies.h:
(WebCore::PlatformStrategies::cookiesStrategy):
(WebCore::PlatformStrategies::PlatformStrategies):

* platform/network/CookieStorage.h: Add new function declarations.

* platform/network/cf/CookieStorageCFNet.cpp:
(WebCore::notifyCookiesChangedOnMainThread): Call through to CookiesStrategy::notifyCookiesChanged.
(WebCore::notifyCookiesChanged): Call notifyCookiesChangedOnMainThread on the main thread.
(WebCore::beginObservingCookieChanges): Set up cookie observers on the loader run loop.
(WebCore::finishObservingCookieChanges): Remove our cookie observers from the loader run loop.

* platform/network/mac/CookieStorageMac.mm:
(-[CookieStorageObjCAdapter notifyCookiesChangedOnMainThread]): Call through to CookiesStrategy::notifyCookiesChanged.
(-[CookieStorageObjCAdapter cookiesChangedNotificationHandler:]): Call notifyCookiesChangedOnMainThread on
    the main thread.
(-[CookieStorageObjCAdapter registerForCookieChangeNotifications]): Set up the observer for cookie change notifications.
(-[CookieStorageObjCAdapter unregisterForCookieChangeNotifications]): Remove the observer for cookie change notifications.
(WebCore::beginObservingCookieChanges): Create our CookieStorageObjCAdapter, and call registerForCookieChangeNotifications.
(WebCore::finishObservingCookieChanges): Call unregisterForCookieChangeNotifications.

Add new file.
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj: Set role on files we need to include in WebKit to private.

Source/WebKit/mac: Part of WebKit2: Need a way to send notifications to client when cookies change
https://bugs.webkit.org/show_bug.cgi?id=55427
<rdar://problem/9056027>

Reviewed by Adam Roben.

Add stubs for CookiesStrategy on Mac WebKit1.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::createCookiesStrategy):
(WebPlatformStrategies::notifyCookiesChanged):

Source/WebKit/qt: Part of WebKit2: Need a way to send notifications to client when cookies change
https://bugs.webkit.org/show_bug.cgi?id=55427
<rdar://problem/9056027>

Reviewed by Adam Roben.

Add stubs for CookiesStrategy on Qt WebKit1.

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::createCookiesStrategy):
(WebPlatformStrategies::notifyCookiesChanged):
* WebCoreSupport/WebPlatformStrategies.h:

Source/WebKit/win: Part of WebKit2: Need a way to send notifications to client when cookies change
https://bugs.webkit.org/show_bug.cgi?id=55427
<rdar://problem/9056027>

Reviewed by Adam Roben.

Add stubs for CookiesStrategy on Windows WebKit1.

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::createCookiesStrategy):
(WebPlatformStrategies::notifyCookiesChanged):
* WebCoreSupport/WebPlatformStrategies.h:

Source/WebKit2: Part of WebKit2: Need a way to send notifications to client when cookies change
https://bugs.webkit.org/show_bug.cgi?id=55427
<rdar://problem/9056027>

Reviewed by Adam Roben.

* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::dispatchDidModifyCookies): Add a stub with a FIXME to send a
    message to the UI process.

* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::createCookiesStrategy):
(WebKit::WebPlatformStrategies::notifyCookiesChanged): Call WebCookieManager::dispatchDidModifyCookies.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/CookiesStrategy.h [new file with mode: 0644]
Source/WebCore/platform/PlatformStrategies.h
Source/WebCore/platform/network/CookieStorage.h
Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp
Source/WebCore/platform/network/mac/CookieStorageMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp
Source/WebKit2/WebProcess/Cookies/WebCookieManager.h
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h