Bug 118520

Summary: Move PlatformCertificateInfo to WebCore and make the ResourceResponse primitives work in terms of that platform agnostic object
Product: WebKit Reporter: Kwang Yul Seo <skyul>
Component: PlatformAssignee: Kwang Yul Seo <skyul>
Status: REOPENED ---    
Severity: Normal CC: abecsi, aestes, andersca, ap, bdakin, beidson, benjamin, brian.holt, buildbot, cdumez, cgarcia, cmarcelo, commit-queue, danw, darin, eflews.bot, enrica, gns, gtk-ews, gyuyoung.kim, hyatt, kbalazs, kling, menard, mitz, mjs, mrobinson, ossy, rakuco, rniwa, ryuan.choi, sam, svillar, thorton, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 124724, 122825, 124150, 124720    
Bug Blocks: 108832, 110141, 120160    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
buildbot: commit-queue-
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
patch for attachment213874
none
Patch
none
Patch none

Description Kwang Yul Seo 2013-07-09 17:37:55 PDT
Avoid using CF specific types in ResourceResponse by moving PlatformCertificateInfo to WebCore.
Comment 1 Sam Weinig 2013-07-10 17:24:59 PDT
Sounds reasonable to me.
Comment 2 Kwang Yul Seo 2013-07-11 05:54:39 PDT
Created attachment 206453 [details]
Patch
Comment 3 Kwang Yul Seo 2013-07-11 06:02:53 PDT
Created attachment 206454 [details]
Patch
Comment 4 Kwang Yul Seo 2013-07-11 06:13:33 PDT
(In reply to comment #3)
> Created an attachment (id=206454) [details]
> Patch

I am not sure why patch does not apply because I rebased the patch up to the HEAD before uploading.

This is a preparation for https://bugs.webkit.org/show_bug.cgi?id=110141#c11
Comment 5 Kwang Yul Seo 2013-07-11 18:29:44 PDT
Created attachment 206500 [details]
Patch
Comment 6 Kwang Yul Seo 2013-07-11 18:30:09 PDT
(In reply to comment #5)
> Created an attachment (id=206500) [details]
> Patch

Qt build fix.
Comment 7 Kwang Yul Seo 2013-07-11 23:26:33 PDT
Created attachment 206507 [details]
Patch
Comment 8 WebKit Commit Bot 2013-07-11 23:27:18 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 9 WebKit Commit Bot 2013-07-11 23:27:39 PDT
Attachment 206507 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/GNUmakefile.list.am', u'Source/WebCore/PlatformEfl.cmake', u'Source/WebCore/Target.pri', u'Source/WebCore/WebCore.exp.in', u'Source/WebCore/WebCore.vcxproj/WebCore.vcxproj', u'Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters', u'Source/WebCore/WebCore.xcodeproj/project.pbxproj', u'Source/WebCore/platform/network/PlatformCertificateInfo.h', u'Source/WebCore/platform/network/ResourceErrorBase.h', u'Source/WebCore/platform/network/ResourceResponseBase.h', u'Source/WebCore/platform/network/cf/ResourceResponse.h', u'Source/WebCore/platform/network/mac/PlatformCertificateInfoMac.mm', u'Source/WebCore/platform/network/mac/ResourceResponseMac.mm', u'Source/WebCore/platform/network/qt/PlatformCertificateInfoQt.cpp', u'Source/WebCore/platform/network/soup/PlatformCertificateInfoSoup.cpp', u'Source/WebCore/platform/network/soup/ResourceError.h', u'Source/WebCore/platform/network/soup/ResourceErrorSoup.cpp', u'Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp', u'Source/WebCore/platform/network/soup/ResourceResponse.h', u'Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/GNUmakefile.list.am', u'Source/WebKit2/NetworkProcess/NetworkProcess.h', u'Source/WebKit2/NetworkProcess/NetworkProcess.messages.in', u'Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp', u'Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm', u'Source/WebKit2/PlatformEfl.cmake', u'Source/WebKit2/PlatformGTK.cmake', u'Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm', u'Source/WebKit2/Shared/Authentication/AuthenticationManager.h', u'Source/WebKit2/Shared/Authentication/AuthenticationManager.messages.in', u'Source/WebKit2/Shared/Authentication/mac/AuthenticationManager.mac.mm', u'Source/WebKit2/Shared/UserMessageCoders.h', u'Source/WebKit2/Shared/WebCertificateInfo.h', u'Source/WebKit2/Shared/WebCoreArgumentCoders.cpp', u'Source/WebKit2/Shared/WebCoreArgumentCoders.h', u'Source/WebKit2/Shared/mac/PlatformCertificateInfo.h', u'Source/WebKit2/Shared/mac/PlatformCertificateInfo.mm', u'Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm', u'Source/WebKit2/Shared/qt/PlatformCertificateInfo.h', u'Source/WebKit2/Shared/qt/WebCoreArgumentCodersQt.cpp', u'Source/WebKit2/Shared/soup/PlatformCertificateInfo.cpp', u'Source/WebKit2/Shared/soup/PlatformCertificateInfo.h', u'Source/WebKit2/Shared/soup/WebCoreArgumentCodersSoup.cpp', u'Source/WebKit2/Target.pri', u'Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp', u'Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp', u'Source/WebKit2/UIProcess/WebFrameProxy.cpp', u'Source/WebKit2/UIProcess/WebFrameProxy.h', u'Source/WebKit2/UIProcess/WebPageProxy.h', u'Source/WebKit2/UIProcess/WebPageProxy.messages.in', u'Source/WebKit2/WebKit2.xcodeproj/project.pbxproj', u'Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp', u'Source/WebKit2/WebProcess/Network/WebResourceLoader.h', u'Source/WebKit2/WebProcess/Network/WebResourceLoader.messages.in', u'Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp']" exit_code: 1
Source/WebKit2/Shared/soup/WebCoreArgumentCodersSoup.cpp:111:  Use 0 instead of NULL.  [readability/null] [5]
Source/WebKit2/Shared/soup/WebCoreArgumentCodersSoup.cpp:111:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 46 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Kwang Yul Seo 2013-07-11 23:27:51 PDT
Build fix for Mac Debug.
Comment 11 Brady Eidson 2013-07-17 09:31:48 PDT
The reason I haven't gotten to reviewing this yet is because it's very large and will require a block of time I don't have.
Comment 12 Kwang Yul Seo 2013-07-17 23:41:02 PDT
(In reply to comment #11)
> The reason I haven't gotten to reviewing this yet is because it's very large and will require a block of time I don't have.

Okay. Please take your time.
Comment 13 Csaba Osztrogonác 2013-08-26 04:35:21 PDT
Created attachment 209637 [details]
Patch

Updated to ToT - r154595
Comment 14 Csaba Osztrogonác 2013-08-26 04:41:14 PDT
(In reply to comment #13)
> Created an attachment (id=209637) [details]
> Patch
> 
> Updated to ToT - r154595

Short summary:
- trivial conflicts resolved in WebCore.exp.in, project.pbxproj, NetworkResourceLoader.cpp, WebPageProxy.h and WebFrameLoaderClient.cpp
- trivial fix in the new AsynchronousNetworkLoaderClient.cpp
- style fixed (NULL -> 0 and smaller indentation in WebCoreArgumentCodersSoup.cpp)
- obsolete change removed from NetworkResourceLoader.cpp
- unneeded typo removed from ResourceHandleSoup.cpp
Comment 15 Build Bot 2013-08-26 05:02:43 PDT
Comment on attachment 209637 [details]
Patch

Attachment 209637 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/1559859
Comment 16 EFL EWS Bot 2013-08-26 05:11:35 PDT
Comment on attachment 209637 [details]
Patch

Attachment 209637 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/1571082
Comment 17 Csaba Osztrogonác 2013-08-26 05:14:05 PDT
Comment on attachment 209637 [details]
Patch

fixing the build
Comment 18 Csaba Osztrogonác 2013-08-26 05:22:01 PDT
Created attachment 209640 [details]
Patch

Additional Mac and Soup buildfixes
Comment 19 Build Bot 2013-08-27 03:38:14 PDT
Comment on attachment 209640 [details]
Patch

Attachment 209640 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/1586234
Comment 20 Csaba Osztrogonác 2013-08-27 04:45:40 PDT
Created attachment 209746 [details]
Patch

Fixed the if guard of including RetainPtr.h in PlatformCertificateInfo.h to make Windows build happy.
Comment 21 Build Bot 2013-08-27 07:08:45 PDT
Comment on attachment 209746 [details]
Patch

Attachment 209746 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/1583287
Comment 22 Csaba Osztrogonác 2013-09-03 03:18:36 PDT
Created attachment 210347 [details]
Patch

patch for Win EWS, try to add PlatformCertificateInfoCFNet.cpp with empty constructor and destructor to make the build happy.
Comment 23 Balazs Kelemen 2013-09-11 08:39:52 PDT
Comment on attachment 210347 [details]
Patch

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

> Source/WebCore/ChangeLog:1
> +2013-09-03  Kwang Yul Seo  <skyul@company100.net>

If this has been co-authored you should indicate it in the changelog header :)

> Source/WebCore/platform/network/ResourceErrorBase.h:96
> +    PlatformCertificateInfo m_platformCertificateInfo;

I think you it should be added to ResourceError, not ResourceErrorBase.

> Source/WebCore/platform/network/ResourceResponseBase.h:159
> +    PlatformCertificateInfo m_platformCertificateInfo;

Same thing for ResourceResponse.
Comment 24 Csaba Osztrogonác 2013-09-26 07:14:39 PDT
Created attachment 212703 [details]
Patch
Comment 25 Csaba Osztrogonác 2013-09-26 07:24:09 PDT
(In reply to comment #23)
> (From update of attachment 210347 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=210347&action=review
> 
> > Source/WebCore/ChangeLog:1
> > +2013-09-03  Kwang Yul Seo  <skyul@company100.net>
> 
> If this has been co-authored you should indicate it in the changelog header :)

It hasn't been really co-authored. Almost the full patch is the work of
Kwang Yul Seo, I only fixed minor things. But you are right, I mentioned
everything in the changelogs.
 
> > Source/WebCore/platform/network/ResourceErrorBase.h:96
> > +    PlatformCertificateInfo m_platformCertificateInfo;
> 
> I think you it should be added to ResourceError, not ResourceErrorBase.

I don't think if it is a good idea, m_platformCertificateInfo is used
by platformCertificateInfo() and setPlatformCertificateInfo() in the
same header. Why should we add this cross platform implementation
to the 6 subclasses of ResourceErrorBase with copy/pasting instead
of leaving it in the ResourceErrorBase?
 
> > Source/WebCore/platform/network/ResourceResponseBase.h:159
> > +    PlatformCertificateInfo m_platformCertificateInfo;
> 
> Same thing for ResourceResponse.

Ditto.
Comment 26 Csaba Osztrogonác 2013-09-26 07:30:50 PDT
Could you review this 2.5 months old patch please? 
(Rebasing this huge patch to ToT again and again is a little bit burdensome.)
Comment 27 Csaba Osztrogonác 2013-09-27 07:22:30 PDT
Created attachment 212804 [details]
Patch

updated to ToT: resolved a trivial conflict
Comment 28 Csaba Osztrogonác 2013-09-30 00:37:02 PDT
Created attachment 212957 [details]
Patch

rename KURL to URL after r156550
Comment 29 Build Bot 2013-09-30 13:52:55 PDT
Comment on attachment 212957 [details]
Patch

Attachment 212957 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/2613628
Comment 30 Csaba Osztrogonác 2013-09-30 14:33:27 PDT
Created attachment 213036 [details]
Patch
Comment 31 Carlos Garcia Campos 2013-09-30 23:54:12 PDT
Comment on attachment 213036 [details]
Patch

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

soup changes look good to me, except for the few comments below. r- just because of the SoupMessageFlags initialization removal in ResourceResponse.

> Source/WebCore/platform/network/PlatformCertificateInfo.h:35
> +#include <wtf/gobject/GRefPtr.h>

We can probably include <gio/gio.h> since we are not using any libsoup API here.

> Source/WebCore/platform/network/PlatformCertificateInfo.h:40
> +class ResourceError;
> +class ResourceResponse;

These look unused here.

> Source/WebCore/platform/network/soup/PlatformCertificateInfoSoup.cpp:31
> +#include "ResourceError.h"
> +#include "ResourceResponse.h"

These are no longer needed either.

> Source/WebCore/platform/network/soup/PlatformCertificateInfoSoup.cpp:32
> +#include <libsoup/soup.h>

This is already included in PlatformCertificateInfo.h, I know this is also present in current code, though.

> Source/WebCore/platform/network/soup/ResourceResponse.h:-40
> -        , m_soupFlags(static_cast<SoupMessageFlags>(0))

You should keep the message flags initialization.

> Source/WebCore/platform/network/soup/ResourceResponse.h:-47
> -        , m_soupFlags(static_cast<SoupMessageFlags>(0))

Ditto.

> Source/WebCore/platform/network/soup/ResourceResponse.h:-54
> -        , m_soupFlags(static_cast<SoupMessageFlags>(0))

Ditto.
Comment 32 Csaba Osztrogonác 2013-10-04 06:47:12 PDT
Created attachment 213359 [details]
Patch

Patch for EWS. Removed Qt changes, added back initializers for m_soupFlags. I'll check other things mentioned in the review later.
Comment 33 Csaba Osztrogonác 2013-10-07 09:03:22 PDT
Created attachment 213595 [details]
Patch
Comment 34 Csaba Osztrogonác 2013-10-07 09:08:59 PDT
(In reply to comment #33)
> Created an attachment (id=213595) [details]
> Patch

I fixed everything mentioned in https://bugs.webkit.org/show_bug.cgi?id=118520#c31 .
Comment 35 Carlos Garcia Campos 2013-10-09 04:00:26 PDT
Comment on attachment 213595 [details]
Patch

soup changes look good to me, thanks ossy.
Comment 36 Csaba Osztrogonác 2013-10-09 04:03:41 PDT
(In reply to comment #35)
> (From update of attachment 213595 [details])
> soup changes look good to me, thanks ossy.

Can we get a sign-off from a WK2 owner, please?
Comment 37 Anders Carlsson 2013-10-09 12:12:58 PDT
Can’t this just be called CertificateInfo? I don’t think we should be using the Platform prefix for classes that are in the platform layer.
Comment 38 Csaba Osztrogonác 2013-10-10 03:20:35 PDT
(In reply to comment #37)
> Can’t this just be called CertificateInfo? I don’t think we should be using the Platform prefix for classes that are in the platform layer.

Of course I can rename PlatformCertificateInfo to CertificateInfo.

Have you got any other remark for this patch? Apart 
from this rename thing, does it look good for you?
Comment 39 Csaba Osztrogonác 2013-10-10 04:06:10 PDT
Created attachment 213867 [details]
Patch

patch for EWS with renaming
Comment 40 Csaba Osztrogonác 2013-10-10 04:08:02 PDT
Created attachment 213868 [details]
Patch

patch for EWS with renaming
Comment 41 EFL EWS Bot 2013-10-10 04:14:52 PDT
Comment on attachment 213868 [details]
Patch

Attachment 213868 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/3777052
Comment 42 EFL EWS Bot 2013-10-10 04:19:35 PDT
Comment on attachment 213868 [details]
Patch

Attachment 213868 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/3777053
Comment 43 kov's GTK+ EWS bot 2013-10-10 04:21:02 PDT
Comment on attachment 213868 [details]
Patch

Attachment 213868 [details] did not pass gtk-ews (gtk):
Output: http://webkit-queues.appspot.com/results/3400074
Comment 44 Csaba Osztrogonác 2013-10-10 04:27:19 PDT
Created attachment 213870 [details]
Patch
Comment 45 Csaba Osztrogonác 2013-10-10 04:29:45 PDT
Created attachment 213871 [details]
Patch
Comment 46 EFL EWS Bot 2013-10-10 04:35:44 PDT
Comment on attachment 213871 [details]
Patch

Attachment 213871 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/3776053
Comment 47 EFL EWS Bot 2013-10-10 04:37:24 PDT
Comment on attachment 213871 [details]
Patch

Attachment 213871 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/3779039
Comment 48 Csaba Osztrogonác 2013-10-10 04:39:38 PDT
Created attachment 213872 [details]
Patch
Comment 49 Build Bot 2013-10-10 05:21:05 PDT
Comment on attachment 213872 [details]
Patch

Attachment 213872 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/3721051
Comment 50 Csaba Osztrogonác 2013-10-10 05:29:46 PDT
Created attachment 213874 [details]
Patch
Comment 51 Csaba Osztrogonác 2013-10-10 06:54:13 PDT
Comment on attachment 213874 [details]
Patch

EWS bots are green (except the non working GTK-WK2), so marking it as r?
Comment 52 Csaba Osztrogonác 2013-10-10 06:55:18 PDT
Comment on attachment 213595 [details]
Patch

mark as obsolete based on comment #37
Comment 53 Csaba Osztrogonác 2013-10-10 06:57:11 PDT
(In reply to comment #37)
> Can’t this just be called CertificateInfo? I don’t think we should be using the Platform prefix for classes that are in the platform layer.

(In reply to comment #50)
> Created an attachment (id=213874) [details]
> Patch

I did the asked renaming. Is there anything else should I fix?
Comment 54 Carlos Garcia Campos 2013-10-10 10:05:10 PDT
(In reply to comment #51)
> (From update of attachment 213874 [details])
> EWS bots are green (except the non working GTK-WK2), so marking it as r?

Applied locally, I confirm it builds fine in gtk-wk2
Comment 55 Csaba Osztrogonác 2013-10-11 04:01:48 PDT
Anders or Brady, could you review it please?
Comment 56 Brady Eidson 2013-10-11 16:50:16 PDT
I honestly don't have time to meaningfully review a 100k patch that touches so many sites right now.
Comment 57 Anders Carlsson 2013-10-12 11:13:26 PDT
Comment on attachment 213874 [details]
Patch

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

> Source/WebCore/platform/network/CertificateInfo.h:67
> +    // Certificate chain is normally part of NS/CFURLResponse, but there is no way to re-add it to a deserialized response after IPC.

I don't think this comment makes any sense.

> Source/WebCore/platform/network/soup/ResourceError.h:60
> +    unsigned tlsErrors() const { return m_certificateInfo.tlsErrors(); }
> +    void setTLSErrors(unsigned tlsErrors) { m_certificateInfo.setTLSErrors(static_cast<GTlsCertificateFlags>(tlsErrors)); }
> +    GTlsCertificate* certificate() const { return m_certificateInfo.certificate(); }
> +    void setCertificate(GTlsCertificate* certificate) { m_certificateInfo.setCertificate(certificate); }

Can't we get rid of these and just use calls on m_certificateInfo directly?

> Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm:36
> +    RefPtr<WebCertificateInfo> certificateInfo = WebCertificateInfo::create(WebCore::CertificateInfo(certificateChain));

Please add using directive for the WebCore namespace so you don't have to use the WebCore prefix here.

> Source/WebKit2/Shared/WebCoreArgumentCoders.cpp:564
> +

Extra newline.
Comment 58 Csaba Osztrogonác 2013-10-14 09:41:34 PDT
Comment on attachment 213874 [details]
Patch

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

>> Source/WebCore/platform/network/CertificateInfo.h:67
>> +    // Certificate chain is normally part of NS/CFURLResponse, but there is no way to re-add it to a deserialized response after IPC.
> 
> I don't think this comment makes any sense.

What is the problem with it? We didn't touch this code/comment. 
It was originally added by http://trac.webkit.org/changeset/138206

>> Source/WebCore/platform/network/soup/ResourceError.h:60
>> +    void setCertificate(GTlsCertificate* certificate) { m_certificateInfo.setCertificate(certificate); }
> 
> Can't we get rid of these and just use calls on m_certificateInfo directly?

Yes, we can. I'll do it before landing.

>> Source/WebKit2/Shared/API/c/mac/WKCertificateInfoMac.mm:36
>> +    RefPtr<WebCertificateInfo> certificateInfo = WebCertificateInfo::create(WebCore::CertificateInfo(certificateChain));
> 
> Please add using directive for the WebCore namespace so you don't have to use the WebCore prefix here.

OK.

>> Source/WebKit2/Shared/WebCoreArgumentCoders.cpp:564
>> +
> 
> Extra newline.

OK.
Comment 59 Csaba Osztrogonác 2013-10-14 09:45:03 PDT
Created attachment 214157 [details]
patch for attachment213874 [details]
Comment 60 Csaba Osztrogonác 2013-10-14 09:49:29 PDT
Created attachment 214158 [details]
Patch

patch for landing
Comment 61 Csaba Osztrogonác 2013-10-14 09:57:10 PDT
Comment on attachment 213874 [details]
Patch

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

>>> Source/WebCore/platform/network/soup/ResourceError.h:60
>>> +    void setCertificate(GTlsCertificate* certificate) { m_certificateInfo.setCertificate(certificate); }
>> 
>> Can't we get rid of these and just use calls on m_certificateInfo directly?
> 
> Yes, we can. I'll do it before landing.

Hmmmm, it seems we can't, because https://bugs.webkit.org/attachment.cgi?id=213881&action=review use these setters.
Comment 62 Csaba Osztrogonác 2013-10-14 10:10:04 PDT
Created attachment 214160 [details]
Patch

patch for landing
Comment 63 Carlos Garcia Campos 2013-10-14 23:56:01 PDT
(In reply to comment #61)
> (From update of attachment 213874 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=213874&action=review
> 
> >>> Source/WebCore/platform/network/soup/ResourceError.h:60
> >>> +    void setCertificate(GTlsCertificate* certificate) { m_certificateInfo.setCertificate(certificate); }
> >> 
> >> Can't we get rid of these and just use calls on m_certificateInfo directly?
> > 
> > Yes, we can. I'll do it before landing.
> 
> Hmmmm, it seems we can't, because https://bugs.webkit.org/attachment.cgi?id=213881&action=review use these setters.

That's not a problem, that patch will have to be reworked anyway since it also uses PlatformCertificateInfo instead of  CertificateInfo.
Comment 64 Csaba Osztrogonác 2013-10-15 03:23:02 PDT
Comment on attachment 214158 [details]
Patch

Clearing flags on attachment: 214158

Committed r157445: <http://trac.webkit.org/changeset/157445>
Comment 65 Csaba Osztrogonác 2013-10-15 03:24:45 PDT
(In reply to comment #64)
> (From update of attachment 214158 [details])
> Clearing flags on attachment: 214158
> 
> Committed r157445: <http://trac.webkit.org/changeset/157445>

Thanks, I landed the original patch which removed the functions
asked in https://bugs.webkit.org/show_bug.cgi?id=118520#c57.
Comment 66 WebKit Commit Bot 2013-10-15 03:38:56 PDT
Re-opened since this is blocked by bug 122825
Comment 67 Csaba Osztrogonác 2013-10-15 09:48:25 PDT
(In reply to comment #64)
> (From update of attachment 214158 [details])
> Clearing flags on attachment: 214158
> 
> Committed r157445: <http://trac.webkit.org/changeset/157445>

just for note: the necessary buildfixes landed in
- http://trac.webkit.org/changeset/157446
- http://trac.webkit.org/changeset/157447
Comment 68 Csaba Osztrogonác 2013-10-23 00:03:13 PDT
Reopen, because Anders reverted it with the following commit message:
http://trac.webkit.org/changeset/157842
Revert r157445 since it broke certificates on Mac.
<rdar://problem/15246926&15254017&15269117>

Sorry for the breakage. Anders, could you give us some hint about what happened?
I haven't seen any failures on the Apple buildbots after landing. "it broke
certificates on Mac." isn't enough for me to try to fix this regression.
Comment 69 Csaba Osztrogonác 2013-10-23 00:08:14 PDT
Otherwise do we _really_ need this monumental change?

Originally Balázs and Kwang suggested the following change in
https://bugs.webkit.org/show_bug.cgi?id=110141 :
diff --git a/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp b/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp
index 5357bbcf44004cd3a52477e5636d5ab72cd24cb6..603895660f599f486502039b84f4e40ffe686e0f 100644
--- a/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp
+++ b/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp
@@ -106,7 +106,9 @@ void WebResourceLoader::didReceiveResponseWithCertificateInfo(const ResourceResp
     RefPtr<WebResourceLoader> protector(this);
 
     ResourceResponse responseCopy(response);
+#if USE(CFNETWORK)
     responseCopy.setCertificateChain(certificateInfo.certificateChain());
+#endif
     m_coreLoader->didReceiveResponse(responseCopy);
 
     // If m_coreLoader becomes null as a result of the didReceiveResponse callback, we can't use the send function(). 


But Brady didn't want this oneliner and suggested this monunental one:
"I understand this is (currently) necessary because of code in WebCore, which is too bad.

We should push "PlatformCertificateInfo" to WebCore and make the ResourceRequest/Response primitives work in terms of that platform agnostic object instead of CF-specific types."
Comment 70 Csaba Osztrogonác 2013-10-23 00:13:18 PDT
EFL buildfix after the imperfect rollout - http://trac.webkit.org/changeset/157850 .
Comment 71 Csaba Osztrogonác 2013-10-23 00:14:47 PDT
and the GTK build is still broken because of the rollout, see https://bugs.webkit.org/show_bug.cgi?id=120160 for details.
Comment 72 Csaba Osztrogonác 2013-10-23 00:23:47 PDT
Otherwise rolling out the patch without any notification on IRC and/or comment in this bug (with Apple only radar link) was a little bit unfriendly. :(

Would you be so kind to notice the author before/after the rollout next time please? And please add more detailed infos how to reproduce the regression
caused. Thanks.
Comment 73 Carlos Garcia Campos 2013-10-23 01:54:03 PDT
(In reply to comment #69)
> We should push "PlatformCertificateInfo" to WebCore and make the ResourceRequest/Response primitives work in terms of that platform agnostic object instead of CF-specific types."

I still think this makes a lot of sense, we just need to know what's broken and try to fix it. Anders?
Comment 74 Csaba Osztrogonác 2013-10-24 06:47:09 PDT
Anders, would you be so kind to share with us what was the problem with the patch
you rolled out? It would be great to have any information to be able to fix the
mistake we made. Thanks.
Comment 75 Anders Carlsson 2013-11-11 06:50:05 PST
(In reply to comment #74)
> Anders, would you be so kind to share with us what was the problem with the patch
> you rolled out? It would be great to have any information to be able to fix the
> mistake we made. Thanks.

Oops, I thought I had done that.

The reason was that on the Mac port we didn't get any certificates so a lot of Safari features that depend on having correct certificate info broke.

I tried digging through the patch to fix the issue but couldn't due to its sheer size.

I think a good next step here is to do the rename + move to WebCore as a separate step (maybe even two steps, first rename and then move). Once that's done it's easier to re-review the remaning bits.
Comment 76 Csaba Osztrogonác 2013-11-21 10:20:52 PST
I split up the original patch into 3 bugs:
- Rename PlatformCertificateInfo to CertificateInfo (bug124150)
- Move CertificateInfo to WebCore (bug124720)
- Make the ResourceRequest/Response primitives work in terms of platform agnostic CertificateInfo object (bug124724)