DescriptionMojo: Change how we handle invalid pointer arguments (at the system layer).
This changes the semantics of the public system API: instead of
(attempting) to returning "invalid argument" (e.g., when you pass a null
pointer for a required argument), we'll crash/trap/kill you.
The reason for this is that it's not really sensible to check pointers
up front in the face of threads doing different things (e.g., memory
that is valid to read to/write from at the beginning of a call may not
be valid later).
As such, we wrap "user" pointers in a (new) |UserPointer<>| class, and
provide ways of accessing the memory that they refer to. We should never
pass around user pointers as plain pointers. (This careful treatment
will probably already be needed to properly support NaCl, for example.)
Still to do (but this change is already too big):
* Update comments (in mojo/public/c/system).
* Properly convert the remaining user pointers being passed around as
plain pointers. This includes:
* Getting rid of |GetPointerUnsafe()| and also the existing
|VerifyUserPointer...()| functions.
* Changing how we handle the various options structs.
* Changing some of the |Dispatcher| interface.
* Write tests for |UserPointer<>|, etc.
R=darin@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=285350
Patch Set 1 #
Total comments: 6
Patch Set 2 : review changes #
Messages
Total messages: 4 (0 generated)
|