Restore thread safety to GpuChannelHost.
RefCountedThreadSafe + SupportsWeakPtr is generally a bad combo.
This changes how thread safety is handled in GpuChannelHost:
- Shared data/state set by the IO thread is moved onto the MessageFilter,
protected by a lock.
- MessageFilter doesn't need to post tasks to the GpuChannelHost on the main
thread.
- Most of the GpuChannelHost fields are constant, the remaining ones are atomic
or protected by a lock.
It also includes various cleanup:
- Reduced the scope of some locks. In particular we mostly avoid taking locks
while sending messages.
- Removed GpuChannelHostFactory::IsIOThread which isn't used.
- Simplifies channel state. We always are "connected" until we are "lost".
A behavior change is that the "lost" state is set directly on the IO thread, as
soon as we receive the channel error. This makes recreation logic less dependent
on precise task order.
BUG=242826
R=apatrick@chromium.org
Review URL: https://codereview.chromium.org/
16228004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205992 0039d316-1c4b-4281-b951-d872f2087c98