Bug 99709 - Implement ArgumentCoders for uintptr_t.
Summary: Implement ArgumentCoders for uintptr_t.
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zeno Albisser
URL:
Keywords:
Depends on:
Blocks: 98147
  Show dependency treegraph
 
Reported: 2012-10-18 05:28 PDT by Zeno Albisser
Modified: 2012-10-18 14:01 PDT (History)
1 user (show)

See Also:


Attachments
Patch. (3.45 KB, patch)
2012-10-18 05:42 PDT, Zeno Albisser
andersca: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zeno Albisser 2012-10-18 05:28:25 PDT
Implement ArgumentCoders for uintptr_t.
Comment 1 Zeno Albisser 2012-10-18 05:42:39 PDT
Created attachment 169397 [details]
Patch.
Comment 2 Zeno Albisser 2012-10-18 05:47:49 PDT
We will need this change for implementing GraphicsSurface on Windows.
The actual platform specific surface token on windows is of type HANDLE (which is a void*).
We will have to transfer this value through IPC from the WebProcess to the UIProcess.
Note that it is not actually dereferenced as a pointer!
Because of Windows allowing 32bit and 64bit binaries being executed on the same system, we would only know at compile time if we need to allocate/transfer 32bit or 64bit per token.
By making use of uintptr_t we can nicely neglect this question and make the compiler decide.
Comment 3 Anders Carlsson 2012-10-18 11:43:38 PDT
Comment on attachment 169397 [details]
Patch.

We don't want to have encoders/decoders for types whose size is different on different platforms. Just use uint64_t for this.
Comment 4 Zeno Albisser 2012-10-18 13:29:09 PDT
(In reply to comment #3)
> (From update of attachment 169397 [details])
> We don't want to have encoders/decoders for types whose size is different on different platforms. Just use uint64_t for this.

I kind of expected that. But is there an actual reason for that? Does it cause any kind of problems I have not been thinking about?
Comment 5 Anders Carlsson 2012-10-18 13:59:02 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > (From update of attachment 169397 [details] [details])
> > We don't want to have encoders/decoders for types whose size is different on different platforms. Just use uint64_t for this.
> 
> I kind of expected that. But is there an actual reason for that? Does it cause any kind of problems I have not been thinking about?

On Mac for example, we have IPC between 32-bit and 64-bit processes for plug-ins. Allowing integer types whose size differs could easily introduce bugs so it's better to just not do it.
Comment 6 Zeno Albisser 2012-10-18 14:01:28 PDT
(In reply to comment #5)
> On Mac for example, we have IPC between 32-bit and 64-bit processes for plug-ins. Allowing integer types whose size differs could easily introduce bugs so it's better to just not do it.

Ok, that makes sense. Haven't been aware of that use case. Thanks for the explanation. :-)