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

[ads] Followup to "Smart NTT" #41303 #26083

Merged
merged 1 commit into from
Oct 18, 2024
Merged

[ads] Followup to "Smart NTT" #41303 #26083

merged 1 commit into from
Oct 18, 2024

Conversation

aseren
Copy link
Collaborator

@aseren aseren commented Oct 17, 2024

Resolves brave/brave-browser#41695

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Please refer to the specification at this link and the test plan at this link.

@tmancey tmancey force-pushed the issues/41695 branch 7 times, most recently from 12fb10b to beda866 Compare October 18, 2024 04:09
@tmancey tmancey marked this pull request as ready for review October 18, 2024 04:10
@tmancey tmancey requested review from a team as code owners October 18, 2024 04:10
@tmancey tmancey changed the title [ads] Followup to "SmartNTT" expose default search engine [ads] Followup to "Smart NTT" #41303 Oct 18, 2024
@tmancey tmancey force-pushed the issues/41695 branch 2 times, most recently from b0a0af2 to 7eb16c7 Compare October 18, 2024 12:45
Copy link
Contributor

[puLL-Merge] - brave/brave-core@26083

Here's my review of the pull request:

Description

This PR adds functionality to retrieve virtual preferences for ads, specifically to get the default search engine name. It modifies the ads service and related components to support this new feature.

Changes

Changes

  1. browser/brave_ads/ads_service_delegate.cc:

    • Added GetVirtualPrefs method to retrieve the default search engine name.
    • Modified constructor to include local_state and search_engine_choice_service.
  2. components/brave_ads/browser/ads_service.h:

    • Added GetVirtualPrefs method to the Delegate interface.
  3. components/brave_ads/browser/ads_service_impl.cc:

    • Implemented GetDelegate and GetVirtualPrefs methods.
  4. components/brave_ads/core/internal/ads_client/ads_client_pref_provider.cc:

    • Added GetVirtualPref method to retrieve virtual preferences.
  5. components/brave_ads/core/internal/serving/eligible_ads/pipelines/new_tab_page_ads/eligible_new_tab_page_ads_v2.cc:

    • Modified to use the new pref_provider_ for condition matching.
  6. components/brave_ads/core/public/ads_client/ads_client.h:

    • Added GetVirtualPrefs method to the AdsClient interface.
  7. components/brave_ads/core/public/prefs/pref_provider.h:

    • Modified constructor to include virtual_prefs.
    • Added GetVirtualPref method.
  8. components/ntp_background_images/browser/view_counter_service.cc:

    • Updated to use the new virtual preferences functionality.
  9. Various other files:

    • Updated to support the new virtual preferences feature.

Possible Issues

  1. The implementation assumes that the default search engine will always be available. There might be edge cases where this assumption doesn't hold true, which could lead to unexpected behavior.

  2. The changes introduce a new dependency between the ads system and the search engine system. This coupling might make future changes more complex and could potentially impact the modularity of the codebase.

Security Hotspots

No significant security issues were identified in this change. However, it's important to ensure that the virtual preferences system doesn't expose any sensitive information that could be exploited.

Overall, the changes appear to be well-structured and consistent with the existing codebase. The addition of virtual preferences for ads seems to be a useful feature that could improve ad targeting and user experience. However, thorough testing should be performed to ensure that the new functionality works as expected across different scenarios and doesn't introduce any regressions in existing features.

@tmancey tmancey merged commit 25ddfaf into master Oct 18, 2024
19 checks passed
@tmancey tmancey deleted the issues/41695 branch October 18, 2024 19:08
@github-actions github-actions bot added this to the 1.73.x - Nightly milestone Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ads] Followup to "Smart NTT" #41303
3 participants