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

Issue 2502743003: Allow getting both reading/setting cookie settings at one time (Closed)

Created:
4 years, 1 month ago by Charlie Harrison
Modified:
4 years ago
CC:
chromium-reviews, extensions-reviews_chromium.org, cbentzel+watch_chromium.org, msramek+watch_chromium.org, raymes+watch_chromium.org, chromium-apps-reviews_chromium.org, markusheintz_
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow getting both reading/setting cookie settings at one time Getting the underlying WebsiteSetting to find whether reading/setting cookies is allowed is fairly expensive. The current cookie API requires retrieving these settings twice if we want to know both values. This patch updates the API to allow for querying reading and setting policies with one call to GetWebsiteSettings. This is used in net::NetworkDelegate::CanEnablePrivacyMode, which went from taking 18% of the CPU time in net::URLRequestHttpJob::Start, to 12% after this patch (Linux perf results). BUG=664174 Committed: https://crrev.com/db2deb26ff656262712010cfd9a8580a005dc16f Cr-Commit-Position: refs/heads/master@{#434691}

Patch Set 1 #

Patch Set 2 : small refactor to avoid a few branches #

Total comments: 4

Patch Set 3 : bauerb review #

Total comments: 2

Patch Set 4 : swap SchemeIs with SchemeIsCryptographic #

Total comments: 7

Patch Set 5 : rdevlin review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -48 lines) Patch
M chrome/browser/extensions/api/content_settings/content_settings_api.cc View 1 2 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/net/chrome_network_delegate.cc View 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/ui/content_settings/content_setting_bubble_model.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/content_settings/core/browser/cookie_settings.h View 1 2 3 4 4 chunks +16 lines, -7 lines 0 comments Download
M components/content_settings/core/browser/cookie_settings.cc View 1 2 3 4 3 chunks +61 lines, -31 lines 0 comments Download

Messages

