-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement first party ephemeral storage support #9624
Conversation
b24c32a
to
1b024cb
Compare
1b024cb
to
4626031
Compare
@@ -17,5 +17,8 @@ const base::FeatureParam<int> kBraveEphemeralStorageKeepAliveTimeInSeconds = { | |||
&kBraveEphemeralStorageKeepAlive, | |||
"BraveEphemeralStorageKeepAliveTimeInSeconds", 30}; | |||
|
|||
const base::Feature kBraveFirstPartyEphemeralStorage{ | |||
"BraveFirstPartyEphemeralStorage", base::FEATURE_DISABLED_BY_DEFAULT}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess people would like to have a toggle on brave://flags
3f18313
to
3a9177c
Compare
enum class EphemeralStorageAwareType { | ||
kNone, | ||
kAware, | ||
kNotAwareButAllowIn1pEphemeralMode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it needs comments
// Helper to load easy-to-use Indexed DB API. | ||
void LoadIndexedDbHelper(RenderFrameHost* host) { | ||
const char kLoadIndexMinScript[] = | ||
"new Promise((resolve) => {" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use a raw string literal?
#define BRAVE_COOKIE_RETRIEVER_NETWORK_SERVICE_RETRIEVE_BODY \ | ||
cookie_options.set_top_frame_origin(top_frame_origin); | ||
|
||
#define BRAVE_NETWORK_HANDLER_GET_COOKIES_RETREIVE_CALL_ARGS \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retrIEve
It's definitely worth adding comments here and there, since this is one of the most complex features and the code is scattered among different overrides |
pls check the following scenario:
|
3a9177c
to
1b26f9d
Compare
1b26f9d
to
eed3a97
Compare
2da1b2a
to
9e1eb2c
Compare
The current state is now close to production and it's okay to review it. |
9e1eb2c
to
e6f7a5f
Compare
Removed DevTools cookies display support in 1PES mode from this PR. Will add this as a separate thing. |
e6f7a5f
to
d7bf804
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patching/chromium_src-wise LGTM, but I very much agree with @iefremov on that all this code needs comments in several places as it's already quite hard to follow how everything fits together.
d7bf804
to
88c0379
Compare
88c0379
to
ade6e48
Compare
@mariospr PTAL |
39c5ae9
to
5f19a68
Compare
5f19a68
to
13eb934
Compare
13eb934
to
c159e2e
Compare
Add support for first party ephemeral storage (1PES) using
CONTENT_SETTING_SESSION_ONLY
cookie setting value.Some important things:
CONTENT_SETTING_SESSION_ONLY
value and alter its behavior for our needs when a 1PES feature is enabled. By default, Chromium cleanups everything for a website when this setting is active.In our approach when
CONTENT_SETTING_SESSION_ONLY
is selected for a website ("1PES on"), we introduce all third party restrictions to first party frames of this website, so everything will be blocked except ephemeral cookies and storages.Resolves brave/brave-browser#15906
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: