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

Issue 23440030: GeolocationPermissionContext: only use origin from embedder url. (Closed)

Created:
7 years, 3 months ago by Michael van Ouwerkerk
Modified:
7 years, 3 months ago
Reviewers:
bulach, joth
CC:
chromium-reviews, Michael van Ouwerkerk, miguelg, timvolodine
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

GeolocationPermissionContext: only use origin from embedder url. Specifically for the bug being fixed, if the hash is not stripped, and it changes while the info bar is displayed, then an equality comparison will fail needlessly later. Also, use WebContents::GetLastCommittedURL instead of the deprecated GetURL. BUG=286667 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=223078

Patch Set 1 #

Patch Set 2 : Use WebContents::GetLastCommittedUrl #

Patch Set 3 : Retry upload. #

Total comments: 8

Patch Set 4 : Use GURL::GetOrigin. #

Total comments: 2

Patch Set 5 : Add test, some cleanup. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -13 lines) Patch
M chrome/browser/geolocation/chrome_geolocation_permission_context.cc View 1 2 3 4 3 chunks +10 lines, -9 lines 0 comments Download
M chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc View 1 2 3 4 1 chunk +30 lines, -0 lines 0 comments Download
M chrome/browser/geolocation/geolocation_infobar_delegate.cc View 1 2 3 4 3 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Michael van Ouwerkerk
Kind of a hacky solution to get it working. Is that ok or would you ...
7 years, 3 months ago (2013-09-12 16:21:15 UTC) #1
bulach
https://codereview.chromium.org/23440030/diff/4001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (right): https://codereview.chromium.org/23440030/diff/4001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#newcode98 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:98: GURL embedder = web_contents->GetLastCommittedURL(); .GetOrigin() ? https://codereview.chromium.org/23440030/diff/4001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#newcode113 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:113: } ...
7 years, 3 months ago (2013-09-12 16:28:41 UTC) #2
bulach
oh, and it'd be great to have some tests too :)
7 years, 3 months ago (2013-09-12 16:29:05 UTC) #3
joth
writing custom code to parse url parts is generally considered an antipattern in chrome https://codereview.chromium.org/23440030/diff/4001/chrome/browser/geolocation/geolocation_infobar_delegate.cc ...
7 years, 3 months ago (2013-09-12 16:43:13 UTC) #4
Michael van Ouwerkerk
Much better, thanks! I'll look into tests now. https://codereview.chromium.org/23440030/diff/4001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc File chrome/browser/geolocation/chrome_geolocation_permission_context.cc (right): https://codereview.chromium.org/23440030/diff/4001/chrome/browser/geolocation/chrome_geolocation_permission_context.cc#newcode98 chrome/browser/geolocation/chrome_geolocation_permission_context.cc:98: GURL ...
7 years, 3 months ago (2013-09-12 16:50:40 UTC) #5
joth
lgtm https://codereview.chromium.org/23440030/diff/14001/chrome/browser/geolocation/geolocation_infobar_delegate.cc File chrome/browser/geolocation/geolocation_infobar_delegate.cc (right): https://codereview.chromium.org/23440030/diff/14001/chrome/browser/geolocation/geolocation_infobar_delegate.cc#newcode52 chrome/browser/geolocation/geolocation_infobar_delegate.cc:52: requesting_frame_(requesting_frame), (OT for this patch) should this be ...
7 years, 3 months ago (2013-09-12 17:12:34 UTC) #6
bulach
lgtm perhaps we could make the chrome_geolocation_permission_context sanitize all its inputs to be Origin based, ...
7 years, 3 months ago (2013-09-13 09:07:23 UTC) #7
Michael van Ouwerkerk
Thanks for the quick reviews! https://codereview.chromium.org/23440030/diff/14001/chrome/browser/geolocation/geolocation_infobar_delegate.cc File chrome/browser/geolocation/geolocation_infobar_delegate.cc (right): https://codereview.chromium.org/23440030/diff/14001/chrome/browser/geolocation/geolocation_infobar_delegate.cc#newcode52 chrome/browser/geolocation/geolocation_infobar_delegate.cc:52: requesting_frame_(requesting_frame), On 2013/09/12 17:12:34, ...
7 years, 3 months ago (2013-09-13 13:41:25 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mvanouwerkerk@chromium.org/23440030/24001
7 years, 3 months ago (2013-09-13 13:41:58 UTC) #9
commit-bot: I haz the power
7 years, 3 months ago (2013-09-13 17:50:31 UTC) #10
Message was sent while issue was closed.
Change committed as 223078

Powered by Google App Engine
This is Rietveld 408576698