Mojo: Move comment (per TODO).

TBR=darin@chromium.org

Review URL: https://codereview.chromium.org/188133002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255189 0039d316-1c4b-4281-b951-d872f2087c98
parent 4ee77951
......@@ -186,6 +186,13 @@ MojoResult CoreImpl::CreateMessagePipe(MojoHandle* message_pipe_handle0,
return MOJO_RESULT_OK;
}
// Implementation note: To properly cancel waiters and avoid other races, this
// does not transfer dispatchers from one handle to another, even when sending a
// message in-process. Instead, it must transfer the "contents" of the
// dispatcher to a new dispatcher, and then close the old dispatcher. If this
// isn't done, in the in-process case, calls on the old handle may complete
// after the the message has been received and a new handle created (and
// possibly even after calls have been made on the new handle).
MojoResult CoreImpl::WriteMessage(MojoHandle message_pipe_handle,
const void* bytes,
uint32_t num_bytes,
......
......@@ -117,15 +117,6 @@ class MOJO_SYSTEM_IMPL_EXPORT CoreImpl : public Core {
// handle is marked busy. If it is, it fails (with |MOJO_RESULT_BUSY|). This
// prevents |WriteMessage()| from sending a handle that has been closed (or
// learning about this too late).
//
// TODO(vtl): Move this implementation note.
// To properly cancel waiters and avoid other races, |WriteMessage()| does not
// transfer dispatchers from one handle to another, even when sending a
// message in-process. Instead, it must transfer the "contents" of the
// dispatcher to a new dispatcher, and then close the old dispatcher. If this
// isn't done, in the in-process case, calls on the old handle may complete
// after the the message has been received and a new handle created (and
// possibly even after calls have been made on the new handle).
struct HandleTableEntry {
HandleTableEntry();
explicit HandleTableEntry(const scoped_refptr<Dispatcher>& dispatcher);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment