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

Issue 2561493002: Pass Physical Web metadata through a struct (Closed)

Created:
4 years ago by cco3
Modified:
3 years, 11 months ago
CC:
chromium-reviews, ntp-dev+reviews_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Pass Physical Web metadata through a struct Currently, we use DictionaryValues in the Physical Web data source. The problem with this is that we cannot store store longs (timestamps). This change introduces a metadata struct that can be requested from the data source, deprecating the DictionaryValue option. BUG=667722 Review-Url: https://codereview.chromium.org/2561493002 Cr-Commit-Position: refs/heads/master@{#443425} Committed: https://chromium.googlesource.com/chromium/src/+/4417ce64c063776af45d1d897f15cdc0be361a2e

Patch Set 1 #

Total comments: 21

Patch Set 2 : Respond to comments #

Total comments: 1

Patch Set 3 : Add required/optional comments #

Total comments: 13

Patch Set 4 : Add more comments #

Total comments: 2

Patch Set 5 : Fix missed compile errors #

Total comments: 13

Patch Set 6 : Add test #

Patch Set 7 : Rebase #

Total comments: 3

Patch Set 8 : C++ cast party #

Total comments: 1

Patch Set 9 : C++ cast afterparty #

Total comments: 10

Patch Set 10 : Capitalize methods #

Patch Set 11 : Remove ios change #

Patch Set 12 : Add necessary ios change #

Patch Set 13 : Some ios compilation issues #

Total comments: 10

Patch Set 14 : Address compile errors #

Total comments: 2

Patch Set 15 : Add data source dependency #

Patch Set 16 : Fix dependency for real #

Total comments: 1

Patch Set 17 : Forward declare MetadataList #

