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

Issue 2564483003: Default share to Share Target: Partial impl. of Web Share for Desktop. (Closed)

Created:
4 years ago by constantina
Modified:
3 years, 11 months ago
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, dcheng
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Default share to Share Target: Partial impl. of Web Share for Desktop. Currently only shares to a demo Share Target App hosted at https://wicg.github.io/web-share-target/demos/sharetarget.html; follow-up CL will have more share options. BUG=668389 Review-Url: https://codereview.chromium.org/2564483003 Cr-Commit-Position: refs/heads/master@{#443510} Committed: https://chromium.googlesource.com/chromium/src/+/2cfa55e24997bd05c573b163a630f1dac13cd184

Patch Set 1 #

Patch Set 2 : Replace Twitter target web app with Web Share Target web app #

Patch Set 3 : New tab opens next to the current tab, and is brought to foreground #

Patch Set 4 : New algorithm replaces all instances of placeholders, no matter the order, and maintains the order #

Patch Set 5 : Added test cases #

Patch Set 6 : Updated Share Target app address #

Patch Set 7 : Fixed my nits #

Patch Set 8 : Refactored test, so there is a test helper subclass of ShareServiceImpl #

Patch Set 9 : Check the target_url opened by Share, in test #

Total comments: 51

Patch Set 10 : Corrected all minor feedback, as well as expanding on tests. #

Patch Set 11 : Added a few more tests. #

Patch Set 12 : Allow ReplacePlaceholders to return an error. #

Patch Set 13 : Reimplemented ReplacePlaceholders algorithm. #

Total comments: 37

Patch Set 14 : Fixed, as per feedback. #

Patch Set 15 : Updated documentation #

Total comments: 75

Patch Set 16 : Fixed, according to feedback. #

Patch Set 17 : Reimplemented algorithm, and changed error cases. Test cases changed as appropriate. #

Total comments: 49

Patch Set 18 : Updated includes. #

Total comments: 26

Patch Set 19 : Fixed, according to feedback, excluding reimplementation. #

Patch Set 20 : Inverted if statements when looking for delimiters. #

Patch Set 21 : Remove % from opening delimiter #

Total comments: 22

Patch Set 22 : Refactored algorithm, fixed according to feedback. #

Patch Set 23 : Use StringPiece.substr() #

Total comments: 6

Patch Set 24 : Fixed, according to feedback. #

Total comments: 12

Patch Set 25 : Fixed, according to feedback. #

Total comments: 2

Patch Set 26 : Add TODO. #

Patch Set 27 : Rebase #

Patch Set 28 : Prevent code running on android. #

Patch Set 29 : Fix typo #

Patch Set 30 #

Messages

