Skip to content
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

Make shields settings persist #558

Merged
merged 4 commits into from
Oct 4, 2018
Merged

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Oct 3, 2018

So far, shields settings are reset after reboot because plugin content type isn't persisted by default.(except default setting).
Our new BravePrefProvider and BraveEphemeralProvider handles to store our plugin type settings to disk.

Close brave/brave-browser#1364

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

yarn test brave_browser_tests --filter=BraveShieldsAPIBrowserTest.ShieldsSettingsPersistTest`

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

@simonhong simonhong self-assigned this Oct 3, 2018
@simonhong simonhong force-pushed the make_plugin_contents_type_persist branch 2 times, most recently from 940d796 to 6d6369a Compare October 4, 2018 09:32
@simonhong simonhong changed the title WIP: Make shields settings persist Make shields settings persist Oct 4, 2018
For now, this test is failed.
Need to make this test pass.
BravePrefProvider and BraveEphemeralProvider make shields configuration
persistent.
IsShieldsResourceID(resource_identifier)) {
return false;
}

Copy link
Member

@bbondy bbondy Oct 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have a DCHECK here to ensure resource_identifier is empty?
I think that will prevent a future bug when we add a new content setting type and forget to add it in the list of IsShieldsResourceID

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

const ResourceIdentifier& resource_identifier,
base::Value* in_value) {
// Flash type shouldn't be handled here. Its id is empty.
// It's type is plugin and id is empty string.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment has some redundancy with "Its id is empty" and " id is empty string" making the reader think there are 2 ids, but I think there is only one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

BraveEphemeralProvider should not handle shield settings.
@simonhong simonhong force-pushed the make_plugin_contents_type_persist branch from e02f6f5 to e652fc6 Compare October 4, 2018 12:58
@bbondy bbondy merged commit 19aa7d3 into master Oct 4, 2018
bbondy added a commit that referenced this pull request Oct 4, 2018
bbondy added a commit that referenced this pull request Oct 4, 2018
@bbondy
Copy link
Member

bbondy commented Oct 4, 2018

master: 19aa7d3
0.56.x: 7d4a3c7
0.55.x: 600c7d8

@simonhong simonhong deleted the make_plugin_contents_type_persist branch October 4, 2018 13:38
@bbondy bbondy added this to the 0.55.x - Release milestone Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shield Settings are not retained across sessions
2 participants