Unified diffs Side-by-side diffs Delta from patch set Stats (+336 lines, -24 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/android/physical_web/physical_web_data_source_android.h View 1 2 3 4 5 3 chunks +11 lines, -3 lines 0 comments Download
M chrome/browser/android/physical_web/physical_web_data_source_android.cc View 1 2 3 4 5 6 7 3 chunks +47 lines, -15 lines 0 comments Download
A chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +138 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M components/physical_web/data_source/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M components/physical_web/data_source/fake_physical_web_data_source.h View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M components/physical_web/data_source/fake_physical_web_data_source.cc View 1 2 3 4 5 6 2 chunks +9 lines, -0 lines 0 comments Download
M components/physical_web/data_source/physical_web_data_source.h View 1 2 3 4 5 6 7 8 9 4 chunks +61 lines, -0 lines 0 comments Download
M components/physical_web/data_source/physical_web_data_source.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M components/physical_web/data_source/physical_web_data_source_impl_unittest.cc View 1 2 3 4 5 6 2 chunks +5 lines, -0 lines 0 comments Download
M ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 15 1 chunk +4 lines, -0 lines 0 comments Download
M ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -0 lines 0 comments Download
M ios/chrome/common/physical_web/physical_web_scanner.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +11 lines, -0 lines 0 comments Download
M ios/chrome/common/physical_web/physical_web_scanner.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +28 lines, -3 lines 0 comments Download

Messages

Total messages: 54 (15 generated)
cco3
4 years ago (2016-12-07 00:55:53 UTC) #2
Marc Treib
+vitaliii FYI
4 years ago (2016-12-07 08:58:13 UTC) #4
vitaliii
On 2016/12/07 08:58:13, Marc Treib wrote: > +vitaliii FYI Thanks. This CL also covers crbug.com/668141.
4 years ago (2016-12-07 09:44:13 UTC) #5
vitaliii
Drive-by comments. Thanks! Happy to see this change (both timestamps and |struct| for physical web ...
4 years ago (2016-12-07 10:14:05 UTC) #7
hollyfaith92
"Great article".Struct is a keyword of structure,We can develop code using structure.You should want to ...
4 years ago (2016-12-07 10:17:43 UTC) #8
mattreynolds
https://codereview.chromium.org/2561493002/diff/1/chrome/browser/android/physical_web/physical_web_data_source_android.cc File chrome/browser/android/physical_web/physical_web_data_source_android.cc (right): https://codereview.chromium.org/2561493002/diff/1/chrome/browser/android/physical_web/physical_web_data_source_android.cc#newcode39 chrome/browser/android/physical_web/physical_web_data_source_android.cc:39: auto dictionary_value = new base::DictionaryValue(); This should be: auto ...
4 years ago (2016-12-07 19:55:31 UTC) #9
cco3
https://codereview.chromium.org/2561493002/diff/1/chrome/browser/android/physical_web/physical_web_data_source_android.cc File chrome/browser/android/physical_web/physical_web_data_source_android.cc (right): https://codereview.chromium.org/2561493002/diff/1/chrome/browser/android/physical_web/physical_web_data_source_android.cc#newcode39 chrome/browser/android/physical_web/physical_web_data_source_android.cc:39: auto dictionary_value = new base::DictionaryValue(); On 2016/12/07 19:55:31, mattreynolds ...
4 years ago (2016-12-08 23:52:51 UTC) #10
mattreynolds
https://codereview.chromium.org/2561493002/diff/20001/components/physical_web/data_source/physical_web_data_source.h File components/physical_web/data_source/physical_web_data_source.h (right): https://codereview.chromium.org/2561493002/diff/20001/components/physical_web/data_source/physical_web_data_source.h#newcode34 components/physical_web/data_source/physical_web_data_source.h:34: struct Metadata { We should comment on which fields ...
4 years ago (2016-12-09 00:10:03 UTC) #11
vitaliii
More comments. https://codereview.chromium.org/2561493002/diff/1/components/physical_web/data_source/physical_web_data_source.h File components/physical_web/data_source/physical_web_data_source.h (right): https://codereview.chromium.org/2561493002/diff/1/components/physical_web/data_source/physical_web_data_source.h#newcode46 components/physical_web/data_source/physical_web_data_source.h:46: using MetadataList = std::vector<Metadata>; On 2016/12/08 23:52:50, ...
4 years ago (2016-12-09 09:52:49 UTC) #12
cco3
https://codereview.chromium.org/2561493002/diff/40001/chrome/browser/android/physical_web/physical_web_data_source_android.cc File chrome/browser/android/physical_web/physical_web_data_source_android.cc (right): https://codereview.chromium.org/2561493002/diff/40001/chrome/browser/android/physical_web/physical_web_data_source_android.cc#newcode66 chrome/browser/android/physical_web/physical_web_data_source_android.cc:66: metadata.scan_timestamp = scan_timestamp; On 2016/12/09 09:52:49, vitaliii wrote: > ...
4 years ago (2016-12-10 00:25:23 UTC) #13
vitaliii
LGTM with a nit. Thanks! You still will have to wait for OWNER approval (treib@) ...
4 years ago (2016-12-12 07:04:13 UTC) #14
cco3
https://codereview.chromium.org/2561493002/diff/60001/chrome/browser/android/physical_web/physical_web_data_source_android.cc File chrome/browser/android/physical_web/physical_web_data_source_android.cc (right): https://codereview.chromium.org/2561493002/diff/60001/chrome/browser/android/physical_web/physical_web_data_source_android.cc#newcode67 chrome/browser/android/physical_web/physical_web_data_source_android.cc:67: metadata_list_->push_back(std::move(metadata_item)); On 2016/12/12 07:04:13, vitaliii wrote: > s/time/Time? Whoops, ...
4 years ago (2016-12-12 19:33:36 UTC) #15
cco3
Hi Tommy, could you review the android changes here? Thanks!
4 years ago (2016-12-12 19:34:02 UTC) #17
mattreynolds
https://codereview.chromium.org/2561493002/diff/80001/components/physical_web/data_source/physical_web_data_source.h File components/physical_web/data_source/physical_web_data_source.h (right): https://codereview.chromium.org/2561493002/diff/80001/components/physical_web/data_source/physical_web_data_source.h#newcode12 components/physical_web/data_source/physical_web_data_source.h:12: #include "url/gurl.h" Also add "//url" to the data_source deps ...
4 years ago (2016-12-12 19:41:29 UTC) #18
nyquist
https://codereview.chromium.org/2561493002/diff/80001/chrome/browser/android/physical_web/physical_web_data_source_android.cc File chrome/browser/android/physical_web/physical_web_data_source_android.cc (right): https://codereview.chromium.org/2561493002/diff/80001/chrome/browser/android/physical_web/physical_web_data_source_android.cc#newcode58 chrome/browser/android/physical_web/physical_web_data_source_android.cc:58: physical_web::Metadata metadata; Do we want to ensure that we ...
4 years ago (2016-12-13 18:13:25 UTC) #19
cco3
https://codereview.chromium.org/2561493002/diff/80001/chrome/browser/android/physical_web/physical_web_data_source_android.cc File chrome/browser/android/physical_web/physical_web_data_source_android.cc (right): https://codereview.chromium.org/2561493002/diff/80001/chrome/browser/android/physical_web/physical_web_data_source_android.cc#newcode58 chrome/browser/android/physical_web/physical_web_data_source_android.cc:58: physical_web::Metadata metadata; On 2016/12/13 18:13:25, nyquist wrote: > Do ...
4 years ago (2016-12-16 19:17:53 UTC) #20
mattreynolds
https://codereview.chromium.org/2561493002/diff/120001/chrome/browser/android/physical_web/physical_web_data_source_android.cc File chrome/browser/android/physical_web/physical_web_data_source_android.cc (right): https://codereview.chromium.org/2561493002/diff/120001/chrome/browser/android/physical_web/physical_web_data_source_android.cc#newcode114 chrome/browser/android/physical_web/physical_web_data_source_android.cc:114: (long) pw_collection.get()); Use reinterpret_cast<long> https://codereview.chromium.org/2561493002/diff/120001/chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc File chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc (right): https://codereview.chromium.org/2561493002/diff/120001/chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc#newcode73 ...
4 years ago (2016-12-16 20:27:44 UTC) #21
mattreynolds
lgtm https://codereview.chromium.org/2561493002/diff/140001/chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc File chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc (right): https://codereview.chromium.org/2561493002/diff/140001/chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc#newcode100 chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc:100: (jlong) kScanTimestamp, some more here
4 years ago (2016-12-16 21:17:07 UTC) #22
cco3
Hi jyquinn@, would you be able to take a look at these iOS changes?
4 years ago (2016-12-21 20:02:07 UTC) #24
Jackie Quinn
ios lgtm. I'm not an owner though, so cc'ing eugenebut@
4 years ago (2016-12-22 01:39:02 UTC) #26
nyquist
https://codereview.chromium.org/2561493002/diff/160001/chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc File chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc (right): https://codereview.chromium.org/2561493002/diff/160001/chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc#newcode36 chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc:36: PhysicalWebCollection* collection(); Naming for C++ starts with uppercase. See ...
3 years, 11 months ago (2017-01-05 07:42:28 UTC) #27
cco3
https://codereview.chromium.org/2561493002/diff/160001/chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc File chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc (right): https://codereview.chromium.org/2561493002/diff/160001/chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc#newcode36 chrome/browser/android/physical_web/physical_web_data_source_android_unittest.cc:36: PhysicalWebCollection* collection(); On 2017/01/05 07:42:28, nyquist (OOO back 1-3) ...
3 years, 11 months ago (2017-01-05 23:52:56 UTC) #28
cco3
Hi Tommy, does this look fine now?
3 years, 11 months ago (2017-01-09 18:51:22 UTC) #29
nyquist
lgtm
3 years, 11 months ago (2017-01-11 18:52:53 UTC) #30
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/2561493002/200001
3 years, 11 months ago (2017-01-11 19:26:01 UTC) #33
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/134060) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 11 months ago (2017-01-11 19:34:52 UTC) #35
cco3
Matt, could you take a look at these iOS changes?
3 years, 11 months ago (2017-01-11 19:56:04 UTC) #36
mattreynolds
https://codereview.chromium.org/2561493002/diff/230001/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h File ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h (right): https://codereview.chromium.org/2561493002/diff/230001/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h#newcode40 ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h:40: std::unique_ptr<MetadataList> GetMetadataList() override; MetadataList needs the physical_web:: namespace https://codereview.chromium.org/2561493002/diff/230001/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.mm ...
3 years, 11 months ago (2017-01-11 20:54:51 UTC) #37
cco3
https://codereview.chromium.org/2561493002/diff/230001/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h File ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h (right): https://codereview.chromium.org/2561493002/diff/230001/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h#newcode40 ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h:40: std::unique_ptr<MetadataList> GetMetadataList() override; On 2017/01/11 20:54:50, mattreynolds wrote: > ...
3 years, 11 months ago (2017-01-11 22:51:02 UTC) #38
mattreynolds
https://codereview.chromium.org/2561493002/diff/250001/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h File ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h (right): https://codereview.chromium.org/2561493002/diff/250001/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h#newcode40 ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h:40: std::unique_ptr<physical_web::MetadataList> GetMetadataList() override; This file needs #include "components/physical_web/data_source/physical_web_data_source.h" (and ...
3 years, 11 months ago (2017-01-11 23:04:52 UTC) #39
cco3
https://codereview.chromium.org/2561493002/diff/250001/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h File ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h (right): https://codereview.chromium.org/2561493002/diff/250001/ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h#newcode40 ios/chrome/browser/physical_web/ios_chrome_physical_web_data_source.h:40: std::unique_ptr<physical_web::MetadataList> GetMetadataList() override; On 2017/01/11 23:04:52, mattreynolds wrote: > ...
3 years, 11 months ago (2017-01-11 23:32:41 UTC) #40
mattreynolds
(oops, I meant to post the previous comment to physical_web_scanner.h) Once that's fixed, LGTM
3 years, 11 months ago (2017-01-12 00:29:00 UTC) #41
cco3
Hi Olivier, would you be able to review these iOS changes?
3 years, 11 months ago (2017-01-12 00:29:58 UTC) #43
Olivier
ios LGTM one nit https://codereview.chromium.org/2561493002/diff/290001/ios/chrome/common/physical_web/physical_web_scanner.h File ios/chrome/common/physical_web/physical_web_scanner.h (right): https://codereview.chromium.org/2561493002/diff/290001/ios/chrome/common/physical_web/physical_web_scanner.h#newcode12 ios/chrome/common/physical_web/physical_web_scanner.h:12: #include "components/physical_web/data_source/physical_web_data_source.h" Can you forward ...
3 years, 11 months ago (2017-01-12 08:47:46 UTC) #44
cco3
Hi rohitrao@, would you be able to review these two unreviewed iOS files?
3 years, 11 months ago (2017-01-12 23:22:07 UTC) #46
rohitrao (ping after 24h)
ios/ LGTM Is this something we could add unittests for, like we have on Android?
3 years, 11 months ago (2017-01-12 23:49:16 UTC) #47
cco3
Thanks! Possibly, but that will have to come in another change.
3 years, 11 months ago (2017-01-12 23:50:38 UTC) #48
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/2561493002/310001
3 years, 11 months ago (2017-01-12 23:51:58 UTC) #51
commit-bot: I haz the power
3 years, 11 months ago (2017-01-13 01:10:30 UTC) #54
Message was sent while issue was closed.
Committed patchset #17 (id:310001) as
https://chromium.googlesource.com/chromium/src/+/4417ce64c063776af45d1d897f15...

Powered by Google App Engine
This is Rietveld 408576698