Bug 143150

Summary: [WK2][NetworkCache] Use PlatformFileHandle abstraction in cross-platform code
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED WONTFIX    
Severity: Normal CC: andersca, cgarcia, koivisto, mrobinson, svillar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch koivisto: review-, koivisto: commit-queue-

Chris Dumez
Reported 2015-03-27 13:51:27 PDT
Use PlatformFileHandle abstraction instead of int type for file descriptors in cross-platform code.
Attachments
Patch (4.15 KB, patch)
2015-03-27 14:16 PDT, Chris Dumez
koivisto: review-
koivisto: commit-queue-
Chris Dumez
Comment 1 2015-03-27 14:16:02 PDT
Anders Carlsson
Comment 2 2015-03-27 14:31:53 PDT
Why do we want to do this?
Chris Dumez
Comment 3 2015-03-27 14:35:21 PDT
(In reply to comment #2) > Why do we want to do this? Well, this is supposed to be cross-platform code. Not all platforms / ports use 'int' as type for file descriptors (for e.g. GTK uses GFileIOStream*). We already use the PlatformFileHandle abstraction for cross-platform code inside WebCore. Other ports may be interested in using the NetworkCache and having POSIX assumptions inside supposed-to-be cross-platform code is not going to help.
Chris Dumez
Comment 4 2015-03-27 14:37:06 PDT
Note that we already use the WebCore FileSystem abstraction in the NetworkCache because of this. That abstraction is dealing with PlatformFileHandle handles, not ints.
Antti Koivisto
Comment 5 2015-03-28 07:11:34 PDT
Comment on attachment 249606 [details] Patch It would be better if people making ports do something like this if they find it helpful. Are there any platforms that can't use unix style fd's these days? Note that the existing code doesn't use any PlatformFileHandle based abstractions, just the string ones.
Chris Dumez
Comment 6 2015-03-30 10:12:41 PDT
(In reply to comment #5) > Comment on attachment 249606 [details] > Patch > > It would be better if people making ports do something like this if they > find it helpful. Are there any platforms that can't use unix style fd's > these days? Note that the existing code doesn't use any PlatformFileHandle > based abstractions, just the string ones. Well, I thought the GTK port might have issues with this. GTK is not unix-only and AFAIK the Midori browser works on Windows. Anyway, I disagree with the decision as I think it is a slippery slope to start using unix-specific things in cross-platform headers but I am going to close this since I don't have any stakes in this. The GTK or EFL port guys can always reopen if they wish to make this change.
Martin Robinson
Comment 7 2015-03-30 11:41:03 PDT
(In reply to comment #6) > Anyway, I disagree with the decision as I think it is a slippery slope to > start using unix-specific things in cross-platform headers but I am going to > close this since I don't have any stakes in this. The GTK or EFL port guys > can always reopen if they wish to make this change. WebKitGTK+ doesn't have Windows or OS X support at the moment. We lost it with the switch to WebKit2. There is no need to keep the abstraction around for our sake. If we manage to start the onerous task of creating WebKit2GTK+ for Windows, we will be happy to re-add the abstraction at that time.
Chris Dumez
Comment 8 2015-03-30 12:05:07 PDT
Ok, thanks for the feedback Martin.
Note You need to log in before you can comment on or make changes to this bug.