Adds chrome.dial.fetchDeviceDecription API.
This API fetches the device description for a DIAL device, given a label for a device already discovered.
The request is configured to not send/receive cookies, ignore proxies, and ignore redirects.
Requests are retried with backoff on 5XX responses.
The response is validated in multiple ways:
- Valid Application-URL: header value
- Response body is a valid UTF-8 string
- Response body is <= 256kb
Additional validations are possible by following the DIAL spec closely at the risk of ignoring some devices. See comments in device_description_fetcher.cc for details.
Note: The API function implementation is complicated by thread hopping. See comments in dial_api.h for how this may be improved in the future.
BUG=671932
TESTED=Manually, unit tests, API test
Review-Url: https://codereview.chromium.org/2583853004
Cr-Commit-Position: refs/heads/master@{#442713}
17 files changed