POSIX: Clean up DescriptorSet

In general, the IPC Message objects are const and the iterator state is a void*
kept by the code which is doing the deserialisation.

However, now that we have an array of file descriptors, the index of the next
file descriptor is part of the iteration state and is kept /inside/ the Message
(in the DescriptorSet). This means that it's a mutable member, which is never
too nice and also, since the logging functions want to parse a message multiple
times, we've had to turn off returning an error when one runs off the end of
the array.

Also, the Message copy constructor and assignment function alters the /source/
Message, by stealing all of its descriptors

This patch encodes the index of each file descriptor on the wire. So the state
is moved from inside the DescriptorSet into the serialised data.

Additionally, the DescriptorSet is made into a lazyily created scoped_refptr,
solving the problems with copying messages.

Review URL: http://codereview.chromium.org/20275


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9644 0039d316-1c4b-4281-b951-d872f2087c98
6 files changed