[omnibox debug]: Track request completion and associate with response

Currently, the browser proxy that sends requests to and receives
responses from the page handler uses callbacks that don't track the
requests they correspond to. Additionally, sending a request cancels
previous requests. This makes it difficult to track a request's
completion and associate responses with particular requests.

With this CL, when making a request from the debug page a promise is
returned which resolves with the last response value when the last
associated response is received (a request can have multiple responses).
Interrupted requests will not resolve.

Additionally, this CL wires in the request's input text to the browser
proxy's handleNewAutocompleteQuery callback in order to allow it to
determine which request the query pertains to. This param is not wired
into the similar handleNewAutocompleteResponse callback, as that
function's param includes a response which in turn includes the
request's input text already (via the host field).

Additionally, a few mojom callback handlers which were small enough to
justify defining as anonymous functions during the browser proxy's
construction have now grown and have been extracted to non-anon
functions on the browser proxy class with proper closure annotations.

Bug: 963596
Change-Id: Ifbfb86750f272c20e70693bb2539d74e0be09f8a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1613878
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Reviewed-by: Tommy Li <tommycli@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660451}
7 files changed