Changeset 80145 in webkit


Ignore:
Timestamp:
Mar 2, 2011 10:44:50 AM (13 years ago)
Author:
bweinstein@apple.com
Message:

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:
Location:
trunk/Source
Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80144 r80145  
     12011-03-01  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Part of WebKit2: Need a way to send notifications to client when cookies change
     6        https://bugs.webkit.org/show_bug.cgi?id=55427
     7        <rdar://problem/9056027>
     8       
     9        Add functions on CookieStorage that allow listening for changes in cookies. When
     10        the cookies are changed, they call through to CookiesStrategy::notifyCookiesChanged.
     11
     12        No change in behavior requiring tests.
     13
     14        * platform/CookiesStrategy.h: Added.
     15        (WebCore::CookiesStrategy::~CookiesStrategy):
     16
     17        * platform/PlatformStrategies.h:
     18        (WebCore::PlatformStrategies::cookiesStrategy):
     19        (WebCore::PlatformStrategies::PlatformStrategies):
     20
     21        * platform/network/CookieStorage.h: Add new function declarations.
     22
     23        * platform/network/cf/CookieStorageCFNet.cpp:
     24        (WebCore::notifyCookiesChangedOnMainThread): Call through to CookiesStrategy::notifyCookiesChanged.
     25        (WebCore::notifyCookiesChanged): Call notifyCookiesChangedOnMainThread on the main thread.
     26        (WebCore::beginObservingCookieChanges): Set up cookie observers on the loader run loop.
     27        (WebCore::finishObservingCookieChanges): Remove our cookie observers from the loader run loop.
     28
     29        * platform/network/mac/CookieStorageMac.mm:
     30        (-[CookieStorageObjCAdapter notifyCookiesChangedOnMainThread]): Call through to CookiesStrategy::notifyCookiesChanged.
     31        (-[CookieStorageObjCAdapter cookiesChangedNotificationHandler:]): Call notifyCookiesChangedOnMainThread on
     32            the main thread.
     33        (-[CookieStorageObjCAdapter registerForCookieChangeNotifications]): Set up the observer for cookie change notifications.
     34        (-[CookieStorageObjCAdapter unregisterForCookieChangeNotifications]): Remove the observer for cookie change notifications.
     35        (WebCore::beginObservingCookieChanges): Create our CookieStorageObjCAdapter, and call registerForCookieChangeNotifications.
     36        (WebCore::finishObservingCookieChanges): Call unregisterForCookieChangeNotifications.
     37       
     38        Add new file.
     39        * WebCore.vcproj/WebCore.vcproj:
     40        * WebCore.xcodeproj/project.pbxproj: Set role on files we need to include in WebKit to private.
     41
    1422011-03-02  Sergey Glazunov  <serg.glazunov@gmail.com>
    243
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r80102 r80145  
    2545125451                        </File>
    2545225452                        <File
     25453                                RelativePath="..\platform\CookiesStrategy.h"
     25454                                >
     25455                        </File>
     25456                        <File
    2545325457                                RelativePath="..\platform\CrossThreadCopier.cpp"
    2545425458                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r80096 r80145  
    806806                3390CA560FFC157B00921962 /* NotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA520FFC157B00921962 /* NotificationCenter.h */; };
    807807                3390CA580FFC157B00921962 /* NotificationContents.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA540FFC157B00921962 /* NotificationContents.h */; };
     808                339B5B63131DAA3200F48D02 /* CookiesStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 339B5B62131DAA3200F48D02 /* CookiesStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
    808809                33C0CCD4112C5E6200CE057D /* SecureTextInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */; };
    809810                33C0CCD5112C5E6200CE057D /* SecureTextInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C0CCD3112C5E6200CE057D /* SecureTextInput.h */; };
     811                33D0212D131DB37B004091A8 /* CookieStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = E13F01EA1270E10D00DFBA71 /* CookieStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
    810812                371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371A67CA11C6C7DB00047B8B /* HyphenationCF.cpp */; };
    811813                371F4F400D25B9AF00ECE0D5 /* FontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4F3E0D25B9AF00ECE0D5 /* FontData.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    71727174                3390CA530FFC157B00921962 /* NotificationCenter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NotificationCenter.idl; path = notifications/NotificationCenter.idl; sourceTree = "<group>"; };
    71737175                3390CA540FFC157B00921962 /* NotificationContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotificationContents.h; path = notifications/NotificationContents.h; sourceTree = "<group>"; };
     7176                339B5B62131DAA3200F48D02 /* CookiesStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookiesStrategy.h; sourceTree = "<group>"; };
    71747177                33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecureTextInput.cpp; sourceTree = "<group>"; };
    71757178                33C0CCD3112C5E6200CE057D /* SecureTextInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecureTextInput.h; sourceTree = "<group>"; };
     
    1828518288                                D8B6152E1032495100C8554A /* Cookie.h */,
    1828618289                                9352088109BD45E900F2038D /* CookieJar.h */,
     18290                                339B5B62131DAA3200F48D02 /* CookiesStrategy.h */,
    1828718291                                2E4346560F546A9900B0F1BA /* CrossThreadCopier.cpp */,
    1828818292                                2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */,
     
    2249322497                                E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
    2249422498                                977E2E0F12F0FC9C00C13379 /* XSSFilter.h in Headers */,
     22499                                339B5B63131DAA3200F48D02 /* CookiesStrategy.h in Headers */,
     22500                                33D0212D131DB37B004091A8 /* CookieStorage.h in Headers */,
    2249522501                        );
    2249622502                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/platform/PlatformStrategies.h

    r64518 r80145  
    3131namespace WebCore {
    3232
     33class CookiesStrategy;
    3334class PluginStrategy;
    3435class LocalizationStrategy;
     
    3738class PlatformStrategies {
    3839public:
     40    CookiesStrategy* cookiesStrategy()
     41    {
     42        if (!m_cookiesStrategy)
     43            m_cookiesStrategy = createCookiesStrategy();
     44        return m_cookiesStrategy;
     45    }
     46
    3947    PluginStrategy* pluginStrategy()
    4048    {
     
    6068protected:
    6169    PlatformStrategies()
    62         : m_pluginStrategy(0)
     70        : m_cookiesStrategy(0)
     71        , m_pluginStrategy(0)
    6372        , m_localizationStrategy(0)
    6473        , m_visitedLinkStrategy(0)
     
    7180
    7281private:
     82    virtual CookiesStrategy* createCookiesStrategy() = 0;
    7383    virtual PluginStrategy* createPluginStrategy() = 0;
    7484    virtual LocalizationStrategy* createLocalizationStrategy() = 0;
    7585    virtual VisitedLinkStrategy* createVisitedLinkStrategy() = 0;
    7686
     87    CookiesStrategy* m_cookiesStrategy;
    7788    PluginStrategy* m_pluginStrategy;
    7889    LocalizationStrategy* m_localizationStrategy;
  • trunk/Source/WebCore/platform/network/CookieStorage.h

    r70400 r80145  
    3030
    3131void setCookieStoragePrivateBrowsingEnabled(bool);
     32void startObservingCookieChanges();
     33void stopObservingCookieChanges();
    3234
    3335}
  • trunk/Source/WebCore/platform/network/cf/CookieStorageCFNet.cpp

    r79261 r80145  
    2929#if USE(CFNETWORK)
    3030
     31#include "LoaderRunLoopCF.h"
    3132#include <CFNetwork/CFHTTPCookiesPriv.h>
    3233#include <WebKitSystemInterface/WebKitSystemInterface.h>
    3334#include <wtf/MainThread.h>
    3435#include <wtf/RetainPtr.h>
     36
     37#if USE(PLATFORM_STRATEGIES)
     38#include "CookiesStrategy.h"
     39#include "PlatformStrategies.h"
     40#endif
    3541
    3642namespace WebCore {
     
    7177}
    7278
     79static void notifyCookiesChangedOnMainThread(void* context)
     80{
     81    ASSERT(isMainThread());
     82
     83#if USE(PLATFORM_STRATEGIES)
     84    platformStrategies()->cookiesStrategy()->notifyCookiesChanged();
     85#endif
     86}
     87
     88static void notifyCookiesChanged(CFHTTPCookieStorageRef inStorage, void *context)
     89{
     90    callOnMainThread(notifyCookiesChangedOnMainThread, 0);
     91}
     92
     93static inline CFRunLoopRef cookieStorageObserverRunLoop()
     94{
     95    // We're using the loader run loop because we need a CFRunLoop to
     96    // call the CFNetwork cookie storage APIs with. Re-using the loader
     97    // run loop is less overhead than starting a new thread to just listen
     98    // for changes in cookies.
     99   
     100    // FIXME: The loaderRunLoop function name should be a little more generic.
     101    return loaderRunLoop();
     102}
     103
     104void beginObservingCookieChanges()
     105{
     106    ASSERT(isMainThread());
     107
     108    CFRunLoopRef runLoop = cookieStorageObserverRunLoop();
     109    ASSERT(runLoop);
     110
     111    CFHTTPCookieStorageRef cookieStorage = currentCookieStorage();
     112    ASSERT(cookieStorage);
     113
     114    CFHTTPCookieStorageScheduleWithRunLoop(cookieStorage, runLoop, kCFRunLoopCommonModes);
     115    CFHTTPCookieStorageAddObserver(cookieStorage, runLoop, kCFRunLoopDefaultMode, notifyCookiesChanged, 0);
     116}
     117
     118void finishObservingCookieChanges()
     119{
     120    ASSERT(isMainThread());
     121
     122    CFRunLoopRef runLoop = cookieStorageObserverRunLoop();
     123    ASSERT(runLoop);
     124
     125    CFHTTPCookieStorageRef cookieStorage = currentCookieStorage();
     126    ASSERT(cookieStorage);
     127
     128    CFHTTPCookieStorageRemoveObserver(cookieStorage, runLoop, kCFRunLoopDefaultMode, notifyCookiesChanged, 0);
     129    CFHTTPCookieStorageUnscheduleFromRunLoop(cookieStorage, runLoop, kCFRunLoopCommonModes);
     130}
     131
    73132} // namespace WebCore
    74133
  • trunk/Source/WebCore/platform/network/mac/CookieStorageMac.mm

    r70400 r80145  
    2828
    2929#import "WebCoreSystemInterface.h"
     30#import <wtf/RetainPtr.h>
     31#import <wtf/UnusedParam.h>
     32
     33#if USE(PLATFORM_STRATEGIES)
     34#include "CookiesStrategy.h"
     35#include "PlatformStrategies.h"
     36#endif
     37
     38using namespace WebCore;
     39
     40@interface CookieStorageObjCAdapter : NSObject
     41-(void)notifyCookiesChangedOnMainThread;
     42-(void)cookiesChangedNotificationHandler:(NSNotification *)notification;
     43-(void)startListeningForCookieChangeNotifications;
     44-(void)stopListeningForCookieChangeNotifications;
     45@end
     46
     47@implementation CookieStorageObjCAdapter
     48
     49-(void)notifyCookiesChangedOnMainThread
     50{
     51#if USE(PLATFORM_STRATEGIES)
     52    platformStrategies()->cookiesStrategy()->notifyCookiesChanged();
     53#endif
     54}
     55
     56-(void)cookiesChangedNotificationHandler:(NSNotification *)notification
     57{
     58    UNUSED_PARAM(notification);
     59
     60    [self performSelectorOnMainThread:@selector(notifyCookiesChangedOnMainThread) withObject:nil waitUntilDone:FALSE];
     61}
     62
     63-(void)startListeningForCookieChangeNotifications
     64{
     65    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cookiesChangedNotificationHandler:) name:NSHTTPCookieManagerCookiesChangedNotification object:[NSHTTPCookieStorage sharedHTTPCookieStorage]];
     66}
     67
     68-(void)stopListeningForCookieChangeNotifications
     69{
     70    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSHTTPCookieManagerCookiesChangedNotification object:nil];
     71}
     72
     73@end
    3074
    3175namespace WebCore {
     
    3680}
    3781
     82static CookieStorageObjCAdapter *cookieStorageAdapter;
     83
     84void startObservingCookieChanges()
     85{
     86    if (!cookieStorageAdapter)
     87        cookieStorageAdapter = [[CookieStorageObjCAdapter alloc] init];
     88    [cookieStorageAdapter startListeningForCookieChangeNotifications];
    3889}
     90
     91void stopObservingCookieChanges()
     92{
     93    ASSERT(cookieStorageAdapter);
     94    [cookieStorageAdapter stopListeningForCookieChangeNotifications];
     95}
     96
     97}
  • trunk/Source/WebKit/mac/ChangeLog

    r80136 r80145  
     12011-03-01  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Part of WebKit2: Need a way to send notifications to client when cookies change
     6        https://bugs.webkit.org/show_bug.cgi?id=55427
     7        <rdar://problem/9056027>
     8       
     9        Add stubs for CookiesStrategy on Mac WebKit1.
     10
     11        * WebCoreSupport/WebPlatformStrategies.h:
     12        * WebCoreSupport/WebPlatformStrategies.mm:
     13        (WebPlatformStrategies::createCookiesStrategy):
     14        (WebPlatformStrategies::notifyCookiesChanged):
     15
    1162011-03-01  Philippe Normand  <pnormand@igalia.com>
    217
  • trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h

    r78842 r80145  
    2727#define WebPlatformStrategies_h
    2828
     29#include <WebCore/CookiesStrategy.h>
    2930#include <WebCore/PlatformStrategies.h>
    3031#include <WebCore/PluginStrategy.h>
     
    3233#include <WebCore/VisitedLinkStrategy.h>
    3334
    34 class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
     35class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
    3536public:
    3637    static void initialize();
     
    4041   
    4142    // WebCore::PlatformStrategies
     43    virtual WebCore::CookiesStrategy* createCookiesStrategy();
    4244    virtual WebCore::PluginStrategy* createPluginStrategy();
    4345    virtual WebCore::LocalizationStrategy* createLocalizationStrategy();
    4446    virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
     47
     48    // WebCore::CookiesStrategy
     49    virtual void notifyCookiesChanged();
    4550
    4651    // WebCore::PluginStrategy
  • trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm

    r80014 r80145  
    5050}
    5151
    52 // PluginStrategy
     52CookiesStrategy* WebPlatformStrategies::createCookiesStrategy()
     53{
     54    return this;
     55}
    5356
    5457PluginStrategy* WebPlatformStrategies::createPluginStrategy()
     
    6568{
    6669    return this;
     70}
     71
     72void WebPlatformStrategies::notifyCookiesChanged()
     73{
    6774}
    6875
  • trunk/Source/WebKit/qt/ChangeLog

    r80077 r80145  
     12011-03-01  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Part of WebKit2: Need a way to send notifications to client when cookies change
     6        https://bugs.webkit.org/show_bug.cgi?id=55427
     7        <rdar://problem/9056027>
     8       
     9        Add stubs for CookiesStrategy on Qt WebKit1.
     10
     11        * WebCoreSupport/WebPlatformStrategies.cpp:
     12        (WebPlatformStrategies::createCookiesStrategy):
     13        (WebPlatformStrategies::notifyCookiesChanged):
     14        * WebCoreSupport/WebPlatformStrategies.h:
     15
    1162011-03-01  Joseph Pecoraro  <joepeck@webkit.org>
    217
  • trunk/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp

    r78842 r80145  
    5858
    5959
    60 // PluginStrategy
     60CookiesStrategy* WebPlatformStrategies::createCookiesStrategy()
     61{
     62    return this;
     63}
    6164
    6265PluginStrategy* WebPlatformStrategies::createPluginStrategy()
     
    7376{
    7477    return this;
     78}
     79
     80void WebPlatformStrategies::notifyCookiesChanged()
     81{
    7582}
    7683
  • trunk/Source/WebKit/qt/WebCoreSupport/WebPlatformStrategies.h

    r78842 r80145  
    2929#define WebPlatformStrategies_h
    3030
     31#include <CookiesStrategy.h>
    3132#include <LocalizationStrategy.h>
    3233#include <PlatformStrategies.h>
     
    3839}
    3940
    40 class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
     41class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
    4142public:
    4243    static void initialize();
     
    4647
    4748    // WebCore::PlatformStrategies
     49    virtual WebCore::CookiesStrategy* createCookiesStrategy();
    4850    virtual WebCore::PluginStrategy* createPluginStrategy();
    4951    virtual WebCore::LocalizationStrategy* createLocalizationStrategy();
    5052    virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
     53   
     54    // WebCore::CookiesStrategy
     55    virtual void notifyCookiesChanged();
    5156
    5257    // WebCore::PluginStrategy
  • trunk/Source/WebKit/win/ChangeLog

    r79953 r80145  
     12011-03-01  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Part of WebKit2: Need a way to send notifications to client when cookies change
     6        https://bugs.webkit.org/show_bug.cgi?id=55427
     7        <rdar://problem/9056027>
     8       
     9        Add stubs for CookiesStrategy on Windows WebKit1.
     10
     11        * WebCoreSupport/WebPlatformStrategies.cpp:
     12        (WebPlatformStrategies::createCookiesStrategy):
     13        (WebPlatformStrategies::notifyCookiesChanged):
     14        * WebCoreSupport/WebPlatformStrategies.h:
     15
    1162011-02-28  Chang Shu  <cshu@webkit.org>
    217
  • trunk/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp

    r78842 r80145  
    4747}
    4848
    49 // PluginStrategy
     49CookiesStrategy* WebPlatformStrategies::createCookiesStrategy()
     50{
     51    return this;
     52}
    5053
    5154PluginStrategy* WebPlatformStrategies::createPluginStrategy()
     
    6265{
    6366    return this;
     67}
     68
     69void WebPlatformStrategies::notifyCookiesChanged()
     70{
    6471}
    6572
  • trunk/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.h

    r78842 r80145  
    2727#define WebPlatformStrategies_h
    2828
     29#include <WebCore/CookiesStrategy.h>
    2930#include <WebCore/LocalizationStrategy.h>
    3031#include <WebCore/PlatformStrategies.h>
     
    3233#include <WebCore/VisitedLinkStrategy.h>
    3334
    34 class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
     35class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
    3536public:
    3637    static void initialize();
     
    4041   
    4142    // WebCore::PlatformStrategies
     43    virtual WebCore::CookiesStrategy* createCookiesStrategy();
    4244    virtual WebCore::PluginStrategy* createPluginStrategy();
    4345    virtual WebCore::LocalizationStrategy* createLocalizationStrategy();
    4446    virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
     47
     48    // WebCore::CookiesStrategy
     49    virtual void notifyCookiesChanged();
    4550
    4651    // WebCore::PluginStrategy
  • trunk/Source/WebKit2/ChangeLog

    r80131 r80145  
     12011-03-01  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Adam Roben.
     4
     5        Part of WebKit2: Need a way to send notifications to client when cookies change
     6        https://bugs.webkit.org/show_bug.cgi?id=55427
     7        <rdar://problem/9056027>
     8
     9        * WebProcess/Cookies/WebCookieManager.cpp:
     10        (WebKit::WebCookieManager::dispatchDidModifyCookies): Add a stub with a FIXME to send a
     11            message to the UI process.
     12
     13        * WebProcess/Cookies/WebCookieManager.h:
     14        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
     15        (WebKit::WebPlatformStrategies::createCookiesStrategy):
     16        (WebKit::WebPlatformStrategies::notifyCookiesChanged): Call WebCookieManager::dispatchDidModifyCookies.
     17        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
     18
    1192011-03-02  Andras Becsi  <abecsi@webkit.org>
    220
  • trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp

    r79722 r80145  
    2828
    2929#include "MessageID.h"
    30 #include "SecurityOriginData.h"
    3130#include "WebCookieManagerProxyMessages.h"
    3231#include "WebProcess.h"
    3332#include <WebCore/CookieJar.h>
     33#include <WebCore/CookieStorage.h>
    3434#include <WebCore/NotImplemented.h>
    35 #include <WebCore/SecurityOrigin.h>
    36 #include <WebCore/SecurityOriginHash.h>
    3735
    3836using namespace WebCore;
     
    7775}
    7876
     77void WebCookieManager::dispatchDidModifyCookies()
     78{
     79    // FIXME <http://webkit.org/b/55427>: Send a message to the UIProcess that the cookies have changed.
     80}
     81
    7982} // namespace WebKit
  • trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h

    r79585 r80145  
    3838namespace WebKit {
    3939
    40 struct SecurityOriginData;
    41 
    4240class WebCookieManager {
    4341    WTF_MAKE_NONCOPYABLE(WebCookieManager);
     
    4644
    4745    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
     46   
     47    void dispatchDidModifyCookies();
    4848
    4949private:
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

    r80014 r80145  
    3131#include "PluginInfoStore.h"
    3232#include "WebContextMessages.h"
     33#include "WebCookieManager.h"
    3334#include "WebCoreArgumentCoders.h"
    3435#include "WebProcess.h"
     
    99100}
    100101
    101 // PluginStrategy
     102CookiesStrategy* WebPlatformStrategies::createCookiesStrategy()
     103{
     104    return this;
     105}
    102106
    103107PluginStrategy* WebPlatformStrategies::createPluginStrategy()
     
    114118{
    115119    return this;
     120}
     121
     122// CookiesStrategy
     123
     124void WebPlatformStrategies::notifyCookiesChanged()
     125{
     126    WebCookieManager::shared().dispatchDidModifyCookies();
    116127}
    117128
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h

    r78842 r80145  
    2929#if USE(PLATFORM_STRATEGIES)
    3030
     31#include <WebCore/CookiesStrategy.h>
    3132#include <WebCore/PlatformStrategies.h>
    3233#include <WebCore/PluginStrategy.h>
     
    3637namespace WebKit {
    3738
    38 class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
     39class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
    3940public:
    4041    static void initialize();
     
    4445   
    4546    // WebCore::PlatformStrategies
     47    virtual WebCore::CookiesStrategy* createCookiesStrategy();
    4648    virtual WebCore::PluginStrategy* createPluginStrategy();
    4749    virtual WebCore::LocalizationStrategy* createLocalizationStrategy();
    4850    virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
     51
     52    // WebCore::CookiesStrategy
     53    virtual void notifyCookiesChanged();
    4954
    5055    // WebCore::PluginStrategy
Note: See TracChangeset for help on using the changeset viewer.