Total messages: 56 (28 generated)
Charlie Harrison
bauerb: WDYT about this patch? I'm not super enthusiastic about an API using bool pointers, ...
4 years, 1 month ago (2016-11-15 22:48:12 UTC) #9
raymes
I'm curious if you know why it's expensive to get the underlying website setting? I ...
4 years, 1 month ago (2016-11-16 03:02:28 UTC) #13
Charlie Harrison
On 2016/11/16 03:02:28, raymes wrote: > I'm curious if you know why it's expensive to ...
4 years, 1 month ago (2016-11-16 03:12:37 UTC) #14
Charlie Harrison
One reasonably hot method is ContentSettingsPattern::Wildcard which seems like it could be optimized. It's a ...
4 years, 1 month ago (2016-11-16 13:32:44 UTC) #15
msramek
On 2016/11/16 13:32:44, Charlie Harrison wrote: > One reasonably hot method is ContentSettingsPattern::Wildcard which seems ...
4 years, 1 month ago (2016-11-16 14:05:49 UTC) #16
Charlie Harrison
On 2016/11/16 14:05:49, msramek wrote: > On 2016/11/16 13:32:44, Charlie Harrison wrote: > > One ...
4 years, 1 month ago (2016-11-16 15:14:59 UTC) #17
msramek
On 2016/11/16 15:14:59, Charlie Harrison wrote: > On 2016/11/16 14:05:49, msramek wrote: > > On ...
4 years, 1 month ago (2016-11-16 15:45:27 UTC) #18
msramek
On 2016/11/16 15:45:27, msramek wrote: > On 2016/11/16 15:14:59, Charlie Harrison wrote: > > On ...
4 years, 1 month ago (2016-11-16 15:48:09 UTC) #19
Bernhard Bauer
lgtm https://codereview.chromium.org/2502743003/diff/20001/chrome/browser/extensions/api/content_settings/content_settings_api.cc File chrome/browser/extensions/api/content_settings/content_settings_api.cc (right): https://codereview.chromium.org/2502743003/diff/20001/chrome/browser/extensions/api/content_settings/content_settings_api.cc#newcode157 chrome/browser/extensions/api/content_settings/content_settings_api.cc:157: cookie_settings->GetCookieSetting(primary_url, secondary_url, NULL, While you're here, use nullptr ...
4 years, 1 month ago (2016-11-16 16:55:45 UTC) #20
Charlie Harrison
Thanks everyone for taking a look! https://codereview.chromium.org/2502743003/diff/20001/chrome/browser/extensions/api/content_settings/content_settings_api.cc File chrome/browser/extensions/api/content_settings/content_settings_api.cc (right): https://codereview.chromium.org/2502743003/diff/20001/chrome/browser/extensions/api/content_settings/content_settings_api.cc#newcode157 chrome/browser/extensions/api/content_settings/content_settings_api.cc:157: cookie_settings->GetCookieSetting(primary_url, secondary_url, NULL, ...
4 years, 1 month ago (2016-11-16 17:01:05 UTC) #21
Charlie Harrison
oops jumped the gun a bit Matt: would you look at chrome/browser/net? Devlin: would you ...
4 years, 1 month ago (2016-11-16 17:03:18 UTC) #26
mmenke
On 2016/11/16 17:03:18, Charlie Harrison wrote: > oops jumped the gun a bit > Matt: ...
4 years, 1 month ago (2016-11-16 17:28:45 UTC) #27
mmenke
On 2016/11/16 17:28:45, mmenke wrote: > On 2016/11/16 17:03:18, Charlie Harrison wrote: > > oops ...
4 years, 1 month ago (2016-11-16 17:29:29 UTC) #28
Charlie Harrison
On 2016/11/16 17:28:45, mmenke wrote: > On 2016/11/16 17:03:18, Charlie Harrison wrote: > > oops ...
4 years, 1 month ago (2016-11-16 17:33:30 UTC) #29
mmenke
https://codereview.chromium.org/2502743003/diff/40001/components/content_settings/core/browser/cookie_settings.cc File components/content_settings/core/browser/cookie_settings.cc (right): https://codereview.chromium.org/2502743003/diff/40001/components/content_settings/core/browser/cookie_settings.cc#newcode150 components/content_settings/core/browser/cookie_settings.cc:150: first_party_url.SchemeIs(kChromeUIScheme)) { Shouldn't it make sense to flip these? ...
4 years, 1 month ago (2016-11-16 17:37:44 UTC) #30
Charlie Harrison
https://codereview.chromium.org/2502743003/diff/40001/components/content_settings/core/browser/cookie_settings.cc File components/content_settings/core/browser/cookie_settings.cc (right): https://codereview.chromium.org/2502743003/diff/40001/components/content_settings/core/browser/cookie_settings.cc#newcode150 components/content_settings/core/browser/cookie_settings.cc:150: first_party_url.SchemeIs(kChromeUIScheme)) { On 2016/11/16 17:37:44, mmenke wrote: > Shouldn't ...
4 years, 1 month ago (2016-11-16 17:50:03 UTC) #33
Devlin
lgtm with some questions about the existing code. https://codereview.chromium.org/2502743003/diff/60001/components/content_settings/core/browser/cookie_settings.cc File components/content_settings/core/browser/cookie_settings.cc (right): https://codereview.chromium.org/2502743003/diff/60001/components/content_settings/core/browser/cookie_settings.cc#newcode160 components/content_settings/core/browser/cookie_settings.cc:160: first_party_url.SchemeIs(kExtensionScheme)) ...
4 years, 1 month ago (2016-11-16 20:12:00 UTC) #36
Charlie Harrison
https://codereview.chromium.org/2502743003/diff/60001/components/content_settings/core/browser/cookie_settings.cc File components/content_settings/core/browser/cookie_settings.cc (right): https://codereview.chromium.org/2502743003/diff/60001/components/content_settings/core/browser/cookie_settings.cc#newcode160 components/content_settings/core/browser/cookie_settings.cc:160: first_party_url.SchemeIs(kExtensionScheme)) { On 2016/11/16 20:12:00, Devlin wrote: > Also ...
4 years, 1 month ago (2016-11-16 22:04:15 UTC) #38
mmenke
https://codereview.chromium.org/2502743003/diff/60001/components/content_settings/core/browser/cookie_settings.cc File components/content_settings/core/browser/cookie_settings.cc (right): https://codereview.chromium.org/2502743003/diff/60001/components/content_settings/core/browser/cookie_settings.cc#newcode160 components/content_settings/core/browser/cookie_settings.cc:160: first_party_url.SchemeIs(kExtensionScheme)) { On 2016/11/16 22:04:14, Charlie Harrison wrote: > ...
4 years, 1 month ago (2016-11-16 22:13:22 UTC) #40
Charlie Harrison
On 2016/11/16 22:13:22, mmenke wrote: > https://codereview.chromium.org/2502743003/diff/60001/components/content_settings/core/browser/cookie_settings.cc > File components/content_settings/core/browser/cookie_settings.cc (right): > > https://codereview.chromium.org/2502743003/diff/60001/components/content_settings/core/browser/cookie_settings.cc#newcode160 > ...
4 years, 1 month ago (2016-11-21 02:02:50 UTC) #43
Devlin
On 2016/11/21 02:02:50, Charlie Harrison wrote: > On 2016/11/16 22:13:22, mmenke wrote: > > So ...
4 years, 1 month ago (2016-11-22 16:52:10 UTC) #44
mmenke
On 2016/11/22 16:52:10, Devlin wrote: > On 2016/11/21 02:02:50, Charlie Harrison wrote: > > On ...
4 years, 1 month ago (2016-11-22 17:19:33 UTC) #45
Charlie Harrison
I did a bit of code archaeology and found that the code exempting extensions from ...
4 years ago (2016-11-28 16:15:58 UTC) #46
Devlin
On 2016/11/28 16:15:58, Charlie Harrison(OOO Nov23-28) wrote: > I did a bit of code archaeology ...
4 years ago (2016-11-28 17:06:18 UTC) #47
Charlie Harrison
On 2016/11/28 17:06:18, Devlin wrote: > On 2016/11/28 16:15:58, Charlie Harrison(OOO Nov23-28) wrote: > > ...
4 years ago (2016-11-28 17:22:35 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/2502743003/80001
4 years ago (2016-11-28 17:23:32 UTC) #51
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years ago (2016-11-28 18:10:48 UTC) #54
commit-bot: I haz the power
4 years ago (2016-11-28 18:12:49 UTC) #56
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/db2deb26ff656262712010cfd9a8580a005dc16f
Cr-Commit-Position: refs/heads/master@{#434691}

Powered by Google App Engine
This is Rietveld 408576698