Probably would be sufficient to make this a 64bit Integer and use randomization to allocate them.
It will be huge ABI break that will require to recompile everything.
Randomizing on itās own would not be a abi break I think. Would maybe be sufficient.
Yes, randomization will reduce a risk of intentional attack, but not completely solve issue.
So, the approach of creating a BLooper
when creating the BMessenger
turns out to be messier than I would like. So Iām going to go with the approach of expanding Haikuās API slightly. I built a simple test, and it looks like this approach will work!
These changes are relatively minor and will not create any ABI compatibility problem. Therefore, the simplest solution is to change the classes where they are in Haiku, there is no reason so far to copy them. If we end up having ABI problems, sure, we can change our mind, but I donāt see why that would be the case here.
And it works!
In the first line WebProcess sends a message and in the third line NetworkProcess receives it!
I used a pair of two ports, each going the opposite direction, to communicate. It works well, I think I didnāt have to modify any of WebKitās code, and the code is clean. Now itās time to upload that Haiku API change.
Exciting! : D
So, after a lot more thought about connections, I realized that it could actually be quite simple to use UNIX sockets. Previously, I thought that in order to use UNIX sockets, I would have to figure out how to make them work with BLoopers, but it now looks like that isnāt necessary.
Anyway, after some discussion, Iāve decided to try using them. If it works, then weāll have little to no Haiku-specific code for connections, yielding a maintenance cost of very near zero!
IIRC we already have private accessor classes for these functions, i.e. have a look at BMessengerPrivate etc.
Yes, thatās what I used in the demo
Of course, itās not ideal to use a private API outside of Haiku. Ideally, we would make that public.
WebKit is on the borderline of Haiku. It is a separate codebase due to its size, but the goal is to have it as integrated in the OS as the other ākitsā eventually. So, it would be acceptable in this case.
New APIs also tend to stay private (but exposed) for some time anyways (for example in libshared, although this has additional safeguards). This allows to experiment with them before committing to a stable API. At the moment the application ecosystem is small enough that rebuilding all the ones using private APIs is still acceptable. Someday that wonāt be the case anymore.
Anyways, letās see if using UNIX sockets can work, this would be the solution with less maintenance and, as far as I can see, no downsides.
Great news !
The pull request has been merged!
Now I want to figure out what it takes to get things to display.
Now WebKit is trying to display things. Itās just encountering errors as it tries to do so. So here I go trying to fix them.
Iām also watching for a good place to write a blog post, since this is no longer about fixing IPC .
ā¦ and we await for that new blog post !