Bug 144820 - [Mac] Share cookie storage between UI process and secondary processes
Summary: [Mac] Share cookie storage between UI process and secondary processes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-05-08 17:06 PDT by Alexey Proskuryakov
Modified: 2018-05-22 15:53 PDT (History)
1 user (show)

See Also:


Attachments
proposed patch (20.37 KB, patch)
2015-05-11 16:10 PDT, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
proposed patch (21.37 KB, patch)
2015-05-11 16:27 PDT, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
more iOS build fix (21.53 KB, patch)
2015-05-12 10:27 PDT, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2015-05-08 17:06:37 PDT
When UI process uses a custom cookie storage location, WebProcess and NetworkProcess don't pick it up.

rdar://problem/20734401
Comment 1 Alexey Proskuryakov 2015-05-11 16:10:31 PDT
Created attachment 252904 [details]
proposed patch
Comment 2 WebKit Commit Bot 2015-05-11 16:12:59 PDT
Attachment 252904 [details] did not pass style-queue:


ERROR: Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp:114:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebKit2/Shared/WebProcessCreationParameters.cpp:191:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/platform/network/mac/CookieJarMac.mm:29:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 3 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Alexey Proskuryakov 2015-05-11 16:27:11 PDT
Created attachment 252905 [details]
proposed patch

With iOS build fix.
Comment 4 WebKit Commit Bot 2015-05-11 16:29:35 PDT
Attachment 252905 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/network/mac/CookieJarMac.mm:29:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Alexey Proskuryakov 2015-05-12 10:27:05 PDT
Created attachment 252971 [details]
more iOS build fix
Comment 6 WebKit Commit Bot 2015-05-12 10:28:53 PDT
Attachment 252971 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/network/mac/CookieJarMac.mm:29:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Darin Adler 2015-05-12 10:31:14 PDT
Comment on attachment 252971 [details]
more iOS build fix

View in context: https://bugs.webkit.org/attachment.cgi?id=252971&action=review

> Source/WebKit2/Shared/WebProcessCreationParameters.cpp:186
> +    if (!decoder.decode(result.cookieStorageDirectory))

This says "result" but should say "parameters".

> Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm:158
> +#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
> +    if ([NSHTTPCookieStorage respondsToSelector:@selector(_setSharedHTTPCookieStorage:)]) {
> +        RetainPtr<CFDataRef> cookieStorageData = adoptCF(CFDataCreate(kCFAllocatorDefault, parameters.uiProcessCookieStorageIdentifier.data(), parameters.uiProcessCookieStorageIdentifier.size()));
> +        RetainPtr<CFHTTPCookieStorageRef> uiProcessCookieStorage = adoptCF(CFHTTPCookieStorageCreateFromIdentifyingData(kCFAllocatorDefault, cookieStorageData.get()));
> +        [NSHTTPCookieStorage _setSharedHTTPCookieStorage:adoptNS([[NSHTTPCookieStorage alloc] _initWithCFHTTPCookieStorage:uiProcessCookieStorage.get()]).get()];
> +    }
> +#endif

Can we avoid having two copies of this code?
Comment 8 Alexey Proskuryakov 2015-05-12 12:39:34 PDT
Committed with the proposed changes in <http://trac.webkit.org/r184211> (and then I noticed that iOS EWS is still red!)
Comment 9 Alexey Proskuryakov 2015-05-12 12:43:47 PDT
iOS build fix in r184212.