Introduce ChromeBrowserOptions.

ChromeBrowserOptions initializes its properties from BrowserOptions.
CreateChromeBrowserOptions creates ChromeBrowserOptions and subtypes.
CrosBrowserOptions and AndroidBrowserOptions inherit from ChromeBrowserOptions.

BUG=269131
TEST=manual
NOTRY=True

Review URL: https://chromiumcodereview.appspot.com/23606026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224639 0039d316-1c4b-4281-b951-d872f2087c98
cc: Return resources to child compositor via a Callback.

Currently resources in the ResourceProvider are returned for release
back to a child compositor by explicitly calling the method
ResourceProvider::PrepareSendReturnsToChild(). This is problematic
because we want to return resources immediately if the last reference
on the resource is released when a parent compositor gives the resource
back to us.

TextureMailboxes deal with this gracefully by using a ReleaseCallback
in the ResourceProvider that is called when the mailbox is no longer in
use. We follow this example to release resources back to child
compositors by introducing a ReturnCallback in the ResourceProvider.
The ReturnCallback receives an array of resources instead of a single
resource per call, allowing us to save on post tasks and Run()
invocations.

The PrepareSendReturnsToChild is completely replaced by the new callback
mechanism. Resources are returned when they are no longer in use in the
current frame, and their exported reference count reaches zero (or lost
if the child compositor's connection is destroyed).

When the DelegatedRendererLayerImpl recieves a new frame, it will always
add all the resources into the ResourceProvider so that it can map the
resource ids correctly into its own compositor's namespace. Then it will
decide if the frame is valid or not. At that point, the DRLI must decide
to use the new frame, or continue using the old frame. It does this by
calling DeclareUsedResourcesFromChild() on the provider. Any resource
not listed in the declaration will become unused and returned to the
child as soon as possible. This changes the contract on ResourceProvider
such that every call to ReceiveFromChild() should be followed by a
DeclareUsedResourcesFromChild() call.

For now, DelegatedRendererLayer receives the callbacks about returned
resources and just inserts them in its list of resources for the
embedder to grab via TakeUnusedResourcesForChildCompositor(). A
follow-up step will be to move this callback out into the embedder
itself, similar to ReleaseCallback for mailboxes, so that the
RenderWidgetHostViewAura can promptly return resources instead of
waiting until the next commit to know resources are available.

Since resources are now returned to the main thread during commit, we
no longer have an extra pending frame of resources sitting on the impl
side, and can eliminate all the TODOs in our unit tests about this.

Covered by our many existing tests, but also added some new ones:
ResourceProviderTest.DeleteExportedResources
ResourceProviderTest.DestroyChildWithExportedResources

R=piman
BUG=263069

Review URL: https://chromiumcodereview.appspot.com/24078024

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