Refactor Chromoting.java to pull out some nested classes.

Flattening some of these nested classes will make it simpler to fix the
referenced bug. There are also some minor style cleanups.

This also adds a private lock, since the previous implementation was
synchronizing on the Chromoting object itself, and the newly-refactored
code would otherwise trigger a FindBugs warning.

The nested class HostListDirectoryGrabber will be addressed in a
followup CL.

BUG=304719

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242931 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 242931
Mojo: More DataPipe edge case handling and testing.

Define/test behavior of two-phase writes/reads if they cross (or attempt
to cross) close boundaries. Also define/test behavior for a producer
writing after the consumer is closed and a consumer reading/discarding
after the producer is closed.

R=davemoore@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242932 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 242932