Fix a race condition in the SyncChannel code.

The problem is that QueueMessage would be called with listener() on the IPC thread, and then the function would wait on message_lock_ before adding the message and its associated listener.  However, in between the time that listener() was called and the lock was taken control of, the listener thread may be calling RemoveListener.

The fix is to not send the listener, but instead just send a pointer to the context.  It'll be used on the listener thread, at which point listener() can be called to check if the listener is available.

BUG=1305036
Review URL: http://codereview.chromium.org/12952

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