Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: components/sync/driver/glue/sync_backend_host_impl.cc

Issue 2545973003: [Sync] Remove !frontend_ checks in SBHI. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/glue/sync_backend_host_impl.cc
diff --git a/components/sync/driver/glue/sync_backend_host_impl.cc b/components/sync/driver/glue/sync_backend_host_impl.cc
index bcb075b65d605ef0ecd3772387c67ac543cde888..6f98bf66eb473bebcb4fa8562dc0340dbf03fcdc 100644
--- a/components/sync/driver/glue/sync_backend_host_impl.cc
+++ b/components/sync/driver/glue/sync_backend_host_impl.cc
@@ -528,9 +528,6 @@ void SyncBackendHostImpl::FinishConfigureDataTypesOnFrontendLoop(
const ModelTypeSet succeeded_configuration_types,
const ModelTypeSet failed_configuration_types,
const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task) {
- if (!frontend_)
- return;
-
if (invalidator_) {
CHECK(invalidator_->UpdateRegisteredInvalidationIds(
this, ModelTypeSetToObjectIdSet(enabled_types)));
@@ -556,9 +553,6 @@ void SyncBackendHostImpl::HandleInitializationSuccessOnFrontendLoop(
model_type_connector_ = std::move(model_type_connector);
- if (!frontend_)
- return;
-
initialized_ = true;
if (invalidator_) {
@@ -580,9 +574,6 @@ void SyncBackendHostImpl::HandleInitializationSuccessOnFrontendLoop(
void SyncBackendHostImpl::HandleInitializationFailureOnFrontendLoop() {
DCHECK(thread_checker_.CalledOnValidThread());
- if (!frontend_)
- return;
-
frontend_->OnBackendInitialized(WeakHandle<JsBackend>(),
WeakHandle<DataTypeDebugInfoListener>(), "",
false);
@@ -590,8 +581,6 @@ void SyncBackendHostImpl::HandleInitializationFailureOnFrontendLoop() {
void SyncBackendHostImpl::HandleSyncCycleCompletedOnFrontendLoop(
const SyncCycleSnapshot& snapshot) {
- if (!frontend_)
- return;
DCHECK(thread_checker_.CalledOnValidThread());
last_snapshot_ = snapshot;
@@ -628,16 +617,12 @@ void SyncBackendHostImpl::PersistEncryptionBootstrapToken(
void SyncBackendHostImpl::HandleActionableErrorEventOnFrontendLoop(
const SyncProtocolError& sync_error) {
- if (!frontend_)
- return;
DCHECK(thread_checker_.CalledOnValidThread());
frontend_->OnActionableError(sync_error);
}
void SyncBackendHostImpl::HandleMigrationRequestedOnFrontendLoop(
ModelTypeSet types) {
- if (!frontend_)
- return;
DCHECK(thread_checker_.CalledOnValidThread());
frontend_->OnMigrationNeededForTypes(types);
}
@@ -674,9 +659,6 @@ bool SyncBackendHostImpl::CheckPassphraseAgainstCachedPendingKeys(
void SyncBackendHostImpl::NotifyPassphraseRequired(
PassphraseRequiredReason reason,
sync_pb::EncryptedData pending_keys) {
- if (!frontend_)
- return;
-
DCHECK(thread_checker_.CalledOnValidThread());
// Update our cache of the cryptographer's pending keys.
@@ -686,11 +668,7 @@ void SyncBackendHostImpl::NotifyPassphraseRequired(
}
void SyncBackendHostImpl::NotifyPassphraseAccepted() {
- if (!frontend_)
- return;
-
DCHECK(thread_checker_.CalledOnValidThread());
-
// Clear our cache of the cryptographer's pending keys.
cached_pending_keys_.clear_blob();
frontend_->OnPassphraseAccepted();
@@ -699,17 +677,11 @@ void SyncBackendHostImpl::NotifyPassphraseAccepted() {
void SyncBackendHostImpl::NotifyEncryptedTypesChanged(
ModelTypeSet encrypted_types,
bool encrypt_everything) {
- if (!frontend_)
- return;
-
DCHECK(thread_checker_.CalledOnValidThread());
frontend_->OnEncryptedTypesChanged(encrypted_types, encrypt_everything);
}
void SyncBackendHostImpl::NotifyEncryptionComplete() {
- if (!frontend_)
- return;
-
DCHECK(thread_checker_.CalledOnValidThread());
frontend_->OnEncryptionComplete();
}
@@ -731,9 +703,6 @@ void SyncBackendHostImpl::HandleLocalSetPassphraseEncryptionOnFrontendLoop(
void SyncBackendHostImpl::HandleConnectionStatusChangeOnFrontendLoop(
ConnectionStatus status) {
- if (!frontend_)
- return;
-
DCHECK(thread_checker_.CalledOnValidThread());
DVLOG(1) << "Connection status changed: " << ConnectionStatusToString(status);
@@ -742,32 +711,24 @@ void SyncBackendHostImpl::HandleConnectionStatusChangeOnFrontendLoop(
void SyncBackendHostImpl::HandleProtocolEventOnFrontendLoop(
std::unique_ptr<ProtocolEvent> event) {
- if (!frontend_)
- return;
frontend_->OnProtocolEvent(*event);
}
void SyncBackendHostImpl::HandleDirectoryCommitCountersUpdatedOnFrontendLoop(
ModelType type,
const CommitCounters& counters) {
- if (!frontend_)
- return;
frontend_->OnDirectoryTypeCommitCounterUpdated(type, counters);
}
void SyncBackendHostImpl::HandleDirectoryUpdateCountersUpdatedOnFrontendLoop(
ModelType type,
const UpdateCounters& counters) {
- if (!frontend_)
- return;
frontend_->OnDirectoryTypeUpdateCounterUpdated(type, counters);
}
void SyncBackendHostImpl::HandleDirectoryStatusCountersUpdatedOnFrontendLoop(
ModelType type,
const StatusCounters& counters) {
- if (!frontend_)
- return;
frontend_->OnDatatypeStatusCounterUpdated(type, counters);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698