Changeset 80263 in webkit
- Timestamp:
- Mar 3, 2011 11:16:18 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r80260 r80263 1 2011-03-02 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Rest 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 to be exported. 10 11 * WebCore.exp.in: 12 1 13 2011-03-03 Anders Carlsson <andersca@apple.com> 2 14 -
trunk/Source/WebCore/WebCore.exp.in
r80200 r80263 579 579 __ZN7WebCore26contextMenuItemTagFontMenuEv 580 580 __ZN7WebCore26contextMenuItemTagOpenLinkEv 581 __ZN7WebCore26stopObservingCookieChangesEv 581 582 __ZN7WebCore26usesTestModeFocusRingColorEv 582 583 __ZN7WebCore27AuthenticationChallengeBaseC2Ev … … 588 589 __ZN7WebCore27contextMenuItemTagShowFontsEv 589 590 __ZN7WebCore27contextMenuItemTagUnderlineEv 591 __ZN7WebCore27startObservingCookieChangesEv 590 592 __ZN7WebCore28contextMenuItemTagCapitalizeEv 591 593 __ZN7WebCore28contextMenuItemTagShowColorsEv -
trunk/Source/WebKit2/ChangeLog
r80261 r80263 1 2011-03-02 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Rest 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 This patch adds the communication from the WebProcess <-> UIProcess about starting/stopping 10 listening for cookies changing, and adds a mechanism for the WebProcess to notify the UIProcess 11 when the cookies have changed. The WebProcess sends a message to the UIProcess when the cookies 12 change, and the UIProcess passes this along to the WebCookieManagerProxyClient. 13 14 * UIProcess/API/C/WKCookieManager.cpp: 15 (WKCookieManagerSetClient): Call through to WebCookieManagerProxy. 16 (WKCookieManagerStartObservingCookieChanges): Ditto. 17 (WKCookieManagerStopObservingCookieChanges): Ditto. 18 19 * UIProcess/API/C/WKCookieManager.h: Add new functions and a WKCookieManagerClient 20 which is responsible for cookiesDidChange. 21 22 * UIProcess/WebCookieManagerProxy.cpp: 23 (WebKit::WebCookieManagerProxy::initializeClient): 24 (WebKit::WebCookieManagerProxy::startObservingCookieChanges): Send the message down to the web process. 25 (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Ditto. 26 (WebKit::WebCookieManagerProxy::cookiesDidChange): Tell the WKCookieManagerClient the cookies were 27 modified. 28 * UIProcess/WebCookieManagerProxy.h: 29 * UIProcess/WebCookieManagerProxy.messages.in: Add new messages. 30 31 * UIProcess/WebCookieManagerProxyClient.cpp: Added. 32 (WebKit::WebCookieManagerProxyClient::cookiesDidChange): Calls through to the client saying that 33 cookies changed. 34 * UIProcess/WebCookieManagerProxyClient.h: Added. 35 36 * WebProcess/Cookies/WebCookieManager.cpp: 37 (WebKit::WebCookieManager::startObservingCookieChanges): Call through to WebCore::startObservingCookieChanges 38 (on platforms that support it). 39 (WebKit::WebCookieManager::stopObservingCookieChanges): Ditto (for stopObservingCookieChanges). 40 (WebKit::WebCookieManager::dispatchDidModifyCookies): Send a message to the UI process that cookies changed. 41 * WebProcess/Cookies/WebCookieManager.h: 42 * WebProcess/Cookies/WebCookieManager.messages.in: 43 44 Add new files. 45 * WebKit2.pro: 46 * WebKit2.xcodeproj/project.pbxproj: 47 * GNUmakefile.am: 48 * win/WebKit2.vcproj: 49 1 50 2011-03-03 Anders Carlsson <andersca@apple.com> 2 51 -
trunk/Source/WebKit2/GNUmakefile.am
r79711 r80263 417 417 Source/WebKit2/UIProcess/WebCookieManagerProxy.h \ 418 418 Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp \ 419 Source/WebKit2/UIProcess/WebCookieManagerProxyClient.cpp \ 420 Source/WebKit2/UIProcess/WebCookieManagerProxyClient.h \ 419 421 Source/WebKit2/UIProcess/WebDatabaseManagerProxyClient.cpp \ 420 422 Source/WebKit2/UIProcess/WebDatabaseManagerProxyClient.h \ -
trunk/Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp
r79585 r80263 37 37 } 38 38 39 void WKCookieManagerSetClient(WKCookieManagerRef cookieManagerRef, const WKCookieManagerClient* wkClient) 40 { 41 if (wkClient && wkClient->version) 42 return; 43 toImpl(cookieManagerRef)->initializeClient(wkClient); 44 } 45 39 46 void WKCookieManagerGetHostnamesWithCookies(WKCookieManagerRef cookieManagerRef, void* context, WKCookieManagerGetCookieHostnamesFunction callback) 40 47 { … … 51 58 toImpl(cookieManagerRef)->deleteAllCookies(); 52 59 } 60 61 void WKCookieManagerStartObservingCookieChanges(WKCookieManagerRef cookieManager) 62 { 63 toImpl(cookieManager)->startObservingCookieChanges(); 64 } 65 66 void WKCookieManagerStopObservingCookieChanges(WKCookieManagerRef cookieManager) 67 { 68 toImpl(cookieManager)->stopObservingCookieChanges(); 69 } -
trunk/Source/WebKit2/UIProcess/API/C/WKCookieManager.h
r79585 r80263 33 33 #endif 34 34 35 // Cookie Manager Client 36 typedef void (*WKCookieManagerCookiesDidChangeCallback)(WKCookieManagerRef cookieManager, const void *clientInfo); 37 38 struct WKCookieManagerClient { 39 int version; 40 const void * clientInfo; 41 WKCookieManagerCookiesDidChangeCallback cookiesDidChange; 42 }; 43 typedef struct WKCookieManagerClient WKCookieManagerClient; 44 35 45 WK_EXPORT WKTypeID WKCookieManagerGetTypeID(); 46 47 WK_EXPORT void WKCookieManagerSetClient(WKCookieManagerRef cookieManager, const WKCookieManagerClient* client); 36 48 37 49 typedef void (*WKCookieManagerGetCookieHostnamesFunction)(WKArrayRef, WKErrorRef, void*); … … 41 53 WK_EXPORT void WKCookieManagerDeleteAllCookies(WKCookieManagerRef cookieManager); 42 54 55 WK_EXPORT void WKCookieManagerStartObservingCookieChanges(WKCookieManagerRef cookieManager); 56 WK_EXPORT void WKCookieManagerStopObservingCookieChanges(WKCookieManagerRef cookieManager); 57 43 58 #ifdef __cplusplus 44 59 } -
trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
r79585 r80263 51 51 { 52 52 invalidateCallbackMap(m_arrayCallbacks); 53 } 54 55 void WebCookieManagerProxy::initializeClient(const WKCookieManagerClient* client) 56 { 57 m_client.initialize(client); 53 58 } 54 59 … … 106 111 } 107 112 113 void WebCookieManagerProxy::startObservingCookieChanges() 114 { 115 ASSERT(m_webContext); 116 if (!m_webContext->hasValidProcess()) 117 return; 118 m_webContext->process()->send(Messages::WebCookieManager::StartObservingCookieChanges(), 0); 119 } 120 121 void WebCookieManagerProxy::stopObservingCookieChanges() 122 { 123 ASSERT(m_webContext); 124 if (!m_webContext->hasValidProcess()) 125 return; 126 m_webContext->process()->send(Messages::WebCookieManager::StopObservingCookieChanges(), 0); 127 } 128 129 void WebCookieManagerProxy::cookiesDidChange() 130 { 131 m_client.cookiesDidChange(this); 132 } 133 108 134 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.h
r79585 r80263 30 30 #include "GenericCallback.h" 31 31 #include "ImmutableArray.h" 32 #include "WebCookieManagerProxyClient.h" 32 33 #include <wtf/PassRefPtr.h> 33 34 #include <wtf/RefPtr.h> … … 55 56 void invalidate(); 56 57 void clearContext() { m_webContext = 0; } 58 59 void initializeClient(const WKCookieManagerClient*); 57 60 58 61 void getHostnamesWithCookies(PassRefPtr<ArrayCallback>); 59 62 void deleteCookiesForHostname(const String& hostname); 60 63 void deleteAllCookies(); 64 65 void startObservingCookieChanges(); 66 void stopObservingCookieChanges(); 61 67 62 68 void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); … … 68 74 69 75 void didGetHostnamesWithCookies(const Vector<String>&, uint64_t callbackID); 76 77 void cookiesDidChange(); 70 78 71 79 void didReceiveWebCookieManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); … … 73 81 WebContext* m_webContext; 74 82 HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks; 83 84 WebCookieManagerProxyClient m_client; 75 85 }; 76 86 -
trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.messages.in
r79585 r80263 23 23 messages -> WebCookieManagerProxy { 24 24 DidGetHostnamesWithCookies(Vector<WTF::String> hostnames, uint64_t callbackID); 25 26 CookiesDidChange() 25 27 } -
trunk/Source/WebKit2/WebKit2.pro
r79999 r80263 169 169 UIProcess/WebContextUserMessageCoders.h \ 170 170 UIProcess/WebCookieManagerProxy.h \ 171 UIProcess/WebCookieManagerProxyClient.h \ 171 172 UIProcess/WebDatabaseManagerProxy.h \ 172 173 UIProcess/WebDatabaseManagerProxyClient.h \ … … 346 347 UIProcess/WebContextMenuProxy.cpp \ 347 348 UIProcess/WebCookieManagerProxy.cpp \ 349 UIProcess/WebCookieManagerProxyClient.cpp \ 348 350 UIProcess/WebDatabaseManagerProxy.cpp \ 349 351 UIProcess/WebDatabaseManagerProxyClient.cpp \ -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r80080 r80263 262 262 33367657130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33367653130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp */; }; 263 263 33367658130C9ECB006C9DE2 /* WebResourceCacheManagerProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 33367654130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessages.h */; }; 264 33AA1066131F060000D4A575 /* WebCookieManagerProxyClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33AA1064131F060000D4A575 /* WebCookieManagerProxyClient.cpp */; }; 265 33AA1067131F060000D4A575 /* WebCookieManagerProxyClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 33AA1065131F060000D4A575 /* WebCookieManagerProxyClient.h */; }; 264 266 33F9D5B91312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33F9D5B81312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp */; }; 265 267 37C4E9F6131C6E7E0029BD5A /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = B396EA5512E0ED2D00F4FEB7 /* config.h */; }; … … 1081 1083 33367653130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebResourceCacheManagerProxyMessageReceiver.cpp; sourceTree = "<group>"; }; 1082 1084 33367654130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceCacheManagerProxyMessages.h; sourceTree = "<group>"; }; 1085 33AA1064131F060000D4A575 /* WebCookieManagerProxyClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCookieManagerProxyClient.cpp; sourceTree = "<group>"; }; 1086 33AA1065131F060000D4A575 /* WebCookieManagerProxyClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCookieManagerProxyClient.h; sourceTree = "<group>"; }; 1083 1087 33F9D5B81312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = WebResourceCacheManagerCFNet.cpp; path = ResourceCache/cf/WebResourceCacheManagerCFNet.cpp; sourceTree = "<group>"; }; 1084 1088 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFindOptions.h; sourceTree = "<group>"; }; … … 2352 2356 330934531315B9750097A7BC /* WebCookieManagerProxy.h */, 2353 2357 330934541315B9750097A7BC /* WebCookieManagerProxy.messages.in */, 2358 33AA1064131F060000D4A575 /* WebCookieManagerProxyClient.cpp */, 2359 33AA1065131F060000D4A575 /* WebCookieManagerProxyClient.h */, 2354 2360 F62A765912B1ABC30005F1B6 /* WebDatabaseManagerProxy.cpp */, 2355 2361 F62A765A12B1ABC30005F1B6 /* WebDatabaseManagerProxy.h */, … … 3384 3390 BCE81D99131AE02100241910 /* DictionaryPopupInfo.h in Headers */, 3385 3391 37C4E9F6131C6E7E0029BD5A /* config.h in Headers */, 3392 33AA1067131F060000D4A575 /* WebCookieManagerProxyClient.h in Headers */, 3386 3393 ); 3387 3394 runOnlyForDeploymentPostprocessing = 0; … … 3961 3968 BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */, 3962 3969 BCE81D98131AE02100241910 /* DictionaryPopupInfo.cpp in Sources */, 3970 33AA1066131F060000D4A575 /* WebCookieManagerProxyClient.cpp in Sources */, 3963 3971 ); 3964 3972 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp
r80145 r80263 75 75 } 76 76 77 void WebCookieManager:: dispatchDidModifyCookies()77 void WebCookieManager::startObservingCookieChanges() 78 78 { 79 // FIXME <http://webkit.org/b/55427>: Send a message to the UIProcess that the cookies have changed. 79 #if USE(CFNETWORK) || PLATFORM(MAC) 80 WebCore::startObservingCookieChanges(); 81 #endif 82 } 83 84 void WebCookieManager::stopObservingCookieChanges() 85 { 86 #if USE(CFNETWORK) || PLATFORM(MAC) 87 WebCore::stopObservingCookieChanges(); 88 #endif 89 } 90 91 void WebCookieManager::dispatchCookiesDidChange() 92 { 93 WebProcess::shared().connection()->send(Messages::WebCookieManagerProxy::CookiesDidChange(), 0); 80 94 } 81 95 -
trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.h
r80145 r80263 45 45 void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); 46 46 47 void dispatch DidModifyCookies();47 void dispatchCookiesDidChange(); 48 48 49 49 private: … … 54 54 void deleteAllCookies(); 55 55 56 void startObservingCookieChanges(); 57 void stopObservingCookieChanges(); 58 56 59 void didReceiveWebCookieManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*); 57 60 }; -
trunk/Source/WebKit2/WebProcess/Cookies/WebCookieManager.messages.in
r79585 r80263 28 28 void DeleteCookiesForHostname(WTF::String hostname) 29 29 void DeleteAllCookies() 30 31 void StartObservingCookieChanges() 32 void StopObservingCookieChanges() 30 33 } -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
r80145 r80263 124 124 void WebPlatformStrategies::notifyCookiesChanged() 125 125 { 126 WebCookieManager::shared().dispatch DidModifyCookies();126 WebCookieManager::shared().dispatchCookiesDidChange(); 127 127 } 128 128 -
trunk/Source/WebKit2/win/WebKit2.vcproj
r80240 r80263 2420 2420 </File> 2421 2421 <File 2422 RelativePath="..\UIProcess\WebCookieManagerProxyClient.cpp" 2423 > 2424 </File> 2425 <File 2426 RelativePath="..\UIProcess\WebCookieManagerProxyClient.h" 2427 > 2428 </File> 2429 <File 2422 2430 RelativePath="..\UIProcess\WebDatabaseManagerProxy.cpp" 2423 2431 >
Note: See TracChangeset
for help on using the changeset viewer.