Total messages: 55 (22 generated)
constantina
PTAL
4 years ago (2016-12-21 02:55:11 UTC) #5
Matt Giuca
A few comments for you :) I suggest you start working on the tests first ...
4 years ago (2016-12-21 07:13:50 UTC) #6
dcheng
As mentioned on https://codereview.chromium.org/2545323002/, please include a *random* reviewer from //ipc/SECURITY_OWNERS, since the implementation should ...
4 years ago (2016-12-21 19:52:52 UTC) #7
Sam McNally
https://codereview.chromium.org/2564483003/diff/160001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/160001/chrome/browser/webshare/share_service_impl.cc#newcode36 chrome/browser/webshare/share_service_impl.cc:36: std::string title_placeholder = "%{title}"; On 2016/12/21 07:13:49, Matt Giuca ...
4 years ago (2016-12-22 07:03:50 UTC) #8
constantina
https://codereview.chromium.org/2564483003/diff/160001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/160001/chrome/browser/webshare/share_service_impl.cc#newcode26 chrome/browser/webshare/share_service_impl.cc:26: std::string ShareServiceImpl::replacePlaceholders( On 2016/12/21 07:13:49, Matt Giuca (OOO til ...
3 years, 11 months ago (2017-01-04 07:01:45 UTC) #10
constantina
+kenrb for ipc security
3 years, 11 months ago (2017-01-04 07:02:41 UTC) #12
Sam McNally
https://codereview.chromium.org/2564483003/diff/240001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/240001/chrome/browser/webshare/share_service_impl.cc#newcode51 chrome/browser/webshare/share_service_impl.cc:51: std::map<base::StringPiece, base::StringPiece> placeholder_to_data; You could use an initializer list ...
3 years, 11 months ago (2017-01-04 09:15:47 UTC) #13
constantina
https://codereview.chromium.org/2564483003/diff/240001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/240001/chrome/browser/webshare/share_service_impl.cc#newcode51 chrome/browser/webshare/share_service_impl.cc:51: std::map<base::StringPiece, base::StringPiece> placeholder_to_data; On 2017/01/04 09:15:46, Sam McNally wrote: ...
3 years, 11 months ago (2017-01-05 00:34:39 UTC) #14
Matt Giuca
https://codereview.chromium.org/2564483003/diff/160001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/160001/chrome/browser/webshare/share_service_impl.cc#newcode36 chrome/browser/webshare/share_service_impl.cc:36: std::string title_placeholder = "%{title}"; On 2016/12/22 07:03:50, Sam McNally ...
3 years, 11 months ago (2017-01-05 03:09:26 UTC) #19
Sam McNally
https://codereview.chromium.org/2564483003/diff/160001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/160001/chrome/browser/webshare/share_service_impl.cc#newcode36 chrome/browser/webshare/share_service_impl.cc:36: std::string title_placeholder = "%{title}"; On 2017/01/05 03:09:24, Matt Giuca ...
3 years, 11 months ago (2017-01-05 04:08:37 UTC) #20
Matt Giuca
https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.cc#newcode54 chrome/browser/webshare/share_service_impl.cc:54: std::vector<int> placeholder_open_indices; On 2017/01/05 04:08:37, Sam McNally wrote: > ...
3 years, 11 months ago (2017-01-05 05:00:13 UTC) #21
Matt Giuca
Please change the title of the CL to match the first line of the description.
3 years, 11 months ago (2017-01-05 05:00:44 UTC) #22
Sam McNally
https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.cc#newcode80 chrome/browser/webshare/share_service_impl.cc:80: // Reserve memory for filled template, assuming all placeholders ...
3 years, 11 months ago (2017-01-05 05:41:49 UTC) #23
constantina
https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.cc#newcode36 chrome/browser/webshare/share_service_impl.cc:36: constexpr char kTitlePlaceholder[] = "%{title}"; On 2017/01/05 03:09:25, Matt ...
3 years, 11 months ago (2017-01-09 02:12:44 UTC) #25
Sam McNally
https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.h File chrome/browser/webshare/share_service_impl.h (right): https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.h#newcode47 chrome/browser/webshare/share_service_impl.h:47: const std::string& title, On 2017/01/09 02:12:43, constantina wrote: > ...
3 years, 11 months ago (2017-01-09 03:15:22 UTC) #28
Matt Giuca
https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.cc#newcode136 chrome/browser/webshare/share_service_impl.cc:136: std::string url_template = On 2017/01/09 02:12:42, constantina wrote: > ...
3 years, 11 months ago (2017-01-09 03:56:54 UTC) #29
Matt Giuca
https://codereview.chromium.org/2564483003/diff/340001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/340001/chrome/browser/webshare/share_service_impl.cc#newcode77 chrome/browser/webshare/share_service_impl.cc:77: // Remove %{ and } from placeholders in |split_template|. ...
3 years, 11 months ago (2017-01-09 04:50:14 UTC) #30
constantina
https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/280001/chrome/browser/webshare/share_service_impl.cc#newcode136 chrome/browser/webshare/share_service_impl.cc:136: std::string url_template = On 2017/01/09 03:56:54, Matt Giuca wrote: ...
3 years, 11 months ago (2017-01-09 23:51:05 UTC) #31
Sam McNally
https://codereview.chromium.org/2564483003/diff/420001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/420001/chrome/browser/webshare/share_service_impl.cc#newcode21 chrome/browser/webshare/share_service_impl.cc:21: return ((c >= 'a' && c <= 'z') || ...
3 years, 11 months ago (2017-01-10 06:53:51 UTC) #32
constantina
https://codereview.chromium.org/2564483003/diff/420001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/420001/chrome/browser/webshare/share_service_impl.cc#newcode21 chrome/browser/webshare/share_service_impl.cc:21: return ((c >= 'a' && c <= 'z') || ...
3 years, 11 months ago (2017-01-12 04:04:41 UTC) #33
Sam McNally
lgtm https://codereview.chromium.org/2564483003/diff/460001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/460001/chrome/browser/webshare/share_service_impl.cc#newcode21 chrome/browser/webshare/share_service_impl.cc:21: bool IsIndentifier(char c) { Indentifier? https://codereview.chromium.org/2564483003/diff/460001/chrome/browser/webshare/share_service_impl.cc#newcode67 chrome/browser/webshare/share_service_impl.cc:67: int ...
3 years, 11 months ago (2017-01-12 04:56:13 UTC) #34
Matt Giuca
Looks good, I have a few nits mostly which are documentation. https://codereview.chromium.org/2564483003/diff/480001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): ...
3 years, 11 months ago (2017-01-12 05:51:38 UTC) #35
constantina
https://codereview.chromium.org/2564483003/diff/460001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/460001/chrome/browser/webshare/share_service_impl.cc#newcode21 chrome/browser/webshare/share_service_impl.cc:21: bool IsIndentifier(char c) { On 2017/01/12 04:56:12, Sam McNally ...
3 years, 11 months ago (2017-01-12 06:01:58 UTC) #36
Matt Giuca
lgtm!
3 years, 11 months ago (2017-01-12 06:34:25 UTC) #37
constantina
:) kenrb, could you take a look for IPC security?
3 years, 11 months ago (2017-01-12 06:36:37 UTC) #38
kenrb
mojo lgtm, with an unrelated nit. Thanks for requesting security review for changes to the ...
3 years, 11 months ago (2017-01-12 14:53:37 UTC) #39
constantina
https://codereview.chromium.org/2564483003/diff/500001/chrome/browser/webshare/share_service_impl.cc File chrome/browser/webshare/share_service_impl.cc (right): https://codereview.chromium.org/2564483003/diff/500001/chrome/browser/webshare/share_service_impl.cc#newcode28 chrome/browser/webshare/share_service_impl.cc:28: std::string JoinString(const std::vector<base::StringPiece>& pieces) { On 2017/01/12 14:53:37, kenrb ...
3 years, 11 months ago (2017-01-13 00:40:06 UTC) #40
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/2564483003/540001
3 years, 11 months ago (2017-01-13 02:34:59 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_compile_dbg/builds/193774)
3 years, 11 months ago (2017-01-13 03:12:39 UTC) #45
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/2564483003/560001
3 years, 11 months ago (2017-01-13 05:40:56 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/2564483003/600001
3 years, 11 months ago (2017-01-13 05:56:13 UTC) #51
commit-bot: I haz the power
Committed patchset #30 (id:600001) as https://chromium.googlesource.com/chromium/src/+/2cfa55e24997bd05c573b163a630f1dac13cd184
3 years, 11 months ago (2017-01-13 06:37:43 UTC) #54
Matt Giuca
3 years, 11 months ago (2017-01-13 09:42:44 UTC) #55
Message was sent while issue was closed.
High five!

Powered by Google App Engine
This is Rietveld 408576698