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

Ensure ContentSettingsStore::RegisterExtension is called for components #48

Merged
merged 1 commit into from
Feb 28, 2018

Conversation

bbondy
Copy link
Member

@bbondy bbondy commented Feb 28, 2018

Fix https://github.com/brave/brave/issues/81

Note for reviewing that the added call to extension_prefs_->OnExtensionInstalled is always called right away in AddNewOrUpdatedExtension but for AddExtension it is never called:

void ExtensionService::AddComponentExtension(const Extension* extension) {
  const std::string old_version_string(
      extension_prefs_->GetVersionString(extension->id()));
  const base::Version old_version(old_version_string);

  VLOG(1) << "AddComponentExtension " << extension->name();
  if (!old_version.IsValid() || old_version != *extension->version()) {
    VLOG(1) << "Component extension " << extension->name() << " ("
        << extension->id() << ") installing/upgrading from '"
        << old_version_string << "' to " << extension->version()->GetString();

    // TODO(crbug.com/696822): If needed, add support for Declarative Net
    // Request to component extensions and pass the ruleset checksum here.
    AddNewOrUpdatedExtension(
        extension, Extension::ENABLED, extensions::kInstallFlagNone,
        syncer::StringOrdinal(), std::string(), base::nullopt);
    return;
  }

  AddExtension(extension);

This seem to only be needed for AddComponentExtension and not extensions because the extensions are always loaded before the default components are added.

Let me know if you can think of a better way to fix this. I had trouble finding a cleaner way.

@bbondy bbondy self-assigned this Feb 28, 2018
@bbondy bbondy requested a review from darkdh February 28, 2018 07:09
Copy link
Member

@darkdh darkdh left a comment

Choose a reason for hiding this comment

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

Lgtm

@bbondy bbondy merged commit 1b5b3d2 into master Feb 28, 2018
@bsclifton bsclifton deleted the issue-81 branch June 18, 2018 06:26
NejcZdovc pushed a commit that referenced this pull request Dec 10, 2018
load ledger state before publisher state
bbondy pushed a commit that referenced this pull request Feb 18, 2019
Cosmetic Filter Implementation
NejcZdovc pushed a commit that referenced this pull request Feb 25, 2019
tmancey pushed a commit that referenced this pull request Feb 27, 2019
* Initial commit

* Added SetTimer and OnTimer

* Added missing #include for wallet_info data structure

* Added catalog issuers data structure

* Added OnCatalogIssuersChanged

* Added OnTimer

* Changed LOG to BLOG due to conflicts with base::

* wip, builds

* build w/ all class code

* port steps 1-5

* match server regex update

* Integration for brave-core

* Temporarily use std::cout instead of BLOG due to build issues

* Resolve linking issue with IsReadyToShowAds

* Only start filling confirmations, retrieving payments and cashing in payments once initialized

* Revert "Temporarily use std::cout instead of BLOG due to build issues"

This reverts commit 7baad78.

* Refactor to use callbacks

* Improve logging to help diagnose issues

* Confirmations fails to initialize when creating a new wallet (#42)

* Improve logging to help diagnose issues (#43)

* Confirmations fails to initialize when creating a new wallet (#44)

* Ads Serve failures should retry (#45)

* Resolves initiating profile DCHECK failure (#47)

* Improve logging to help diagnose issues (#48)

* Fix unit test build errors #53 (#54)

* Changes to how unblind and BatchDLEQProof::verify are being called in challenge-bypass-ristretto-ffi

* Decouple refill tokens

* Decouple redeem token

* Decouple payout tokens

* Added Ads Serve helper

* Decouple security into security helper

* Updated static values

* Updated BUILD.gn

* Refactor ConfirmationsImpl to use decoupled logic

* Added string helper

* Remove unused HappyHTTP dependency

* Add support for _is_production flag to choose between production and staging environments

* refactor dependencies

* Decoupled unblinded tokens and url request builder for unit tests

* Resolve compiler errors and decouple logic in preparation for unit testing

* Added unit tests

* Fix build for Windows/Linux

* Fix linter errors

* Confirmations should not be initialized if the wallet is invalid

* Removed unecessary boolean logic

* Return if wallet info is not ready

* Fix build error

* Fix header files

* Fix unit tests

* Remove redundant #include for unblinded_tokens.h

* Fixed unit test #include paths

* Revert "Remove redundant #include for unblinded_tokens.h"

This reverts commit 35f055e82f0a22428c600360a75336351f34458d.

* Remove redundant #include for unblinded_tokens.h

* Fixed unit test #include paths

* Refactor new to unique_ptr for unit tests

* Remove logging for unit tests

* Resolved lint error

* Added README.md

* Fixed linter errors

* Fix Linux and Windows build errors

* Resolve logging issue with wallet info

* Add support for VLOG to help reduce noise in logs for INFO

* Added ability to retrieve transaction history

* Fixed build error and refactored ctime to use base::Time

* Redeem tokens when notifications are viewed

* Update client when transaction history changes

* Reduced maximum persisted unblinded tokens from 100 to 50

Reduced maximum persisted unblinded tokens from 100 to 50 to reduce the chance that the server fails to generate the tokens before the next request. If the server still does not generate the tokens in time we retry after 15 seconds.

* Updated Copyright in BUILD.gn

* Updated README.md

* Revert "Merge pull request #75 from brave-intl/issues/52"

This reverts commit fc7de34, reversing
changes made to 211e767.

* Fixed unit tests
petemill pushed a commit to petemill/brave-core that referenced this pull request Jul 5, 2019
cezaraugusto pushed a commit that referenced this pull request Jul 17, 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.

2 participants