RESOLVED FIXED 54683
WebKit2: The CFNetwork Cache should be shared between the UI Process and the Web Process on Windows
https://bugs.webkit.org/show_bug.cgi?id=54683
Summary WebKit2: The CFNetwork Cache should be shared between the UI Process and the ...
Jessie Berlin
Reported 2011-02-17 12:56:51 PST
There is already code to share the CFNetwork Cache between the UI Process and the Web Process on Mac. We should do the same on Windows. <rdar://problem/8882342>
Attachments
Patch (5.17 KB, patch)
2011-02-17 13:00 PST, Jessie Berlin
no flags
Jessie Berlin
Comment 1 2011-02-17 13:00:35 PST
Adam Roben (:aroben)
Comment 2 2011-02-17 13:03:52 PST
Comment on attachment 82852 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=82852&action=review > Source/WebKit2/ChangeLog:22 > + Add the parameters for the path to the cache, the disk capacity, and the memory capacity: > + * Shared/WebProcessCreationParameters.cpp: > + (WebKit::WebProcessCreationParameters::encode): > + (WebKit::WebProcessCreationParameters::decode): > + * Shared/WebProcessCreationParameters.h: > + > + * UIProcess/win/WebContextWin.cpp: > + (WebKit::WebContext::platformInitializeWebProcess): > + Make sure to remove the ending slash, as CFNetwork does not recognize the directory with > + that slash. > + > + * WebProcess/win/WebProcessWin.cpp: > + (WebKit::WebProcess::platformInitializeWebProcess): > + Create a cache using the path, disk capacity, and memory capacity and set it as default. Having some comments above the items they apply to and some below confuses me! > Source/WebKit2/Shared/WebProcessCreationParameters.cpp:72 > encoder->encode(shouldPaintNativeControls); > + encoder->encode(cfURLCachePath); > + encoder->encode(cfURLCacheMemoryCapacity); > + encoder->encode(cfURLCacheDiskCapacity); It would be nice to match the order in which these are declared in the struct. > Source/WebKit2/Shared/WebProcessCreationParameters.cpp:128 > if (!decoder->decode(parameters.shouldPaintNativeControls)) > return false; > + if (!decoder->decode(parameters.cfURLCachePath)) > + return false; > + if (!decoder->decode(parameters.cfURLCacheMemoryCapacity)) > + return false; > + if (!decoder->decode(parameters.cfURLCacheDiskCapacity)) > + return false; Ditto. > Source/WebKit2/UIProcess/win/WebContextWin.cpp:64 > + parameters.cfURLCachePath = wkCopyFoundationCacheDirectory(); Presumably wkCopyFoundationCacheDirectory returns a CFStringRef, which you're leaking?
Jessie Berlin
Comment 3 2011-02-17 14:14:13 PST
(In reply to comment #2) > (From update of attachment 82852 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=82852&action=review > > > Source/WebKit2/ChangeLog:22 > > + Add the parameters for the path to the cache, the disk capacity, and the memory capacity: > > + * Shared/WebProcessCreationParameters.cpp: > > + (WebKit::WebProcessCreationParameters::encode): > > + (WebKit::WebProcessCreationParameters::decode): > > + * Shared/WebProcessCreationParameters.h: > > + > > + * UIProcess/win/WebContextWin.cpp: > > + (WebKit::WebContext::platformInitializeWebProcess): > > + Make sure to remove the ending slash, as CFNetwork does not recognize the directory with > > + that slash. > > + > > + * WebProcess/win/WebProcessWin.cpp: > > + (WebKit::WebProcess::platformInitializeWebProcess): > > + Create a cache using the path, disk capacity, and memory capacity and set it as default. > > Having some comments above the items they apply to and some below confuses me! Removed the comment above the items it applied to, since it was not really helpful anyways. > > > Source/WebKit2/Shared/WebProcessCreationParameters.cpp:72 > > encoder->encode(shouldPaintNativeControls); > > + encoder->encode(cfURLCachePath); > > + encoder->encode(cfURLCacheMemoryCapacity); > > + encoder->encode(cfURLCacheDiskCapacity); > > It would be nice to match the order in which these are declared in the struct. Done. > > > Source/WebKit2/Shared/WebProcessCreationParameters.cpp:128 > > if (!decoder->decode(parameters.shouldPaintNativeControls)) > > return false; > > + if (!decoder->decode(parameters.cfURLCachePath)) > > + return false; > > + if (!decoder->decode(parameters.cfURLCacheMemoryCapacity)) > > + return false; > > + if (!decoder->decode(parameters.cfURLCacheDiskCapacity)) > > + return false; > > Ditto. Done. > > > Source/WebKit2/UIProcess/win/WebContextWin.cpp:64 > > + parameters.cfURLCachePath = wkCopyFoundationCacheDirectory(); > > Presumably wkCopyFoundationCacheDirectory returns a CFStringRef, which you're leaking? Whoops! Fixed. Thanks for the review!
Jessie Berlin
Comment 4 2011-02-17 14:25:49 PST
Note You need to log in before you can comment on or make changes to this bug.