Commit 2ce687dd authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

Revert "[Sync] Report Sync Errors in PasswordSyncBridge to Crashpad"

This reverts commit 9c2fc554.

Reason for revert: We have enough data and no need for temp solution anymore.

Original change's description:
> [Sync] Report Sync Errors in PasswordSyncBridge to Crashpad
> 
> Bug: 1044365
> Change-Id: Ie3d5246c24a046c18d6d2bfa6d92d1fdd46839db
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063013
> Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Commit-Queue: Jochen Eisinger <jochen@chromium.org>
> Auto-Submit: Mohamed Amir Yosef <mamir@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#743013}

TBR=vasilii@chromium.org,jochen@chromium.org,mamir@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1044365
Change-Id: I4245c6820b441d254bfa01c6cf59ff7e4cbd3c69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2094980Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748180}
parent 26f1b41d
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/web_data_service_factory.h" #include "chrome/browser/web_data_service_factory.h"
#include "chrome/common/channel_info.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/password_manager/core/browser/login_database.h" #include "components/password_manager/core/browser/login_database.h"
#include "components/password_manager/core/browser/password_manager_constants.h" #include "components/password_manager/core/browser/password_manager_constants.h"
...@@ -121,7 +120,6 @@ AccountPasswordStoreFactory::BuildServiceInstanceFor( ...@@ -121,7 +120,6 @@ AccountPasswordStoreFactory::BuildServiceInstanceFor(
scoped_refptr<PasswordStore> ps = scoped_refptr<PasswordStore> ps =
new password_manager::PasswordStoreDefault(std::move(login_db)); new password_manager::PasswordStoreDefault(std::move(login_db));
if (!ps->Init(/*flare=*/base::DoNothing(), profile->GetPrefs(), if (!ps->Init(/*flare=*/base::DoNothing(), profile->GetPrefs(),
chrome::GetChannel(),
base::BindRepeating(&SyncEnabledOrDisabled, profile))) { base::BindRepeating(&SyncEnabledOrDisabled, profile))) {
// TODO(crbug.com/479725): Remove the LOG once this error is visible in the // TODO(crbug.com/479725): Remove the LOG once this error is visible in the
// UI. // UI.
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "chrome/browser/sync/glue/sync_start_util.h" #include "chrome/browser/sync/glue/sync_start_util.h"
#include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/web_data_service_factory.h" #include "chrome/browser/web_data_service_factory.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_paths_internal.h" #include "chrome/common/chrome_paths_internal.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/password_manager/core/browser/login_database.h" #include "components/password_manager/core/browser/login_database.h"
...@@ -164,7 +163,7 @@ PasswordStoreFactory::BuildServiceInstanceFor( ...@@ -164,7 +163,7 @@ PasswordStoreFactory::BuildServiceInstanceFor(
#endif #endif
DCHECK(ps); DCHECK(ps);
if (!ps->Init(sync_start_util::GetFlareForSyncableService(profile->GetPath()), if (!ps->Init(sync_start_util::GetFlareForSyncableService(profile->GetPath()),
profile->GetPrefs(), chrome::GetChannel())) { profile->GetPrefs())) {
// TODO(crbug.com/479725): Remove the LOG once this error is visible in the // TODO(crbug.com/479725): Remove the LOG once this error is visible in the
// UI. // UI.
LOG(WARNING) << "Could not initialize password store."; LOG(WARNING) << "Could not initialize password store.";
......
...@@ -283,7 +283,6 @@ jumbo_static_library("browser") { ...@@ -283,7 +283,6 @@ jumbo_static_library("browser") {
"//components/sync", "//components/sync",
"//components/sync_preferences", "//components/sync_preferences",
"//components/url_formatter", "//components/url_formatter",
"//components/version_info:version_info",
"//components/webdata/common", "//components/webdata/common",
"//google_apis", "//google_apis",
"//net", "//net",
......
...@@ -16,7 +16,6 @@ include_rules = [ ...@@ -16,7 +16,6 @@ include_rules = [
"+components/sync_preferences", "+components/sync_preferences",
"+components/ukm", "+components/ukm",
"+components/url_formatter", "+components/url_formatter",
"+components/version_info",
"+components/webdata/common", "+components/webdata/common",
"+crypto", "+crypto",
"+google_apis", "+google_apis",
......
...@@ -19,8 +19,7 @@ MockPasswordStore::CreateBackgroundTaskRunner() const { ...@@ -19,8 +19,7 @@ MockPasswordStore::CreateBackgroundTaskRunner() const {
} }
bool MockPasswordStore::InitOnBackgroundSequence( bool MockPasswordStore::InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare, const syncer::SyncableService::StartSyncFlare& flare) {
version_info::Channel channel) {
return true; return true;
} }
......
...@@ -126,8 +126,7 @@ class MockPasswordStore : public PasswordStore { ...@@ -126,8 +126,7 @@ class MockPasswordStore : public PasswordStore {
scoped_refptr<base::SequencedTaskRunner> CreateBackgroundTaskRunner() scoped_refptr<base::SequencedTaskRunner> CreateBackgroundTaskRunner()
const override; const override;
bool InitOnBackgroundSequence( bool InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare, const syncer::SyncableService::StartSyncFlare& flare) override;
version_info::Channel channel) override;
}; };
} // namespace password_manager } // namespace password_manager
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "components/password_manager/core/browser/statistics_table.h" #include "components/password_manager/core/browser/statistics_table.h"
#include "components/password_manager/core/browser/sync/password_sync_bridge.h" #include "components/password_manager/core/browser/sync/password_sync_bridge.h"
#include "components/password_manager/core/browser/sync/password_syncable_service.h" #include "components/password_manager/core/browser/sync/password_syncable_service.h"
#include "components/sync/base/report_unrecoverable_error.h"
#include "components/sync/driver/sync_driver_switches.h" #include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/model_impl/client_tag_based_model_type_processor.h" #include "components/sync/model_impl/client_tag_based_model_type_processor.h"
#include "components/sync/model_impl/proxy_model_type_controller_delegate.h" #include "components/sync/model_impl/proxy_model_type_controller_delegate.h"
...@@ -144,7 +143,6 @@ PasswordStore::PasswordStore() ...@@ -144,7 +143,6 @@ PasswordStore::PasswordStore()
bool PasswordStore::Init(const syncer::SyncableService::StartSyncFlare& flare, bool PasswordStore::Init(const syncer::SyncableService::StartSyncFlare& flare,
PrefService* prefs, PrefService* prefs,
version_info::Channel channel,
base::RepeatingClosure sync_enabled_or_disabled_cb) { base::RepeatingClosure sync_enabled_or_disabled_cb) {
main_task_runner_ = base::SequencedTaskRunnerHandle::Get(); main_task_runner_ = base::SequencedTaskRunnerHandle::Get();
DCHECK(main_task_runner_); DCHECK(main_task_runner_);
...@@ -160,8 +158,7 @@ bool PasswordStore::Init(const syncer::SyncableService::StartSyncFlare& flare, ...@@ -160,8 +158,7 @@ bool PasswordStore::Init(const syncer::SyncableService::StartSyncFlare& flare,
"passwords", "PasswordStore::InitOnBackgroundSequence", this); "passwords", "PasswordStore::InitOnBackgroundSequence", this);
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
background_task_runner_.get(), FROM_HERE, background_task_runner_.get(), FROM_HERE,
base::BindOnce(&PasswordStore::InitOnBackgroundSequence, this, flare, base::BindOnce(&PasswordStore::InitOnBackgroundSequence, this, flare),
channel),
base::BindOnce(&PasswordStore::OnInitCompleted, this)); base::BindOnce(&PasswordStore::OnInitCompleted, this));
} }
...@@ -644,14 +641,12 @@ PasswordStore::CreateBackgroundTaskRunner() const { ...@@ -644,14 +641,12 @@ PasswordStore::CreateBackgroundTaskRunner() const {
} }
bool PasswordStore::InitOnBackgroundSequence( bool PasswordStore::InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare, const syncer::SyncableService::StartSyncFlare& flare) {
version_info::Channel channel) {
DCHECK(background_task_runner_->RunsTasksInCurrentSequence()); DCHECK(background_task_runner_->RunsTasksInCurrentSequence());
if (base::FeatureList::IsEnabled(switches::kSyncUSSPasswords)) { if (base::FeatureList::IsEnabled(switches::kSyncUSSPasswords)) {
sync_bridge_.reset(new PasswordSyncBridge( sync_bridge_.reset(new PasswordSyncBridge(
std::make_unique<syncer::ClientTagBasedModelTypeProcessor>( std::make_unique<syncer::ClientTagBasedModelTypeProcessor>(
syncer::PASSWORDS, syncer::PASSWORDS, base::DoNothing()),
base::BindRepeating(&syncer::ReportUnrecoverableError, channel)),
/*password_store_sync=*/this, sync_enabled_or_disabled_cb_)); /*password_store_sync=*/this, sync_enabled_or_disabled_cb_));
} else { } else {
DCHECK(!syncable_service_); DCHECK(!syncable_service_);
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "components/password_manager/core/browser/password_store_change.h" #include "components/password_manager/core/browser/password_store_change.h"
#include "components/password_manager/core/browser/password_store_sync.h" #include "components/password_manager/core/browser/password_store_sync.h"
#include "components/sync/model/syncable_service.h" #include "components/sync/model/syncable_service.h"
#include "components/version_info/version_info.h"
#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) #if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED)
#include "components/password_manager/core/browser/hash_password_manager.h" #include "components/password_manager/core/browser/hash_password_manager.h"
...@@ -39,13 +38,13 @@ class PrefService; ...@@ -39,13 +38,13 @@ class PrefService;
namespace autofill { namespace autofill {
struct FormData; struct FormData;
struct PasswordForm; struct PasswordForm;
} // namespace autofill }
namespace syncer { namespace syncer {
class ModelTypeControllerDelegate; class ModelTypeControllerDelegate;
class ProxyModelTypeControllerDelegate; class ProxyModelTypeControllerDelegate;
class SyncableService; class SyncableService;
} // namespace syncer }
using StateSubscription = using StateSubscription =
base::CallbackList<void(const std::string& username)>::Subscription; base::CallbackList<void(const std::string& username)>::Subscription;
...@@ -136,7 +135,6 @@ class PasswordStore : protected PasswordStoreSync, ...@@ -136,7 +135,6 @@ class PasswordStore : protected PasswordStoreSync,
bool Init( bool Init(
const syncer::SyncableService::StartSyncFlare& flare, const syncer::SyncableService::StartSyncFlare& flare,
PrefService* prefs, PrefService* prefs,
version_info::Channel channel = version_info::Channel::UNKNOWN,
base::RepeatingClosure sync_enabled_or_disabled_cb = base::DoNothing()); base::RepeatingClosure sync_enabled_or_disabled_cb = base::DoNothing());
// RefcountedKeyedService: // RefcountedKeyedService:
...@@ -454,8 +452,7 @@ class PasswordStore : protected PasswordStoreSync, ...@@ -454,8 +452,7 @@ class PasswordStore : protected PasswordStoreSync,
// background sequence. Subclasses can add more logic. Returns true on // background sequence. Subclasses can add more logic. Returns true on
// success. // success.
virtual bool InitOnBackgroundSequence( virtual bool InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare, const syncer::SyncableService::StartSyncFlare& flare);
version_info::Channel channel);
// Methods below will be run in PasswordStore's own sequence. // Methods below will be run in PasswordStore's own sequence.
// Synchronous implementation that reports usage metrics. // Synchronous implementation that reports usage metrics.
......
...@@ -22,7 +22,8 @@ PasswordStoreDefault::PasswordStoreDefault( ...@@ -22,7 +22,8 @@ PasswordStoreDefault::PasswordStoreDefault(
std::unique_ptr<LoginDatabase> login_db) std::unique_ptr<LoginDatabase> login_db)
: login_db_(std::move(login_db)) {} : login_db_(std::move(login_db)) {}
PasswordStoreDefault::~PasswordStoreDefault() = default; PasswordStoreDefault::~PasswordStoreDefault() {
}
void PasswordStoreDefault::ShutdownOnUIThread() { void PasswordStoreDefault::ShutdownOnUIThread() {
PasswordStore::ShutdownOnUIThread(); PasswordStore::ShutdownOnUIThread();
...@@ -30,8 +31,7 @@ void PasswordStoreDefault::ShutdownOnUIThread() { ...@@ -30,8 +31,7 @@ void PasswordStoreDefault::ShutdownOnUIThread() {
} }
bool PasswordStoreDefault::InitOnBackgroundSequence( bool PasswordStoreDefault::InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare, const syncer::SyncableService::StartSyncFlare& flare) {
version_info::Channel channel) {
DCHECK(background_task_runner()->RunsTasksInCurrentSequence()); DCHECK(background_task_runner()->RunsTasksInCurrentSequence());
DCHECK(login_db_); DCHECK(login_db_);
bool success = true; bool success = true;
...@@ -42,7 +42,7 @@ bool PasswordStoreDefault::InitOnBackgroundSequence( ...@@ -42,7 +42,7 @@ bool PasswordStoreDefault::InitOnBackgroundSequence(
success = false; success = false;
LOG(ERROR) << "Could not create/open login database."; LOG(ERROR) << "Could not create/open login database.";
} }
return PasswordStore::InitOnBackgroundSequence(flare, channel) && success; return PasswordStore::InitOnBackgroundSequence(flare) && success;
} }
void PasswordStoreDefault::ReportMetricsImpl( void PasswordStoreDefault::ReportMetricsImpl(
...@@ -155,8 +155,9 @@ bool PasswordStoreDefault::RemoveStatisticsByOriginAndTimeImpl( ...@@ -155,8 +155,9 @@ bool PasswordStoreDefault::RemoveStatisticsByOriginAndTimeImpl(
const base::Callback<bool(const GURL&)>& origin_filter, const base::Callback<bool(const GURL&)>& origin_filter,
base::Time delete_begin, base::Time delete_begin,
base::Time delete_end) { base::Time delete_end) {
return login_db_ && login_db_->stats_table().RemoveStatsByOriginAndTime( return login_db_ &&
origin_filter, delete_begin, delete_end); login_db_->stats_table().RemoveStatsByOriginAndTime(
origin_filter, delete_begin, delete_end);
} }
std::vector<std::unique_ptr<PasswordForm>> std::vector<std::unique_ptr<PasswordForm>>
......
...@@ -34,8 +34,7 @@ class PasswordStoreDefault : public PasswordStore { ...@@ -34,8 +34,7 @@ class PasswordStoreDefault : public PasswordStore {
// Opens |login_db_| on the background sequence. // Opens |login_db_| on the background sequence.
bool InitOnBackgroundSequence( bool InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare, const syncer::SyncableService::StartSyncFlare& flare) override;
version_info::Channel channel) override;
// Implements PasswordStore interface. // Implements PasswordStore interface.
void ReportMetricsImpl(const std::string& sync_username, void ReportMetricsImpl(const std::string& sync_username,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment