Bug 143150 - [WK2][NetworkCache] Use PlatformFileHandle abstraction in cross-platform code
Summary: [WK2][NetworkCache] Use PlatformFileHandle abstraction in cross-platform code
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-27 13:51 PDT by Chris Dumez
Modified: 2015-03-30 12:05 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.15 KB, patch)
2015-03-27 14:16 PDT, Chris Dumez
koivisto: review-
koivisto: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-03-27 13:51:27 PDT
Use PlatformFileHandle abstraction instead of int type for file descriptors in cross-platform code.
Comment 1 Chris Dumez 2015-03-27 14:16:02 PDT
Created attachment 249606 [details]
Patch
Comment 2 Anders Carlsson 2015-03-27 14:31:53 PDT
Why do we want to do this?
Comment 3 Chris Dumez 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.
Comment 4 Chris Dumez 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.
Comment 5 Antti Koivisto 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.
Comment 6 Chris Dumez 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.
Comment 7 Martin Robinson 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.
Comment 8 Chris Dumez 2015-03-30 12:05:07 PDT
Ok, thanks for the feedback Martin.