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

Issue 3816: Disabling metrics services provider #2095

Merged
merged 1 commit into from
Mar 28, 2019
Merged

Issue 3816: Disabling metrics services provider #2095

merged 1 commit into from
Mar 28, 2019

Conversation

jumde
Copy link
Contributor

@jumde jumde commented Mar 27, 2019

Description

Initial patch for disabling metrics services (https://github.com/brave/brave-core/pull/2029/files#diff-df788f5fb2dd4d6366315886d1b2a0b2) was incompatible with C73, so we ended up reverting it with C74-revert.

This updated patch works with C73 but, uses patches:

https://github.com/brave/brave-core/pull/2095/files

The problem is the code that checks for enable reporting in C74 is:

bool IsReportingEnabled() const override {
    return metrics::EnabledStateProvider::IsReportingEnabled() &&
           IsClientInSampleImpl(local_state_);
  }

With C74, this worked because it was able to override IsReportingEnabled function in EnabledStateProvider to return false.

In C73 the code:

bool IsReportingEnabled() const override {
    return IsConsentGiven() &&
           ChromeMetricsServicesManagerClient::IsClientInSample();
  }

I investigated subclassing ChromeEnabledStateProvider, ChromeMetricsServicesManagerClient but that did not work. Disabling kMetricsReportingFeature does not work as well as its enabled by field_trials.

This patch will be reverted with C74, and we can use the override then

fix brave/brave-browser#3816

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).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests && npm run test-security) on
    • Windows
    • macOS
    • Linux
  • Verified that all lint errors/warnings are resolved (npm run lint)
  • Ran git rebase master (if needed).
  • 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:

  1. npm run network-audit should pass.

or

  1. Win/Linux - Using Fidler, make sure you’re not connecting to clientservices.googleapis.com on startup (leave the browser running for a while and make sure no other Google API calls are made)
  2. macOS - Same thing but Little Snitch.

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

@jumde jumde self-assigned this Mar 27, 2019
@jumde jumde marked this pull request as ready for review March 27, 2019 16:42
@jumde jumde changed the title PJ Issue 3816: Disabling metrics services provider Mar 28, 2019
@bbondy bbondy merged commit 6db8e25 into master Mar 28, 2019
@bbondy
Copy link
Member

bbondy commented Mar 28, 2019

Cherry-picked with admin privs to get things working for CI asap.
0.63.x: a56d9c5
0.62.x: e5fdd59

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.

Crash reporting connects to clientservices.googleapis.com on startup
3 participants