Refactoring: Unify the "get" and "set" cookie access settings.
This is just code cleanup, no behavior change is expected.
The underlying "get" and "set" cookie access checks are
done in StaticCookiePolicy, but CanGetCookies() and
CanSetCookie() were identical code, since the commit
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
Since the checks were identical, this patch unifies them
into a single function to simplify the API and callsites.
I'm using bug 350870 just to help link this commit with
the above-mentioned c90ddfcfd61a.
BUG=350870
TBR=jochen,rogerta for mechanical-only changes
Review-Url: https://codereview.chromium.org/2655443003
Cr-Commit-Position: refs/heads/master@{#446576}
Committed: https://chromium.googlesource.com/chromium/src/+/7169140ae183cec72446399946a4cd0b79ea6dec
Description was changed from ========== Unify the "get" and "set" cookie access settings. The underlying ...
3 years, 11 months ago
(2017-01-24 07:18:55 UTC)
#3
Description was changed from
==========
Unify the "get" and "set" cookie access settings.
The underlying code was already the same. So this was just a confusing
distinction in the codebase.
BUG=
==========
to
==========
Unify the "get" and "set" cookie access settings.
The underlying code was already the same, since
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
So it was just a confusing distinction.
BUG=350870
==========
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
3 years, 11 months ago
(2017-01-24 07:40:04 UTC)
#4
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/218661)
3 years, 11 months ago
(2017-01-24 07:40:05 UTC)
#5
3 years, 11 months ago
(2017-01-24 10:32:42 UTC)
#11
ptal.
Mike West
It's entirely possible we'll have to revisit removing this in the somewhat near future, because ...
3 years, 10 months ago
(2017-01-25 10:25:27 UTC)
#12
It's entirely possible we'll have to revisit removing this in the somewhat near
future, because cookies are AWESOME. But that's what version control is for:
LGTM to remove this.
falken
Description was changed from ========== Unify the "get" and "set" cookie access settings. The underlying ...
3 years, 10 months ago
(2017-01-25 13:54:48 UTC)
#13
Description was changed from
==========
Unify the "get" and "set" cookie access settings.
The underlying code was already the same, since
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
So it was just a confusing distinction.
BUG=350870
==========
to
==========
Unify the "get" and "set" cookie access settings.
The underlying code in StaticCookiePolicy was already the
same, since
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
So it was just a confusing distinction.
BUG=350870
==========
3 years, 10 months ago
(2017-01-25 15:03:23 UTC)
#19
https://codereview.chromium.org/2655443003/diff/20001/components/content_sett...
File components/content_settings/core/browser/cookie_settings.cc (right):
https://codereview.chromium.org/2655443003/diff/20001/components/content_sett...
components/content_settings/core/browser/cookie_settings.cc:164: *cookie_setting
= block ? CONTENT_SETTING_BLOCK : setting;
On 2017/01/25 14:55:51, falken wrote:
> On 2017/01/25 14:41:30, msramek wrote:
> > Please add a DCHECK for this pointer as well.
>
> |cookie_setting| is already DCHECK'd at the beginning of the function... do
you
> want another DCHECK here?
Nope! Sorry, looked at it wrong the first time.
3 years, 10 months ago
(2017-01-25 15:05:40 UTC)
#20
https://codereview.chromium.org/2655443003/diff/20001/components/content_sett...
File components/content_settings/core/browser/cookie_settings.cc (right):
https://codereview.chromium.org/2655443003/diff/20001/components/content_sett...
components/content_settings/core/browser/cookie_settings.cc:164: *cookie_setting
= block ? CONTENT_SETTING_BLOCK : setting;
On 2017/01/25 15:03:23, msramek wrote:
> On 2017/01/25 14:55:51, falken wrote:
> > On 2017/01/25 14:41:30, msramek wrote:
> > > Please add a DCHECK for this pointer as well.
> >
> > |cookie_setting| is already DCHECK'd at the beginning of the function... do
> you
> > want another DCHECK here?
>
> Nope! Sorry, looked at it wrong the first time.
Acknowledged.
3 years, 10 months ago
(2017-01-25 16:27:28 UTC)
#27
Dry run: This issue passed the CQ dry run.
boliu
lgtm android_webview rs lgtm
3 years, 10 months ago
(2017-01-25 16:38:51 UTC)
#28
lgtm
android_webview rs lgtm
mef
Could you elaborate on this CL? I was under impression that CanGetCookie and CanSetCookie is ...
3 years, 10 months ago
(2017-01-25 16:56:13 UTC)
#29
Could you elaborate on this CL?
I was under impression that CanGetCookie and CanSetCookie is intentionally
different, although I'm not entirely sure about the reason.
Has our policy changed?
The bug 350870 seems to target more narrow scenario, and description of the CL
doesn't provide the motivation for this change.
Adding rsleevi to weigh in.
Ryan Sleevi
On 2017/01/25 16:56:13, mef wrote: > Could you elaborate on this CL? > > I ...
3 years, 10 months ago
(2017-01-25 17:08:19 UTC)
#30
On 2017/01/25 16:56:13, mef wrote:
> Could you elaborate on this CL?
>
> I was under impression that CanGetCookie and CanSetCookie is intentionally
> different, although I'm not entirely sure about the reason.
> Has our policy changed?
>
> The bug 350870 seems to target more narrow scenario, and description of the CL
> doesn't provide the motivation for this change.
>
> Adding rsleevi to weigh in.
Yeah, like mef@ said, it would be good to understand the broader context of what
this cleanup is trying to accomplish.
I ask because we have LOAD_FLAG_DO_NOT_SEND_COOKIES and
LOAD_FLAG_DO_NOT_SAVE_COOKIES, which mirrors this interface and policy, and it's
unclear in your simplification how these concepts interact - that is, what
policy should be checked (in the absence of those load flags), and what load
flags should be set based on these policies.
To be clear: I'm not opposed to introducing this, and agree that with the code
being what it is, it's functionally a no-op. However, I'm trying to make sure
we're conceptually aligned, because I think this CL introduces some conceptual
complications (at least from the POV of a //net OWNER), and wanted to make sure
intent and actuality were aligned :)
falken
On 2017/01/25 17:08:19, Ryan Sleevi wrote: > On 2017/01/25 16:56:13, mef wrote: > > Could ...
3 years, 10 months ago
(2017-01-26 01:17:34 UTC)
#31
On 2017/01/25 17:08:19, Ryan Sleevi wrote:
> On 2017/01/25 16:56:13, mef wrote:
> > Could you elaborate on this CL?
> >
> > I was under impression that CanGetCookie and CanSetCookie is intentionally
> > different, although I'm not entirely sure about the reason.
> > Has our policy changed?
> >
> > The bug 350870 seems to target more narrow scenario, and description of the
CL
> > doesn't provide the motivation for this change.
> >
> > Adding rsleevi to weigh in.
>
> Yeah, like mef@ said, it would be good to understand the broader context of
what
> this cleanup is trying to accomplish.
>
> I ask because we have LOAD_FLAG_DO_NOT_SEND_COOKIES and
> LOAD_FLAG_DO_NOT_SAVE_COOKIES, which mirrors this interface and policy, and
it's
> unclear in your simplification how these concepts interact - that is, what
> policy should be checked (in the absence of those load flags), and what load
> flags should be set based on these policies.
>
> To be clear: I'm not opposed to introducing this, and agree that with the code
> being what it is, it's functionally a no-op. However, I'm trying to make sure
> we're conceptually aligned, because I think this CL introduces some conceptual
> complications (at least from the POV of a //net OWNER), and wanted to make
sure
> intent and actuality were aligned :)
Yea, I should make a more descriptive CL description.
The story behind this is I was auditing how service workers are gated on cookie
settings (ChromeContentBrowserClient::AllowServiceWorker), and wondering why we
use IsSettingCookieAllowed instead of IsReadingCookieAllowed, and if we should
be using both like ChromeContentBrowserClient::AllowWebRTCIdentityCache does.
Then I discovered it all boils down to StaticCookiePolicy::CanGetCookies and
CanSetCookies, which confusingly turned out to be the same repeated code
(prompting a diff to verify they really are the same).
Since they are identical, it seemed best to just make them one function to spare
API callers the decision of which to use.
I guess we could still force callers to distinguish between which access they
want, but it seemed cleaner to just remove it, and eliminate awkward calling
code like:
cookie_settings->GetCookieSetting(primary_url, secondary_url, nullptr,
nullptr /* reading_setting */, &setting);
And CookieSettings::GetReadingAndSettingCookieAllowed whose purpose is to
retrieve both settings in a performant way.
droger
ios lgtm
3 years, 10 months ago
(2017-01-26 13:18:06 UTC)
#32
ios lgtm
mef
On 2017/01/26 01:17:34, falken wrote: > On 2017/01/25 17:08:19, Ryan Sleevi wrote: > > On ...
3 years, 10 months ago
(2017-01-26 22:49:49 UTC)
#33
On 2017/01/26 01:17:34, falken wrote:
> On 2017/01/25 17:08:19, Ryan Sleevi wrote:
> > On 2017/01/25 16:56:13, mef wrote:
> > > Could you elaborate on this CL?
> > >
> > > I was under impression that CanGetCookie and CanSetCookie is intentionally
> > > different, although I'm not entirely sure about the reason.
> > > Has our policy changed?
> > >
> > > The bug 350870 seems to target more narrow scenario, and description of
the
> CL
> > > doesn't provide the motivation for this change.
> > >
> > > Adding rsleevi to weigh in.
> >
> > Yeah, like mef@ said, it would be good to understand the broader context of
> what
> > this cleanup is trying to accomplish.
> >
> > I ask because we have LOAD_FLAG_DO_NOT_SEND_COOKIES and
> > LOAD_FLAG_DO_NOT_SAVE_COOKIES, which mirrors this interface and policy, and
> it's
> > unclear in your simplification how these concepts interact - that is, what
> > policy should be checked (in the absence of those load flags), and what load
> > flags should be set based on these policies.
> >
> > To be clear: I'm not opposed to introducing this, and agree that with the
code
> > being what it is, it's functionally a no-op. However, I'm trying to make
sure
> > we're conceptually aligned, because I think this CL introduces some
conceptual
> > complications (at least from the POV of a //net OWNER), and wanted to make
> sure
> > intent and actuality were aligned :)
>
> Yea, I should make a more descriptive CL description.
>
> The story behind this is I was auditing how service workers are gated on
cookie
> settings (ChromeContentBrowserClient::AllowServiceWorker), and wondering why
we
> use IsSettingCookieAllowed instead of IsReadingCookieAllowed, and if we should
> be using both like ChromeContentBrowserClient::AllowWebRTCIdentityCache does.
> Then I discovered it all boils down to StaticCookiePolicy::CanGetCookies and
> CanSetCookies, which confusingly turned out to be the same repeated code
> (prompting a diff to verify they really are the same).
>
> Since they are identical, it seemed best to just make them one function to
spare
> API callers the decision of which to use.
>
> I guess we could still force callers to distinguish between which access they
> want, but it seemed cleaner to just remove it, and eliminate awkward calling
> code like:
> cookie_settings->GetCookieSetting(primary_url, secondary_url, nullptr,
> nullptr /* reading_setting */, &setting);
>
> And CookieSettings::GetReadingAndSettingCookieAllowed whose purpose is to
> retrieve both settings in a performant way.
Thanks for explanation, lgtm.
falken
Description was changed from ========== Unify the "get" and "set" cookie access settings. The underlying ...
3 years, 10 months ago
(2017-01-27 01:04:36 UTC)
#34
Description was changed from
==========
Unify the "get" and "set" cookie access settings.
The underlying code in StaticCookiePolicy was already the
same, since
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
So it was just a confusing distinction.
BUG=350870
==========
to
==========
Refactoring: Unify the "get" and "set" cookie access settings.
This is just code-cleanup, no behavior change is expected.
The underlying "get" and "set" cookie access checks are
done in StaticCookiePolicy, but CanGetCookies() and
CanSetCookie() were identical code, since the commit
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
Since the checks are identical, this patch unifies them
into a single function to simplify the API and callsites.
I'm using bug 350870 just to help link this commit with
the above-mentioned c90ddfcfd61a.
BUG=350870
==========
falken
Description was changed from ========== Refactoring: Unify the "get" and "set" cookie access settings. This ...
3 years, 10 months ago
(2017-01-27 01:06:04 UTC)
#35
Description was changed from
==========
Refactoring: Unify the "get" and "set" cookie access settings.
This is just code-cleanup, no behavior change is expected.
The underlying "get" and "set" cookie access checks are
done in StaticCookiePolicy, but CanGetCookies() and
CanSetCookie() were identical code, since the commit
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
Since the checks are identical, this patch unifies them
into a single function to simplify the API and callsites.
I'm using bug 350870 just to help link this commit with
the above-mentioned c90ddfcfd61a.
BUG=350870
==========
to
==========
Refactoring: Unify the "get" and "set" cookie access settings.
This is just code cleanup, no behavior change is expected.
The underlying "get" and "set" cookie access checks are
done in StaticCookiePolicy, but CanGetCookies() and
CanSetCookie() were identical code, since the commit
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
Since the checks were identical, this patch unifies them
into a single function to simplify the API and callsites.
I'm using bug 350870 just to help link this commit with
the above-mentioned c90ddfcfd61a.
BUG=350870
==========
falken
Thanks, I've also updated the CL description. I will TBR owners for the remaining purely ...
3 years, 10 months ago
(2017-01-27 01:22:56 UTC)
#36
Thanks, I've also updated the CL description. I will TBR owners for the
remaining purely mechanical changes.
TBR'ing owners for the remaining mechanical only changes. jochen: chrome/browser/renderer_host/chrome_render_message_filter.cc chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc chrome/browser/storage/durable_storage_permission_context.cc chrome/browser/ui/content_settings/content_setting_bubble_model.cc rogerta: components/signin/core/browser/signin_header_helper.cc
3 years, 10 months ago
(2017-01-27 01:24:58 UTC)
#38
TBR'ing owners for the remaining mechanical only changes.
jochen:
chrome/browser/renderer_host/chrome_render_message_filter.cc
chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
chrome/browser/storage/durable_storage_permission_context.cc
chrome/browser/ui/content_settings/content_setting_bubble_model.cc
rogerta:
components/signin/core/browser/signin_header_helper.cc
falken
Description was changed from ========== Refactoring: Unify the "get" and "set" cookie access settings. This ...
3 years, 10 months ago
(2017-01-27 01:25:22 UTC)
#39
Description was changed from
==========
Refactoring: Unify the "get" and "set" cookie access settings.
This is just code cleanup, no behavior change is expected.
The underlying "get" and "set" cookie access checks are
done in StaticCookiePolicy, but CanGetCookies() and
CanSetCookie() were identical code, since the commit
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
Since the checks were identical, this patch unifies them
into a single function to simplify the API and callsites.
I'm using bug 350870 just to help link this commit with
the above-mentioned c90ddfcfd61a.
BUG=350870
==========
to
==========
Refactoring: Unify the "get" and "set" cookie access settings.
This is just code cleanup, no behavior change is expected.
The underlying "get" and "set" cookie access checks are
done in StaticCookiePolicy, but CanGetCookies() and
CanSetCookie() were identical code, since the commit
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
Since the checks were identical, this patch unifies them
into a single function to simplify the API and callsites.
I'm using bug 350870 just to help link this commit with
the above-mentioned c90ddfcfd61a.
BUG=350870
TBR=jochen,rogerta for mechanical-only changes
==========
falken
The CQ bit was checked by falken@chromium.org
3 years, 10 months ago
(2017-01-27 01:32:23 UTC)
#40
The patchset sent to the CQ was uploaded after l-g-t-m from msramek@chromium.org, bnc@chromium.org, mkwst@chromium.org, rdevlin.cronin@chromium.org, ...
3 years, 10 months ago
(2017-01-27 01:32:23 UTC)
#41
CQ is committing da patch. Bot data: {"patchset_id": 80001, "attempt_start_ts": 1485480743466570, "parent_rev": "622f70d2786a5dd446c45fa8222ce2d14d98cbf5", "commit_rev": "7169140ae183cec72446399946a4cd0b79ea6dec"}
3 years, 10 months ago
(2017-01-27 03:38:05 UTC)
#43
CQ is committing da patch.
Bot data: {"patchset_id": 80001, "attempt_start_ts": 1485480743466570,
"parent_rev": "622f70d2786a5dd446c45fa8222ce2d14d98cbf5", "commit_rev":
"7169140ae183cec72446399946a4cd0b79ea6dec"}
commit-bot: I haz the power
Description was changed from ========== Refactoring: Unify the "get" and "set" cookie access settings. This ...
3 years, 10 months ago
(2017-01-27 03:38:40 UTC)
#44
Message was sent while issue was closed.
Description was changed from
==========
Refactoring: Unify the "get" and "set" cookie access settings.
This is just code cleanup, no behavior change is expected.
The underlying "get" and "set" cookie access checks are
done in StaticCookiePolicy, but CanGetCookies() and
CanSetCookie() were identical code, since the commit
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
Since the checks were identical, this patch unifies them
into a single function to simplify the API and callsites.
I'm using bug 350870 just to help link this commit with
the above-mentioned c90ddfcfd61a.
BUG=350870
TBR=jochen,rogerta for mechanical-only changes
==========
to
==========
Refactoring: Unify the "get" and "set" cookie access settings.
This is just code cleanup, no behavior change is expected.
The underlying "get" and "set" cookie access checks are
done in StaticCookiePolicy, but CanGetCookies() and
CanSetCookie() were identical code, since the commit
https://crrev.com/c90ddfcfd61ae1fb403814e7794ca3a86aa548b2.
Since the checks were identical, this patch unifies them
into a single function to simplify the API and callsites.
I'm using bug 350870 just to help link this commit with
the above-mentioned c90ddfcfd61a.
BUG=350870
TBR=jochen,rogerta for mechanical-only changes
Review-Url: https://codereview.chromium.org/2655443003
Cr-Commit-Position: refs/heads/master@{#446576}
Committed:
https://chromium.googlesource.com/chromium/src/+/7169140ae183cec72446399946a4...
==========
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/7169140ae183cec72446399946a4cd0b79ea6dec
3 years, 10 months ago
(2017-01-27 03:38:43 UTC)
#45
Issue 2655443003: Unify the "get" and "set" cookie access settings.
(Closed)
Created 3 years, 11 months ago by falken
Modified 3 years, 10 months ago
Reviewers: Mike West, Bence, msramek, Devlin, droger, boliu, mef, jochen (gone - plz use gerrit), Roger Tawa OOO till Jul 10th
Base URL:
Comments: 6