Mojo C++ Bindings: Additional support for associated binding sets

Implements three orthogonal changes to the public bindings API:

 1. Adds the ability to remove bindings from a binding set. Uses
    a new mojo::BindingId integer alias to identify added bindings.

 2. Adds the ability to set a pre-dispatch hook on binding sets.
    In some cases simply making the dispatch_context() available
    is insufficient, for example when a consumer owns multiple
    binding sets and wants a common path for establishing context
    among any of them.

 3. Adds mojo::GetDummyProxy, a helper that can bind an
    AssociatedInterfacePtr<T> so that it has some valid internal
    state and silently drops all outgoing messages. Unlike
    regular message pipe interfaces, without this feature
    associated interfaces are difficult to stub out in test
    environments.

Part a series of CLs to enable and demonstrate WebContents associated
interfaces:

  1. https://codereview.chromium.org/2301123004
  2. This CL
  3. https://codereview.chromium.org/2310563002
  4. https://codereview.chromium.org/2310583002

BUG=612500
R=yzshen@chromium.org

Review-Url: https://codereview.chromium.org/2309513002
Cr-Commit-Position: refs/heads/master@{#417126}
2 files changed