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 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.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/password_manager/core/browser/login_database.h"
#include "components/password_manager/core/browser/password_manager_constants.h"
......@@ -121,7 +120,6 @@ AccountPasswordStoreFactory::BuildServiceInstanceFor(
scoped_refptr<PasswordStore> ps =
new password_manager::PasswordStoreDefault(std::move(login_db));
if (!ps->Init(/*flare=*/base::DoNothing(), profile->GetPrefs(),
chrome::GetChannel(),
base::BindRepeating(&SyncEnabledOrDisabled, profile))) {
// TODO(crbug.com/479725): Remove the LOG once this error is visible in the
// UI.
......
......@@ -17,7 +17,6 @@
#include "chrome/browser/sync/glue/sync_start_util.h"
#include "chrome/browser/sync/profile_sync_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 "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/password_manager/core/browser/login_database.h"
......@@ -164,7 +163,7 @@ PasswordStoreFactory::BuildServiceInstanceFor(
#endif
DCHECK(ps);
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
// UI.
LOG(WARNING) << "Could not initialize password store.";
......
......@@ -283,7 +283,6 @@ jumbo_static_library("browser") {
"//components/sync",
"//components/sync_preferences",
"//components/url_formatter",
"//components/version_info:version_info",
"//components/webdata/common",
"//google_apis",
"//net",
......
......@@ -16,7 +16,6 @@ include_rules = [
"+components/sync_preferences",
"+components/ukm",
"+components/url_formatter",
"+components/version_info",
"+components/webdata/common",
"+crypto",
"+google_apis",
......
......@@ -19,8 +19,7 @@ MockPasswordStore::CreateBackgroundTaskRunner() const {
}
bool MockPasswordStore::InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare,
version_info::Channel channel) {
const syncer::SyncableService::StartSyncFlare& flare) {
return true;
}
......
......@@ -126,8 +126,7 @@ class MockPasswordStore : public PasswordStore {
scoped_refptr<base::SequencedTaskRunner> CreateBackgroundTaskRunner()
const override;
bool InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare,
version_info::Channel channel) override;
const syncer::SyncableService::StartSyncFlare& flare) override;
};
} // namespace password_manager
......
......@@ -36,7 +36,6 @@
#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_syncable_service.h"
#include "components/sync/base/report_unrecoverable_error.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/proxy_model_type_controller_delegate.h"
......@@ -144,7 +143,6 @@ PasswordStore::PasswordStore()
bool PasswordStore::Init(const syncer::SyncableService::StartSyncFlare& flare,
PrefService* prefs,
version_info::Channel channel,
base::RepeatingClosure sync_enabled_or_disabled_cb) {
main_task_runner_ = base::SequencedTaskRunnerHandle::Get();
DCHECK(main_task_runner_);
......@@ -160,8 +158,7 @@ bool PasswordStore::Init(const syncer::SyncableService::StartSyncFlare& flare,
"passwords", "PasswordStore::InitOnBackgroundSequence", this);
base::PostTaskAndReplyWithResult(
background_task_runner_.get(), FROM_HERE,
base::BindOnce(&PasswordStore::InitOnBackgroundSequence, this, flare,
channel),
base::BindOnce(&PasswordStore::InitOnBackgroundSequence, this, flare),
base::BindOnce(&PasswordStore::OnInitCompleted, this));
}
......@@ -644,14 +641,12 @@ PasswordStore::CreateBackgroundTaskRunner() const {
}
bool PasswordStore::InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare,
version_info::Channel channel) {
const syncer::SyncableService::StartSyncFlare& flare) {
DCHECK(background_task_runner_->RunsTasksInCurrentSequence());
if (base::FeatureList::IsEnabled(switches::kSyncUSSPasswords)) {
sync_bridge_.reset(new PasswordSyncBridge(
std::make_unique<syncer::ClientTagBasedModelTypeProcessor>(
syncer::PASSWORDS,
base::BindRepeating(&syncer::ReportUnrecoverableError, channel)),
syncer::PASSWORDS, base::DoNothing()),
/*password_store_sync=*/this, sync_enabled_or_disabled_cb_));
} else {
DCHECK(!syncable_service_);
......
......@@ -25,7 +25,6 @@
#include "components/password_manager/core/browser/password_store_change.h"
#include "components/password_manager/core/browser/password_store_sync.h"
#include "components/sync/model/syncable_service.h"
#include "components/version_info/version_info.h"
#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED)
#include "components/password_manager/core/browser/hash_password_manager.h"
......@@ -39,13 +38,13 @@ class PrefService;
namespace autofill {
struct FormData;
struct PasswordForm;
} // namespace autofill
}
namespace syncer {
class ModelTypeControllerDelegate;
class ProxyModelTypeControllerDelegate;
class SyncableService;
} // namespace syncer
}
using StateSubscription =
base::CallbackList<void(const std::string& username)>::Subscription;
......@@ -136,7 +135,6 @@ class PasswordStore : protected PasswordStoreSync,
bool Init(
const syncer::SyncableService::StartSyncFlare& flare,
PrefService* prefs,
version_info::Channel channel = version_info::Channel::UNKNOWN,
base::RepeatingClosure sync_enabled_or_disabled_cb = base::DoNothing());
// RefcountedKeyedService:
......@@ -454,8 +452,7 @@ class PasswordStore : protected PasswordStoreSync,
// background sequence. Subclasses can add more logic. Returns true on
// success.
virtual bool InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare,
version_info::Channel channel);
const syncer::SyncableService::StartSyncFlare& flare);
// Methods below will be run in PasswordStore's own sequence.
// Synchronous implementation that reports usage metrics.
......
......@@ -22,7 +22,8 @@ PasswordStoreDefault::PasswordStoreDefault(
std::unique_ptr<LoginDatabase> login_db)
: login_db_(std::move(login_db)) {}
PasswordStoreDefault::~PasswordStoreDefault() = default;
PasswordStoreDefault::~PasswordStoreDefault() {
}
void PasswordStoreDefault::ShutdownOnUIThread() {
PasswordStore::ShutdownOnUIThread();
......@@ -30,8 +31,7 @@ void PasswordStoreDefault::ShutdownOnUIThread() {
}
bool PasswordStoreDefault::InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare,
version_info::Channel channel) {
const syncer::SyncableService::StartSyncFlare& flare) {
DCHECK(background_task_runner()->RunsTasksInCurrentSequence());
DCHECK(login_db_);
bool success = true;
......@@ -42,7 +42,7 @@ bool PasswordStoreDefault::InitOnBackgroundSequence(
success = false;
LOG(ERROR) << "Could not create/open login database.";
}
return PasswordStore::InitOnBackgroundSequence(flare, channel) && success;
return PasswordStore::InitOnBackgroundSequence(flare) && success;
}
void PasswordStoreDefault::ReportMetricsImpl(
......@@ -155,8 +155,9 @@ bool PasswordStoreDefault::RemoveStatisticsByOriginAndTimeImpl(
const base::Callback<bool(const GURL&)>& origin_filter,
base::Time delete_begin,
base::Time delete_end) {
return login_db_ && login_db_->stats_table().RemoveStatsByOriginAndTime(
origin_filter, delete_begin, delete_end);
return login_db_ &&
login_db_->stats_table().RemoveStatsByOriginAndTime(
origin_filter, delete_begin, delete_end);
}
std::vector<std::unique_ptr<PasswordForm>>
......
......@@ -34,8 +34,7 @@ class PasswordStoreDefault : public PasswordStore {
// Opens |login_db_| on the background sequence.
bool InitOnBackgroundSequence(
const syncer::SyncableService::StartSyncFlare& flare,
version_info::Channel channel) override;
const syncer::SyncableService::StartSyncFlare& flare) override;
// Implements PasswordStore interface.
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