Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Issue 2583853004: [chrome.dial] Adds chrome.dial.fetchDeviceDecription API. (Closed)

Created:
4 years ago by mark a. foltz
Modified:
3 years, 11 months ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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} Committed: https://chromium.googlesource.com/chromium/src/+/90824416d3eeae5ec6013b250123df65e9d48032

Patch Set 1 #

Patch Set 2 : More hacking. #

Patch Set 3 : Finish implementation #

Patch Set 4 : Add tests. #

Patch Set 5 : Fix initialization #

Total comments: 8

Patch Set 6 : Respond to imcheng@ comments #

Total comments: 4

Patch Set 7 : Respond to lazyboy@ comments. Rebase #

Patch Set 8 : Respond to lazyboy@ comments. Rebase w/namespace changes #

Total comments: 77

Patch Set 9 : Respond to wez@ comments #

Patch Set 10 : Clean up some unneeded code in unittest. #

Total comments: 2

Patch Set 11 : Reply to wez@ #

Patch Set 12 : Rebase and fix typo. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+675 lines, -11 lines) Patch
M chrome/browser/extensions/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/dial/device_description_fetcher.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +73 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/dial/device_description_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +150 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/dial/device_description_fetcher_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +178 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/dial/dial_api.h View 1 2 3 4 5 6 7 8 6 chunks +55 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/dial/dial_api.cc View 1 2 3 4 5 6 7 4 chunks +88 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/dial/dial_apitest.cc View 1 2 3 4 5 6 7 8 5 chunks +26 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/dial/dial_device_data.h View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/dial/dial_device_data.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/dial/dial_registry.h View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/dial/dial_registry.cc View 1 2 3 4 5 6 2 chunks +18 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/dial.idl View 1 2 3 4 5 3 chunks +27 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/dial/experimental/fetch_device_description.html View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/dial/experimental/fetch_device_description.js View 1 2 3 4 5 6 7 8 1 chunk +30 lines, -0 lines 0 comments Download
M extensions/browser/extension_function_histogram_value.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 39 (21 generated)
mark a. foltz
PTAL at the overall design/implementation. I tested it manually with a Cast device and a ...
3 years, 12 months ago (2016-12-22 23:28:59 UTC) #3
mark a. foltz
Tests are done. PTAL.
3 years, 12 months ago (2016-12-27 00:15:32 UTC) #6
imcheng
Nice patch and thanks for the tests! https://codereview.chromium.org/2583853004/diff/80001/chrome/browser/extensions/api/dial/device_description_fetcher.h File chrome/browser/extensions/api/dial/device_description_fetcher.h (right): https://codereview.chromium.org/2583853004/diff/80001/chrome/browser/extensions/api/dial/device_description_fetcher.h#newcode28 chrome/browser/extensions/api/dial/device_description_fetcher.h:28: // with ...
3 years, 11 months ago (2016-12-28 05:36:45 UTC) #13
mark a. foltz
+isherman for extension_function_histogram_value.h +lazyboy for dial.idl PTAL https://codereview.chromium.org/2583853004/diff/80001/chrome/browser/extensions/api/dial/device_description_fetcher.h File chrome/browser/extensions/api/dial/device_description_fetcher.h (right): https://codereview.chromium.org/2583853004/diff/80001/chrome/browser/extensions/api/dial/device_description_fetcher.h#newcode28 chrome/browser/extensions/api/dial/device_description_fetcher.h:28: // with ...
3 years, 11 months ago (2017-01-04 00:20:17 UTC) #15
lazyboy
Couple of comments/nits in test related parts, but dial.idl lgtm. https://codereview.chromium.org/2583853004/diff/100001/chrome/browser/extensions/api/dial/dial_api.cc File chrome/browser/extensions/api/dial/dial_api.cc (right): https://codereview.chromium.org/2583853004/diff/100001/chrome/browser/extensions/api/dial/dial_api.cc#newcode59 ...
3 years, 11 months ago (2017-01-04 22:13:14 UTC) #16
mark a. foltz
+wez Can you please review as Derek is out for a while? https://codereview.chromium.org/2583853004/diff/100001/chrome/browser/extensions/api/dial/dial_api.cc File chrome/browser/extensions/api/dial/dial_api.cc ...
3 years, 11 months ago (2017-01-05 19:16:35 UTC) #18
Wez
TBD: Review dial description fetcher unit-tests. https://codereview.chromium.org/2583853004/diff/140001/chrome/browser/extensions/api/dial/device_description_fetcher.cc File chrome/browser/extensions/api/dial/device_description_fetcher.cc (right): https://codereview.chromium.org/2583853004/diff/140001/chrome/browser/extensions/api/dial/device_description_fetcher.cc#newcode21 chrome/browser/extensions/api/dial/device_description_fetcher.cc:21: constexpr int kMaxDescriptionSizeBytes ...
3 years, 11 months ago (2017-01-05 22:29:25 UTC) #19
Wez
https://codereview.chromium.org/2583853004/diff/140001/chrome/browser/extensions/api/dial/device_description_fetcher_unittest.cc File chrome/browser/extensions/api/dial/device_description_fetcher_unittest.cc (right): https://codereview.chromium.org/2583853004/diff/140001/chrome/browser/extensions/api/dial/device_description_fetcher_unittest.cc#newcode30 chrome/browser/extensions/api/dial/device_description_fetcher_unittest.cc:30: void TearDown() override { EXPECT_TRUE(callback_was_run_); } Rather than maintain ...
3 years, 11 months ago (2017-01-06 01:24:03 UTC) #20
Ilya Sherman
histograms.xml lgtm
3 years, 11 months ago (2017-01-06 22:15:35 UTC) #21
mark a. foltz
https://codereview.chromium.org/2583853004/diff/140001/chrome/browser/extensions/api/dial/device_description_fetcher.cc File chrome/browser/extensions/api/dial/device_description_fetcher.cc (right): https://codereview.chromium.org/2583853004/diff/140001/chrome/browser/extensions/api/dial/device_description_fetcher.cc#newcode21 chrome/browser/extensions/api/dial/device_description_fetcher.cc:21: constexpr int kMaxDescriptionSizeBytes = 262144; On 2017/01/05 at 22:29:24, ...
3 years, 11 months ago (2017-01-09 21:38:08 UTC) #22
Wez
LGTM although note that I wasn't able to review histograms.xml because codereview barfed due to ...
3 years, 11 months ago (2017-01-09 22:12:58 UTC) #23
mark a. foltz
https://codereview.chromium.org/2583853004/diff/140001/chrome/browser/extensions/api/dial/device_description_fetcher.cc File chrome/browser/extensions/api/dial/device_description_fetcher.cc (right): https://codereview.chromium.org/2583853004/diff/140001/chrome/browser/extensions/api/dial/device_description_fetcher.cc#newcode76 chrome/browser/extensions/api/dial/device_description_fetcher.cc:76: const net::URLFetcher* source) { On 2017/01/09 at 22:12:58, Wez ...
3 years, 11 months ago (2017-01-10 00:36:14 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2583853004/200001
3 years, 11 months ago (2017-01-10 00:37:11 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/132687) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 11 months ago (2017-01-10 00:41:42 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2583853004/220001
3 years, 11 months ago (2017-01-10 19:27:47 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/97133)
3 years, 11 months ago (2017-01-10 21:04:46 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2583853004/220001
3 years, 11 months ago (2017-01-10 21:08:04 UTC) #36
commit-bot: I haz the power
3 years, 11 months ago (2017-01-10 22:34:49 UTC) #39
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/90824416d3eeae5ec6013b250123...

Powered by Google App Engine
This is Rietveld 408576698