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

Issue 356543003: Audit the last usage of Geolocation and Notification permissions. (Closed)

Created:
6 years, 6 months ago by Daniel Nishi
Modified:
6 years, 5 months ago
CC:
chromium-reviews, markusheintz_, scheib
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Audit the last time the Geolocation and Notification content settings have been used. This will be used as part of a resource/permission manager which will allow users to more easily see and modify which permissions are being granted to which websites. Design Doc: https://docs.google.com/document/d/1oQwmj3AU4QYhTyGrYEGr6zaZhHUfx-wqUgEcQGbUU-U/edit?usp=sharing BUG=372607 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283909

Patch Set 1 : #

Total comments: 7

Patch Set 2 : Added tests and a few more methods. #

Total comments: 5

Patch Set 3 : Improved encapsulation. #

Total comments: 6

Patch Set 4 : Add auditing for actual usage, too. #

Total comments: 20

Patch Set 5 : Addressing comments and a multi-frame unit test. #

Total comments: 2

Patch Set 6 : Traverse the parent frames. #

Total comments: 2

Patch Set 7 : #

Patch Set 8 : Update the utils. #

Total comments: 34

Patch Set 9 : Clean up. #

Total comments: 8

Patch Set 10 : Jam nits. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+548 lines, -35 lines) Patch
M chrome/browser/chrome_content_browser_client.h View 1 2 3 4 5 6 7 8 9 5 chunks +22 lines, -22 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 3 chunks +14 lines, -0 lines 0 comments Download
M chrome/browser/content_settings/content_settings_pref_provider.h View 1 2 3 4 5 6 7 8 3 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/content_settings/content_settings_pref_provider.cc View 1 2 3 4 5 6 7 8 6 chunks +92 lines, -5 lines 0 comments Download
M chrome/browser/content_settings/content_settings_pref_provider_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +36 lines, -0 lines 2 comments Download
M chrome/browser/content_settings/host_content_settings_map.h View 1 2 3 4 5 6 7 8 3 chunks +43 lines, -0 lines 0 comments Download
M chrome/browser/content_settings/host_content_settings_map.cc View 1 2 3 4 5 6 7 8 4 chunks +77 lines, -0 lines 0 comments Download
M chrome/browser/geolocation/geolocation_browsertest.cc View 1 2 3 4 5 6 7 8 2 chunks +47 lines, -0 lines 1 comment Download
M chrome/browser/geolocation/geolocation_permission_context.cc View 1 2 3 4 5 6 7 1 chunk +6 lines, -3 lines 0 comments Download
M chrome/browser/geolocation/geolocation_permission_context_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +138 lines, -0 lines 1 comment Download
M chrome/browser/notifications/desktop_notification_service.cc View 1 2 3 4 1 chunk +6 lines, -5 lines 0 comments Download
M chrome/browser/notifications/notification_browsertest.cc View 1 2 3 4 5 6 7 8 2 chunks +37 lines, -0 lines 0 comments Download
M content/browser/geolocation/geolocation_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 1 chunk +9 lines, -0 lines 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
Daniel Nishi
dewittj: PTAL @ c/b/notifications/desktop_notification_service.cc mvanouwerkerk: PTAL @ c/b/geolocation/geolocation_permission_context.cc markusheintz: PTAL @ c/b/content_settings/* Thanks!
6 years, 6 months ago (2014-06-25 22:41:30 UTC) #1
Michael van Ouwerkerk
https://codereview.chromium.org/356543003/diff/60001/chrome/browser/geolocation/geolocation_permission_context.cc File chrome/browser/geolocation/geolocation_permission_context.cc (right): https://codereview.chromium.org/356543003/diff/60001/chrome/browser/geolocation/geolocation_permission_context.cc#newcode208 chrome/browser/geolocation/geolocation_permission_context.cc:208: profile_->GetHostContentSettingsMap()->UpdateLastUsage( Why is this only called for this one ...
6 years, 6 months ago (2014-06-26 10:26:39 UTC) #2
dewittj
https://codereview.chromium.org/356543003/diff/60001/chrome/browser/content_settings/host_content_settings_map.h File chrome/browser/content_settings/host_content_settings_map.h (right): https://codereview.chromium.org/356543003/diff/60001/chrome/browser/content_settings/host_content_settings_map.h#newcode202 chrome/browser/content_settings/host_content_settings_map.h:202: void UpdateLastUsage(const GURL& primary_url, needs comment https://codereview.chromium.org/356543003/diff/60001/chrome/browser/notifications/desktop_notification_service.cc File chrome/browser/notifications/desktop_notification_service.cc ...
6 years, 6 months ago (2014-06-26 15:56:51 UTC) #3
Daniel Nishi
Added some more tests to make sure the functionality was working. https://codereview.chromium.org/356543003/diff/60001/chrome/browser/geolocation/geolocation_permission_context.cc File chrome/browser/geolocation/geolocation_permission_context.cc (right): ...
6 years, 6 months ago (2014-06-26 20:31:25 UTC) #4
dewittj
https://codereview.chromium.org/356543003/diff/80001/chrome/browser/content_settings/host_content_settings_map.cc File chrome/browser/content_settings/host_content_settings_map.cc (right): https://codereview.chromium.org/356543003/diff/80001/chrome/browser/content_settings/host_content_settings_map.cc#newcode305 chrome/browser/content_settings/host_content_settings_map.cc:305: UpdateLastUsageByPattern(primary_pattern, secondary_pattern, content_type); why is it only these two ...
6 years, 6 months ago (2014-06-26 23:17:48 UTC) #5
dewittj
https://codereview.chromium.org/356543003/diff/80001/chrome/browser/notifications/desktop_notification_service.cc File chrome/browser/notifications/desktop_notification_service.cc (right): https://codereview.chromium.org/356543003/diff/80001/chrome/browser/notifications/desktop_notification_service.cc#newcode516 chrome/browser/notifications/desktop_notification_service.cc:516: if (setting == CONTENT_SETTING_ALLOW) { In other words, I'm ...
6 years, 6 months ago (2014-06-27 02:52:03 UTC) #6
Michael van Ouwerkerk
I would like to understand better why 'last usage' means 'most recently permitted' here. Isn't ...
6 years, 5 months ago (2014-06-27 10:40:05 UTC) #7
Daniel Nishi
I've updated the description with a link to the design doc (https://docs.google.com/document/d/1oQwmj3AU4QYhTyGrYEGr6zaZhHUfx-wqUgEcQGbUU-U/edit?usp=sharing). https://codereview.chromium.org/356543003/diff/80001/chrome/browser/content_settings/host_content_settings_map.cc File chrome/browser/content_settings/host_content_settings_map.cc ...
6 years, 5 months ago (2014-06-27 17:25:19 UTC) #8
scheib
https://codereview.chromium.org/356543003/diff/100001/chrome/browser/content_settings/content_settings_pref_provider.h File chrome/browser/content_settings/content_settings_pref_provider.h (right): https://codereview.chromium.org/356543003/diff/100001/chrome/browser/content_settings/content_settings_pref_provider.h#newcode111 chrome/browser/content_settings/content_settings_pref_provider.h:111: bool owns_clock_; Always own the clock. Have tests pass ...
6 years, 5 months ago (2014-06-27 17:47:40 UTC) #9
dewittj
desktop_notification* lgtm
6 years, 5 months ago (2014-06-28 00:04:20 UTC) #10
Daniel Nishi
jam: PTAL at chrome/browser/chrome_content_browser_client and content/public/browser/content_browser_client dewittj: PTAL at c/b/notifications/notification_browsertest.cc Michael van Ouwerkerk: PTAL at ...
6 years, 5 months ago (2014-06-30 22:40:16 UTC) #11
jam
why do we need to add a notification in ContentBrowserClient? Can't Chrome already get this ...
6 years, 5 months ago (2014-06-30 23:46:51 UTC) #12
Daniel Nishi
On 2014/06/30 23:46:51, jam wrote: > why do we need to add a notification in ...
6 years, 5 months ago (2014-07-01 00:46:11 UTC) #13
Michael van Ouwerkerk
https://codereview.chromium.org/356543003/diff/180001/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://codereview.chromium.org/356543003/diff/180001/chrome/browser/chrome_content_browser_client.cc#newcode2154 chrome/browser/chrome_content_browser_client.cc:2154: void ChromeContentBrowserClient::UseContentSettingPermissionHelper( Why do you need this method? It ...
6 years, 5 months ago (2014-07-01 11:02:24 UTC) #14
Michael van Ouwerkerk
https://codereview.chromium.org/356543003/diff/180001/chrome/browser/content_settings/host_content_settings_map.h File chrome/browser/content_settings/host_content_settings_map.h (right): https://codereview.chromium.org/356543003/diff/180001/chrome/browser/content_settings/host_content_settings_map.h#newcode209 chrome/browser/content_settings/host_content_settings_map.h:209: const GURL& primary_url, Do primary_url and secondary_url correspond to ...
6 years, 5 months ago (2014-07-01 12:53:36 UTC) #15
Daniel Nishi
https://codereview.chromium.org/356543003/diff/180001/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://codereview.chromium.org/356543003/diff/180001/chrome/browser/chrome_content_browser_client.cc#newcode2154 chrome/browser/chrome_content_browser_client.cc:2154: void ChromeContentBrowserClient::UseContentSettingPermissionHelper( On 2014/07/01 11:02:23, Michael van Ouwerkerk wrote: ...
6 years, 5 months ago (2014-07-01 18:37:49 UTC) #16
Michael van Ouwerkerk
https://codereview.chromium.org/356543003/diff/180001/chrome/browser/content_settings/host_content_settings_map.h File chrome/browser/content_settings/host_content_settings_map.h (right): https://codereview.chromium.org/356543003/diff/180001/chrome/browser/content_settings/host_content_settings_map.h#newcode209 chrome/browser/content_settings/host_content_settings_map.h:209: const GURL& primary_url, On 2014/07/01 18:37:48, Daniel Nishi wrote: ...
6 years, 5 months ago (2014-07-02 18:51:16 UTC) #17
jam
sorry I just saw your reply, feel free to IM me in the future if ...
6 years, 5 months ago (2014-07-03 01:05:41 UTC) #18
Daniel Nishi
@jam I think I may have miscommunicated. The Android browser doesn't seem to track actual ...
6 years, 5 months ago (2014-07-07 17:46:40 UTC) #19
Michael van Ouwerkerk
Thanks Dan. Getting there :-) https://codereview.chromium.org/356543003/diff/220001/content/browser/geolocation/geolocation_dispatcher_host.cc File content/browser/geolocation/geolocation_dispatcher_host.cc (right): https://codereview.chromium.org/356543003/diff/220001/content/browser/geolocation/geolocation_dispatcher_host.cc#newcode141 content/browser/geolocation/geolocation_dispatcher_host.cc:141: topFrame->GetLastCommittedURL().GetOrigin(), Sorry to keep ...
6 years, 5 months ago (2014-07-08 17:02:18 UTC) #20
Daniel Nishi
https://codereview.chromium.org/356543003/diff/220001/content/browser/geolocation/geolocation_dispatcher_host.cc File content/browser/geolocation/geolocation_dispatcher_host.cc (right): https://codereview.chromium.org/356543003/diff/220001/content/browser/geolocation/geolocation_dispatcher_host.cc#newcode141 content/browser/geolocation/geolocation_dispatcher_host.cc:141: topFrame->GetLastCommittedURL().GetOrigin(), On 2014/07/08 17:02:18, Michael van Ouwerkerk wrote: > ...
6 years, 5 months ago (2014-07-08 18:14:35 UTC) #21
Michael van Ouwerkerk
lgtm Thanks Daniel!
6 years, 5 months ago (2014-07-08 18:20:15 UTC) #22
Daniel Nishi
@markuscheintz_: Ping, PTAL at chrome/browser/content_settings/*
6 years, 5 months ago (2014-07-08 19:12:34 UTC) #23
Daniel Nishi
+bauerb PTAL at c/b/content_settings/* when you get a moment.
6 years, 5 months ago (2014-07-11 17:38:10 UTC) #24
Bernhard Bauer
https://codereview.chromium.org/356543003/diff/260001/chrome/browser/chrome_content_browser_client.h File chrome/browser/chrome_content_browser_client.h (right): https://codereview.chromium.org/356543003/diff/260001/chrome/browser/chrome_content_browser_client.h#newcode18 chrome/browser/chrome_content_browser_client.h:18: #if defined(OS_ANDROID) While you're here, this file could use ...
6 years, 5 months ago (2014-07-14 10:50:33 UTC) #25
Daniel Nishi
PTAL. https://codereview.chromium.org/356543003/diff/260001/chrome/browser/chrome_content_browser_client.h File chrome/browser/chrome_content_browser_client.h (right): https://codereview.chromium.org/356543003/diff/260001/chrome/browser/chrome_content_browser_client.h#newcode18 chrome/browser/chrome_content_browser_client.h:18: #if defined(OS_ANDROID) On 2014/07/14 10:50:32, Bernhard Bauer wrote: ...
6 years, 5 months ago (2014-07-14 17:12:55 UTC) #26
jam
lgtm with nits https://codereview.chromium.org/356543003/diff/300001/content/browser/geolocation/geolocation_dispatcher_host.cc File content/browser/geolocation/geolocation_dispatcher_host.cc (right): https://codereview.chromium.org/356543003/diff/300001/content/browser/geolocation/geolocation_dispatcher_host.cc#newcode133 content/browser/geolocation/geolocation_dispatcher_host.cc:133: RenderFrameHost* topFrame = i->first; nit: top_frame ...
6 years, 5 months ago (2014-07-14 18:20:53 UTC) #27
Daniel Nishi
https://codereview.chromium.org/356543003/diff/300001/content/browser/geolocation/geolocation_dispatcher_host.cc File content/browser/geolocation/geolocation_dispatcher_host.cc (right): https://codereview.chromium.org/356543003/diff/300001/content/browser/geolocation/geolocation_dispatcher_host.cc#newcode133 content/browser/geolocation/geolocation_dispatcher_host.cc:133: RenderFrameHost* topFrame = i->first; On 2014/07/14 18:20:53, jam wrote: ...
6 years, 5 months ago (2014-07-14 22:25:06 UTC) #28
Daniel Nishi
@bauerb Ping.
6 years, 5 months ago (2014-07-16 18:19:14 UTC) #29
Bernhard Bauer
Sorry for the delay. LGTM with a suggestion below: https://codereview.chromium.org/356543003/diff/320001/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc File chrome/browser/content_settings/content_settings_pref_provider_unittest.cc (right): https://codereview.chromium.org/356543003/diff/320001/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc#newcode452 chrome/browser/content_settings/content_settings_pref_provider_unittest.cc:452: ...
6 years, 5 months ago (2014-07-17 09:11:48 UTC) #30
Daniel Nishi
https://codereview.chromium.org/356543003/diff/320001/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc File chrome/browser/content_settings/content_settings_pref_provider_unittest.cc (right): https://codereview.chromium.org/356543003/diff/320001/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc#newcode452 chrome/browser/content_settings/content_settings_pref_provider_unittest.cc:452: base::SimpleTestClock* test_clock = new base::SimpleTestClock; On 2014/07/17 09:11:48, Bernhard ...
6 years, 5 months ago (2014-07-17 18:01:49 UTC) #31
Daniel Nishi
The CQ bit was checked by dhnishi@chromium.org
6 years, 5 months ago (2014-07-17 18:01:58 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dhnishi@chromium.org/356543003/320001
6 years, 5 months ago (2014-07-17 18:04:31 UTC) #33
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium ...
6 years, 5 months ago (2014-07-17 20:45:08 UTC) #34
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-17 21:07:01 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/172118)
6 years, 5 months ago (2014-07-17 21:07:03 UTC) #36
Daniel Nishi
The CQ bit was checked by dhnishi@chromium.org
6 years, 5 months ago (2014-07-17 21:18:21 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dhnishi@chromium.org/356543003/320001
6 years, 5 months ago (2014-07-17 21:20:08 UTC) #38
commit-bot: I haz the power
6 years, 5 months ago (2014-07-17 22:30:27 UTC) #39
Message was sent while issue was closed.
Change committed as 283909

Powered by Google App Engine
This is Rietveld 408576698