diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-21 22:01:39 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-21 22:01:39 +0000 |
commit | c5af1c1af7e02b4998b085d29ecf8249f679e50a (patch) | |
tree | cb65f27e9ac9f72d72257b1b18c7d42ba990e361 | |
parent | 7d40674e06b45c1f7af1cbba7d49ec27928c246e (diff) | |
download | chromium_src-c5af1c1af7e02b4998b085d29ecf8249f679e50a.zip chromium_src-c5af1c1af7e02b4998b085d29ecf8249f679e50a.tar.gz chromium_src-c5af1c1af7e02b4998b085d29ecf8249f679e50a.tar.bz2 |
Convert LOG(INFO) to VLOG(1) - chrome/browser/sync/engine/.
Also fix some line wrapping, remove some extra {}s, and remove "else" after "return".
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/4001002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63432 0039d316-1c4b-4281-b951-d872f2087c98
14 files changed, 193 insertions, 217 deletions
diff --git a/chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc b/chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc index ab4e3ff..0d14069 100644 --- a/chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc +++ b/chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -78,7 +78,7 @@ bool BuildAndProcessConflictSetsCommand::ProcessSingleDirectionConflictSets( unapplied_count++; } if (conflict_set->size() == unsynced_count && 0 == unapplied_count) { - LOG(INFO) << "Skipped transactional commit attempt."; + VLOG(1) << "Skipped transactional commit attempt."; } else if (conflict_set->size() == unapplied_count && 0 == unsynced_count && ApplyUpdatesTransactionally(trans, conflict_set, resolver, cryptographer, routes, status)) { @@ -271,8 +271,8 @@ void BuildAndProcessConflictSetsCommand::MergeSetsForIntroducedLoops( while (!parent_id.IsRoot()) { syncable::Entry parent(trans, syncable::GET_BY_ID, parent_id); if (!parent.good()) { - LOG(INFO) << "Bad parent in loop check, skipping. Bad parent id: " - << parent_id << " entry: " << *entry; + VLOG(1) << "Bad parent in loop check, skipping. Bad parent id: " + << parent_id << " entry: " << *entry; return; } if (parent.Get(syncable::IS_UNSYNCED) && diff --git a/chrome/browser/sync/engine/clear_data_command.cc b/chrome/browser/sync/engine/clear_data_command.cc index e2ceb20..6e609ed 100644 --- a/chrome/browser/sync/engine/clear_data_command.cc +++ b/chrome/browser/sync/engine/clear_data_command.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -45,14 +45,14 @@ void ClearDataCommand::ExecuteImpl(SyncSession* session) { SyncerProtoUtil::AddRequestBirthday(dir, &client_to_server_message); - LOG(INFO) << "Clearing server data"; + VLOG(1) << "Clearing server data"; bool ok = SyncerProtoUtil::PostClientToServerMessage( client_to_server_message, &client_to_server_response, session); - DLOG(INFO) << SyncerProtoUtil::ClientToServerResponseDebugString( + DVLOG(1) << SyncerProtoUtil::ClientToServerResponseDebugString( client_to_server_response); // Clear pending indicates that the server has received our clear message @@ -75,7 +75,7 @@ void ClearDataCommand::ExecuteImpl(SyncSession* session) { session->delegate()->OnShouldStopSyncingPermanently(); - LOG(INFO) << "ClearData succeeded."; + VLOG(1) << "ClearData succeeded."; } } // namespace browser_sync diff --git a/chrome/browser/sync/engine/conflict_resolver.cc b/chrome/browser/sync/engine/conflict_resolver.cc index e24c9f9..3b06078 100644 --- a/chrome/browser/sync/engine/conflict_resolver.cc +++ b/chrome/browser/sync/engine/conflict_resolver.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -42,7 +42,7 @@ void ConflictResolver::IgnoreLocalChanges(MutableEntry* entry) { // An update matches local actions, merge the changes. // This is a little fishy because we don't actually merge them. // In the future we should do a 3-way merge. - LOG(INFO) << "Server and local changes match, merging:" << entry; + VLOG(1) << "Server and local changes match, merging:" << entry; // With IS_UNSYNCED false, changes should be merged. // METRIC simple conflict resolved by merge. entry->Put(syncable::IS_UNSYNCED, false); @@ -74,12 +74,12 @@ ConflictResolver::ProcessSimpleConflict(WriteTransaction* trans, if (!entry.Get(syncable::IS_UNAPPLIED_UPDATE)) { if (!entry.Get(syncable::PARENT_ID).ServerKnows()) { - LOG(INFO) << "Item conflicting because its parent not yet committed. " - "Id: "<< id; + VLOG(1) << "Item conflicting because its parent not yet committed. Id: " + << id; } else { - LOG(INFO) << "No set for conflicting entry id " << id << ". There should " - "be an update/commit that will fix this soon. This message should " - "not repeat."; + VLOG(1) << "No set for conflicting entry id " << id << ". There should " + "be an update/commit that will fix this soon. This message " + "should not repeat."; } return NO_SYNC_PROGRESS; } @@ -108,12 +108,12 @@ ConflictResolver::ProcessSimpleConflict(WriteTransaction* trans, bool entry_deleted = entry.Get(syncable::IS_DEL); if (!entry_deleted && name_matches && parent_matches) { - LOG(INFO) << "Resolving simple conflict, ignoring local changes for:" - << entry; + VLOG(1) << "Resolving simple conflict, ignoring local changes for:" + << entry; IgnoreLocalChanges(&entry); } else { - LOG(INFO) << "Resolving simple conflict, overwriting server" - " changes for:" << entry; + VLOG(1) << "Resolving simple conflict, overwriting server changes for:" + << entry; OverwriteServerChanges(trans, &entry); } return SYNC_PROGRESS; @@ -125,8 +125,8 @@ ConflictResolver::ProcessSimpleConflict(WriteTransaction* trans, entry.Get(syncable::ID), &children); if (0 != children.size()) { - LOG(INFO) << "Entry is a server deleted directory with local contents, " - "should be in a set. (race condition)."; + VLOG(1) << "Entry is a server deleted directory with local contents, " + "should be in a set. (race condition)."; return NO_SYNC_PROGRESS; } } @@ -135,9 +135,9 @@ ConflictResolver::ProcessSimpleConflict(WriteTransaction* trans, if (!entry.Get(syncable::UNIQUE_CLIENT_TAG).empty()) { // If we've got a client-unique tag, we can undelete while retaining // our present ID. - DCHECK_EQ(entry.Get(syncable::SERVER_VERSION), 0) - << "For the server to know to re-create, client-tagged items should " - << "revert to version 0 when server-deleted."; + DCHECK_EQ(entry.Get(syncable::SERVER_VERSION), 0) << "For the server to " + "know to re-create, client-tagged items should revert to version 0 " + "when server-deleted."; OverwriteServerChanges(trans, &entry); // Clobber the versions, just in case the above DCHECK is violated. entry.Put(syncable::SERVER_VERSION, 0); @@ -202,7 +202,7 @@ bool AttemptToFixCircularConflict(WriteTransaction* trans, } if (parentid.IsRoot()) continue; - LOG(INFO) << "Overwriting server changes to avoid loop: " << entryi; + VLOG(1) << "Overwriting server changes to avoid loop: " << entryi; entryi.Put(syncable::BASE_VERSION, entryi.Get(syncable::SERVER_VERSION)); entryi.Put(syncable::IS_UNSYNCED, true); entryi.Put(syncable::IS_UNAPPLIED_UPDATE, false); @@ -244,8 +244,7 @@ bool AttemptToFixUnsyncedEntryInDeletedServerTree(WriteTransaction* trans, MutableEntry parent(trans, syncable::GET_BY_ID, id); if (!binary_search(conflict_set->begin(), conflict_set->end(), id)) break; - LOG(INFO) << "Giving directory a new id so we can undelete it " - << parent; + VLOG(1) << "Giving directory a new id so we can undelete it " << parent; ClearServerData(&parent); SyncerUtil::ChangeEntryIDAndUpdateChildren(trans, &parent, trans->directory()->NextId()); @@ -322,8 +321,8 @@ bool AttemptToFixUpdateEntryInDeletedLocalTree(WriteTransaction* trans, } MutableEntry entry(trans, syncable::GET_BY_ID, id); - LOG(INFO) << "Undoing our deletion of " << entry - << ", will have name " << entry.Get(syncable::NON_UNIQUE_NAME); + VLOG(1) << "Undoing our deletion of " << entry + << ", will have name " << entry.Get(syncable::NON_UNIQUE_NAME); Id parent_id = entry.Get(syncable::PARENT_ID); if (parent_id == reroot_id) { @@ -373,7 +372,7 @@ bool ConflictResolver::ProcessConflictSet(WriteTransaction* trans, return false; } - LOG(INFO) << "Fixing a set containing " << set_size << " items"; + VLOG(1) << "Fixing a set containing " << set_size << " items"; // Fix circular conflicts. if (AttemptToFixCircularConflict(trans, conflict_set)) @@ -485,7 +484,7 @@ bool ConflictResolver::ResolveConflicts(const ScopedDirLookup& dir, children_of_dirs_merged_last_round.end(), conflict_set->begin(), conflict_set->end())) { - LOG(INFO) << "Accelerating resolution for hierarchical merge."; + VLOG(1) << "Accelerating resolution for hierarchical merge."; conflict_count += 2; } // See if we should process this set. diff --git a/chrome/browser/sync/engine/get_commit_ids_command.cc b/chrome/browser/sync/engine/get_commit_ids_command.cc index 7348146..cb5349e 100644 --- a/chrome/browser/sync/engine/get_commit_ids_command.cc +++ b/chrome/browser/sync/engine/get_commit_ids_command.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -186,8 +186,8 @@ void GetCommitIdsCommand::AddDeletes(const vector<int64>& unsynced_handles, if (entry.Get(syncable::ID).ServerKnows() && entry.Get(syncable::PARENT_ID) != entry.Get(syncable::SERVER_PARENT_ID)) { - LOG(INFO) << "Inserting moved and deleted entry, will be missed by" - " delete roll." << entry.Get(syncable::ID); + VLOG(1) << "Inserting moved and deleted entry, will be missed by " + "delete roll." << entry.Get(syncable::ID); ordered_commit_set_->AddCommitItem(metahandle, entry.Get(syncable::ID), diff --git a/chrome/browser/sync/engine/net/server_connection_manager.cc b/chrome/browser/sync/engine/net/server_connection_manager.cc index c1801c8..41e79f4 100644 --- a/chrome/browser/sync/engine/net/server_connection_manager.cc +++ b/chrome/browser/sync/engine/net/server_connection_manager.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -208,13 +208,13 @@ bool ServerConnectionManager::CheckTime(int32* out_time) { // Note that the server's get_time path doesn't require authentication. string get_time_path = MakeSyncServerPath(kSyncServerGetTimePath, post_body); - LOG(INFO) << "Requesting get_time from:" << get_time_path; + VLOG(1) << "Requesting get_time from:" << get_time_path; string blank_post_body; bool ok = post->Init(get_time_path.c_str(), blank_post_body, blank_post_body, &response); if (!ok) { - LOG(INFO) << "Unable to check the time"; + VLOG(1) << "Unable to check the time"; continue; } string time_response; @@ -228,7 +228,7 @@ bool ServerConnectionManager::CheckTime(int32* out_time) { continue; } *out_time = atoi(time_response.c_str()); - LOG(INFO) << "Server was reachable."; + VLOG(1) << "Server was reachable."; return true; } IncrementErrorCount(); @@ -320,9 +320,8 @@ std::string ServerConnectionManager::GetServerHost() const { bool use_ssl; GetServerParameters(&server_url, &port, &use_ssl); // For unit tests. - if (server_url.empty()) { - return ""; - } + if (server_url.empty()) + return std::string(); // We just want the hostname, so we don't need to switch on use_ssl. server_url = "http://" + server_url; GURL gurl(server_url); @@ -335,7 +334,7 @@ bool FillMessageWithShareDetails(sync_pb::ClientToServerMessage* csm, const std::string& share) { syncable::ScopedDirLookup dir(manager, share); if (!dir.good()) { - LOG(INFO) << "Dir lookup failed"; + VLOG(1) << "Dir lookup failed"; return false; } string birthday = dir->store_birthday(); diff --git a/chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc b/chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc index d50e891..0d8f2a7 100644 --- a/chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc +++ b/chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -46,7 +46,7 @@ bool SyncAPIBridgedPost::Init(const char* path, const string& auth_token, int os_error_code = 0; int response_code = 0; if (!http->MakeSynchronousPost(&os_error_code, &response_code)) { - LOG(INFO) << "Http POST failed, error returns: " << os_error_code; + VLOG(1) << "Http POST failed, error returns: " << os_error_code; response->server_status = HttpResponse::IO_ERROR; factory_->Destroy(http); return false; diff --git a/chrome/browser/sync/engine/process_commit_response_command.cc b/chrome/browser/sync/engine/process_commit_response_command.cc index a65660e9..64eb442 100644 --- a/chrome/browser/sync/engine/process_commit_response_command.cc +++ b/chrome/browser/sync/engine/process_commit_response_command.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -228,7 +228,7 @@ ProcessCommitResponseCommand::ProcessSingleCommitResponse( return CommitResponse::INVALID_MESSAGE; } if (CommitResponse::TRANSIENT_ERROR == response) { - LOG(INFO) << "Transient Error Committing: " << local_entry; + VLOG(1) << "Transient Error Committing: " << local_entry; LogServerError(server_entry); return CommitResponse::TRANSIENT_ERROR; } @@ -238,7 +238,7 @@ ProcessCommitResponseCommand::ProcessSingleCommitResponse( return response; } if (CommitResponse::CONFLICT == response) { - LOG(INFO) << "Conflict Committing: " << local_entry; + VLOG(1) << "Conflict Committing: " << local_entry; // TODO(nick): conflicting_new_folder_ids is a purposeless anachronism. if (!pre_commit_id.ServerKnows() && local_entry.Get(IS_DIR)) { conflicting_new_folder_ids->insert(pre_commit_id); @@ -246,7 +246,7 @@ ProcessCommitResponseCommand::ProcessSingleCommitResponse( return response; } if (CommitResponse::RETRY == response) { - LOG(INFO) << "Retry Committing: " << local_entry; + VLOG(1) << "Retry Committing: " << local_entry; return response; } if (CommitResponse::OVER_QUOTA == response) { @@ -321,8 +321,8 @@ bool ProcessCommitResponseCommand::UpdateVersionAfterCommit( // here, even if syncing_was_set is false; that's because local changes were // on top of the successfully committed version. local_entry->Put(BASE_VERSION, new_version); - LOG(INFO) << "Commit is changing base version of " - << local_entry->Get(ID) << " to: " << new_version; + VLOG(1) << "Commit is changing base version of " << local_entry->Get(ID) + << " to: " << new_version; local_entry->Put(SERVER_VERSION, new_version); return true; } @@ -336,8 +336,8 @@ bool ProcessCommitResponseCommand::ChangeIdAfterCommit( if (pre_commit_id.ServerKnows()) { // The server can sometimes generate a new ID on commit; for example, // when committing an undeletion. - LOG(INFO) << " ID changed while committing an old entry. " - << pre_commit_id << " became " << entry_response.id() << "."; + VLOG(1) << " ID changed while committing an old entry. " + << pre_commit_id << " became " << entry_response.id() << "."; } MutableEntry same_id(trans, GET_BY_ID, entry_response.id()); // We should trap this before this function. @@ -348,7 +348,7 @@ bool ProcessCommitResponseCommand::ChangeIdAfterCommit( } SyncerUtil::ChangeEntryIDAndUpdateChildren( trans, local_entry, entry_response.id()); - LOG(INFO) << "Changing ID to " << entry_response.id(); + VLOG(1) << "Changing ID to " << entry_response.id(); } return true; } @@ -421,8 +421,8 @@ void ProcessCommitResponseCommand::OverrideClientFieldsAfterCommit( local_entry->Get(syncable::NON_UNIQUE_NAME); if (!server_name.empty() && old_name != server_name) { - LOG(INFO) << "During commit, server changed name: " << old_name - << " to new name: " << server_name; + VLOG(1) << "During commit, server changed name: " << old_name + << " to new name: " << server_name; local_entry->Put(syncable::NON_UNIQUE_NAME, server_name); } @@ -438,9 +438,8 @@ void ProcessCommitResponseCommand::OverrideClientFieldsAfterCommit( syncable::Id new_prev = SyncerUtil::ComputePrevIdFromServerPosition( local_entry->write_transaction(), local_entry, local_entry->Get(PARENT_ID)); - if (!local_entry->PutPredecessor(new_prev)) { + if (!local_entry->PutPredecessor(new_prev)) LOG(WARNING) << "PutPredecessor failed after successful commit"; - } } } diff --git a/chrome/browser/sync/engine/store_timestamps_command.cc b/chrome/browser/sync/engine/store_timestamps_command.cc index 9022152..864e429 100644 --- a/chrome/browser/sync/engine/store_timestamps_command.cc +++ b/chrome/browser/sync/engine/store_timestamps_command.cc @@ -30,7 +30,7 @@ void StoreTimestampsCommand::ExecuteImpl(sessions::SyncSession* session) { sessions::StatusController* status = session->status_controller(); if (updates.has_changes_remaining()) { int64 changes_left = updates.changes_remaining(); - LOG(INFO) << "Changes remaining:" << changes_left; + VLOG(1) << "Changes remaining:" << changes_left; status->set_num_server_changes_remaining(changes_left); } diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc index 38790c9..7bc7e7e 100644 --- a/chrome/browser/sync/engine/syncapi.cc +++ b/chrome/browser/sync/engine/syncapi.cc @@ -890,7 +890,7 @@ class BridgedGaiaAuthenticator : public gaia::GaiaAuthenticator { int os_error_code = 0; int int_response_code = 0; if (!http->MakeSynchronousPost(&os_error_code, &int_response_code)) { - LOG(INFO) << "Http POST failed, error returns: " << os_error_code; + VLOG(1) << "Http POST failed, error returns: " << os_error_code; return false; } *response_code = static_cast<int>(int_response_code); @@ -1262,7 +1262,7 @@ bool SyncManager::Init(const FilePath& database_location, const std::string& restored_key_for_bootstrapping, bool setup_for_test_mode) { DCHECK(post_factory); - LOG(INFO) << "SyncManager starting Init..."; + VLOG(1) << "SyncManager starting Init..."; string server_string(sync_server_and_path); return data_->Init(database_location, server_string, @@ -1334,7 +1334,7 @@ bool SyncManager::SyncInternal::Init( const std::string& restored_key_for_bootstrapping, bool setup_for_test_mode) { - LOG(INFO) << "Starting SyncInternal initialization."; + VLOG(1) << "Starting SyncInternal initialization."; core_message_loop_ = MessageLoop::current(); DCHECK(core_message_loop_); @@ -1360,7 +1360,7 @@ bool SyncManager::SyncInternal::Init( // Test mode does not use a syncer context or syncer thread. if (!setup_for_test_mode) { // Build a SyncSessionContext and store the worker in it. - LOG(INFO) << "Sync is bringing up SyncSessionContext."; + VLOG(1) << "Sync is bringing up SyncSessionContext."; std::vector<SyncEngineEventListener*> listeners; listeners.push_back(&allstatus_); listeners.push_back(this); @@ -1446,15 +1446,15 @@ void SyncManager::SyncInternal::SendPendingXMPPNotification( notifier::NOTIFICATION_SERVER); notification_pending_ = notification_pending_ || new_pending_notification; if (!notification_pending_) { - LOG(INFO) << "Not sending notification: no pending notification"; + VLOG(1) << "Not sending notification: no pending notification"; return; } if (!talk_mediator_.get()) { - LOG(INFO) << "Not sending notification: shutting down " - << "(talk_mediator_ is NULL)"; + VLOG(1) << "Not sending notification: shutting down (talk_mediator_ is " + "NULL)"; return; } - LOG(INFO) << "Sending XMPP notification..."; + VLOG(1) << "Sending XMPP notification..."; OutgoingNotificationData notification_data; if (notifier_options_.notification_method == notifier::NOTIFICATION_LEGACY) { notification_data.service_id = browser_sync::kSyncLegacyServiceId; @@ -1477,9 +1477,9 @@ void SyncManager::SyncInternal::SendPendingXMPPNotification( bool success = talk_mediator_->SendNotification(notification_data); if (success) { notification_pending_ = false; - LOG(INFO) << "Sent XMPP notification"; + VLOG(1) << "Sent XMPP notification"; } else { - LOG(INFO) << "Could not send XMPP notification"; + VLOG(1) << "Could not send XMPP notification"; } } @@ -1489,9 +1489,8 @@ bool SyncManager::SyncInternal::OpenDirectory() { bool share_opened = dir_manager()->Open(username_for_share()); DCHECK(share_opened); if (!share_opened) { - if (observer_) { + if (observer_) observer_->OnStopSyncingPermanently(); - } LOG(ERROR) << "Could not open share for:" << username_for_share(); return false; @@ -1519,10 +1518,9 @@ bool SyncManager::SyncInternal::SignIn(const SyncCredentials& credentials) { DCHECK(share_.name.empty()); share_.name = credentials.email; - LOG(INFO) << "Signing in user: " << username_for_share(); - if (!OpenDirectory()) { + VLOG(1) << "Signing in user: " << username_for_share(); + if (!OpenDirectory()) return false; - } UpdateCredentials(credentials); return true; @@ -1543,15 +1541,14 @@ void SyncManager::SyncInternal::InitializeTalkMediator() { notifier::NOTIFICATION_SERVER) { syncable::ScopedDirLookup lookup(dir_manager(), username_for_share()); std::string state; - if (lookup.good()) { + if (lookup.good()) state = lookup->GetAndClearNotificationState(); - } else { + else LOG(ERROR) << "Could not read notification state"; - } if (VLOG_IS_ON(1)) { std::string encoded_state; base::Base64Encode(state, &encoded_state); - LOG(INFO) << "Read notification state: " << encoded_state; + VLOG(1) << "Read notification state: " << encoded_state; } sync_notifier::ServerNotifierThread* server_notifier_thread = new sync_notifier::ServerNotifierThread( @@ -1676,11 +1673,11 @@ void SyncManager::SyncInternal::Shutdown() { // Shutdown the xmpp buzz connection. if (talk_mediator.get()) { - LOG(INFO) << "P2P: Mediator logout started."; + VLOG(1) << "P2P: Mediator logout started."; talk_mediator->Logout(); - LOG(INFO) << "P2P: Mediator logout completed."; + VLOG(1) << "P2P: Mediator logout completed."; talk_mediator.reset(); - LOG(INFO) << "P2P: Mediator destroyed."; + VLOG(1) << "P2P: Mediator destroyed."; } // Pump any messages the auth watcher, syncer thread, or talk @@ -1715,7 +1712,7 @@ void SyncManager::SyncInternal::Shutdown() { } void SyncManager::SyncInternal::OnIPAddressChanged() { - LOG(INFO) << "IP address change detected"; + VLOG(1) << "IP address change detected"; // TODO(akalin): CheckServerReachable() can block, which may cause // jank if we try to shut down sync. Fix this. connection_manager()->CheckServerReachable(); @@ -2047,8 +2044,8 @@ void SyncManager::SyncInternal::OnSyncEngineEvent( void SyncManager::SyncInternal::OnNotificationStateChange( bool notifications_enabled) { - LOG(INFO) << "P2P: Notifications enabled = " - << (notifications_enabled ? "true" : "false"); + VLOG(1) << "P2P: Notifications enabled = " + << (notifications_enabled ? "true" : "false"); allstatus_.SetNotificationsEnabled(notifications_enabled); if (syncer_thread()) { syncer_thread()->SetNotificationsEnabled(notifications_enabled); @@ -2096,7 +2093,7 @@ void SyncManager::SyncInternal::OnIncomingNotification( browser_sync::kSyncLegacyServiceUrl) || (notification_data.service_url == browser_sync::kSyncServiceUrl)) { - LOG(INFO) << "P2P: Updates on server, pushing syncer"; + VLOG(1) << "P2P: Updates on server, pushing syncer"; if (syncer_thread()) { // Introduce a delay to help coalesce initial notifications. syncer_thread()->NudgeSyncer(250, SyncerThread::kNotification); @@ -2125,7 +2122,7 @@ void SyncManager::SyncInternal::WriteState(const std::string& state) { if (VLOG_IS_ON(1)) { std::string encoded_state; base::Base64Encode(state, &encoded_state); - LOG(INFO) << "Writing notification state: " << encoded_state; + VLOG(1) << "Writing notification state: " << encoded_state; } lookup->SetNotificationState(state); lookup->SaveChanges(); diff --git a/chrome/browser/sync/engine/syncer_proto_util.cc b/chrome/browser/sync/engine/syncer_proto_util.cc index 38531d9..ffc00d8 100644 --- a/chrome/browser/sync/engine/syncer_proto_util.cc +++ b/chrome/browser/sync/engine/syncer_proto_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -42,35 +42,37 @@ void LogResponseProfilingData(const ClientToServerResponse& response) { response_trace << "Server response trace:"; if (response.profiling_data().has_user_lookup_time()) { - response_trace << " " << "user lookup: " << - response.profiling_data().user_lookup_time() << "ms"; + response_trace << " user lookup: " + << response.profiling_data().user_lookup_time() << "ms"; } if (response.profiling_data().has_meta_data_write_time()) { - response_trace << " " << "meta write: " << - response.profiling_data().meta_data_write_time() << "ms"; + response_trace << " meta write: " + << response.profiling_data().meta_data_write_time() + << "ms"; } if (response.profiling_data().has_meta_data_read_time()) { - response_trace << " " << "meta read: " << - response.profiling_data().meta_data_read_time() << "ms"; + response_trace << " meta read: " + << response.profiling_data().meta_data_read_time() << "ms"; } if (response.profiling_data().has_file_data_write_time()) { - response_trace << " " << "file write: " << - response.profiling_data().file_data_write_time() << "ms"; + response_trace << " file write: " + << response.profiling_data().file_data_write_time() + << "ms"; } if (response.profiling_data().has_file_data_read_time()) { - response_trace << " " << "file read: " << - response.profiling_data().file_data_read_time() << "ms"; + response_trace << " file read: " + << response.profiling_data().file_data_read_time() << "ms"; } if (response.profiling_data().has_total_request_time()) { - response_trace << " " << "total time: " << - response.profiling_data().total_request_time() << "ms"; + response_trace << " total time: " + << response.profiling_data().total_request_time() << "ms"; } - LOG(INFO) << response_trace.str(); + VLOG(1) << response_trace.str(); } } @@ -95,7 +97,7 @@ bool SyncerProtoUtil::VerifyResponseBirthday(syncable::Directory* dir, return false; } - LOG(INFO) << "New store birthday: " << response->store_birthday(); + VLOG(1) << "New store birthday: " << response->store_birthday(); dir->set_store_birthday(response->store_birthday()); return true; } @@ -117,9 +119,8 @@ bool SyncerProtoUtil::VerifyResponseBirthday(syncable::Directory* dir, // static void SyncerProtoUtil::AddRequestBirthday(syncable::Directory* dir, ClientToServerMessage* msg) { - if (!dir->store_birthday().empty()) { + if (!dir->store_birthday().empty()) msg->set_store_birthday(dir->store_birthday()); - } } // static @@ -140,31 +141,30 @@ bool SyncerProtoUtil::PostAndProcessHeaders(ServerConnectionManager* scm, if (!scm->PostBufferWithCachedAuth(¶ms, &server_status_watcher)) { LOG(WARNING) << "Error posting from syncer:" << http_response; return false; - } else { - std::string new_token = - http_response.update_client_auth_header; - if (!new_token.empty()) { - SyncEngineEvent event(SyncEngineEvent::UPDATED_TOKEN); - event.updated_token = new_token; - session->context()->NotifyListeners(event); - } + } - if (response->ParseFromString(rx)) { - // TODO(tim): This is an egregious layering violation (bug 35060). - switch (response->error_code()) { - case ClientToServerResponse::ACCESS_DENIED: - case ClientToServerResponse::AUTH_INVALID: - case ClientToServerResponse::USER_NOT_ACTIVATED: - // Fires on ScopedServerStatusWatcher - http_response.server_status = HttpResponse::SYNC_AUTH_ERROR; - return false; - default: - return true; - } - } + std::string new_token = http_response.update_client_auth_header; + if (!new_token.empty()) { + SyncEngineEvent event(SyncEngineEvent::UPDATED_TOKEN); + event.updated_token = new_token; + session->context()->NotifyListeners(event); + } - return false; + if (response->ParseFromString(rx)) { + // TODO(tim): This is an egregious layering violation (bug 35060). + switch (response->error_code()) { + case ClientToServerResponse::ACCESS_DENIED: + case ClientToServerResponse::AUTH_INVALID: + case ClientToServerResponse::USER_NOT_ACTIVATED: + // Fires on ScopedServerStatusWatcher + http_response.server_status = HttpResponse::SYNC_AUTH_ERROR; + return false; + default: + return true; + } } + + return false; } // static @@ -181,16 +181,12 @@ bool SyncerProtoUtil::PostClientToServerMessage( ScopedDirLookup dir(session->context()->directory_manager(), session->context()->account_name()); - if (!dir.good()) { + if (!dir.good()) return false; - } - if (!PostAndProcessHeaders(session->context()->connection_manager(), - session, - msg, - response)) { + if (!PostAndProcessHeaders(session->context()->connection_manager(), session, + msg, response)) return false; - } if (!VerifyResponseBirthday(dir, response)) { session->status_controller()->set_syncer_stuck(true); @@ -224,11 +220,11 @@ bool SyncerProtoUtil::Compare(const syncable::Entry& local_entry, const std::string name = NameFromSyncEntity(server_entry); CHECK(local_entry.Get(ID) == server_entry.id()) << - " SyncerProtoUtil::Compare precondition not met."; + " SyncerProtoUtil::Compare precondition not met."; CHECK(server_entry.version() == local_entry.Get(BASE_VERSION)) << - " SyncerProtoUtil::Compare precondition not met."; + " SyncerProtoUtil::Compare precondition not met."; CHECK(!local_entry.Get(IS_UNSYNCED)) << - " SyncerProtoUtil::Compare precondition not met."; + " SyncerProtoUtil::Compare precondition not met."; if (local_entry.Get(IS_DEL) && server_entry.deleted()) return true; @@ -291,22 +287,16 @@ void SyncerProtoUtil::CopyBlobIntoProtoBytes(const syncable::Blob& blob, // static const std::string& SyncerProtoUtil::NameFromSyncEntity( const sync_pb::SyncEntity& entry) { - - if (entry.has_non_unique_name()) { + if (entry.has_non_unique_name()) return entry.non_unique_name(); - } - return entry.name(); } // static const std::string& SyncerProtoUtil::NameFromCommitEntryResponse( const CommitResponse_EntryResponse& entry) { - - if (entry.has_non_unique_name()) { - return entry.non_unique_name(); - } - + if (entry.has_non_unique_name()) + return entry.non_unique_name(); return entry.name(); } @@ -344,9 +334,8 @@ std::string SyncerProtoUtil::ClientToServerResponseDebugString( const sync_pb::ClientToServerResponse& response) { // Add more handlers as needed. std::string output; - if (response.has_get_updates()) { + if (response.has_get_updates()) output.append(GetUpdatesResponseString(response.get_updates())); - } return output; } diff --git a/chrome/browser/sync/engine/syncer_thread.cc b/chrome/browser/sync/engine/syncer_thread.cc index 10d28be..01e7fcd 100644 --- a/chrome/browser/sync/engine/syncer_thread.cc +++ b/chrome/browser/sync/engine/syncer_thread.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/sync/engine/syncer_thread.h" @@ -109,7 +109,7 @@ bool SyncerThread::Start() { // actually up and running. This is for consistency with the old pthread // impl because pthread_create would do this in one step. thread_main_started_.Wait(); - LOG(INFO) << "SyncerThread started."; + VLOG(1) << "SyncerThread started."; return true; } @@ -133,8 +133,8 @@ void SyncerThread::RequestSyncerExitAndSetThreadStopConditions() { if (!thread_.IsRunning()) return; - LOG(INFO) << "SyncerThread::Stop - setting ThreadMain exit condition to " - << "true (vault_.stop_syncer_thread_)"; + VLOG(1) << "SyncerThread::Stop - setting ThreadMain exit condition to true " + "(vault_.stop_syncer_thread_)"; // Exit the ThreadMainLoop once the syncer finishes (we tell it to exit // below). vault_.stop_syncer_thread_ = true; @@ -164,12 +164,12 @@ bool SyncerThread::RequestPause() { // notification. vault_.pause_requested_ = true; vault_field_changed_.Broadcast(); - LOG(INFO) << "Pause requested."; + VLOG(1) << "Pause requested."; } else { // If the thread is not running, go directly into the paused state // and notify. EnterPausedState(); - LOG(INFO) << "Paused while not running."; + VLOG(1) << "Paused while not running."; } return true; } @@ -190,7 +190,7 @@ bool SyncerThread::RequestResume() { // If pause was requested we have not yet paused. In this case, // the resume cancels the pause request. Notify(SyncEngineEvent::SYNCER_THREAD_RESUMED); - LOG(INFO) << "Pending pause canceled by resume."; + VLOG(1) << "Pending pause canceled by resume."; } else { // Unpause and notify. vault_.paused_ = false; @@ -198,7 +198,7 @@ bool SyncerThread::RequestResume() { } } else { ExitPausedState(); - LOG(INFO) << "Resumed while not running."; + VLOG(1) << "Resumed while not running."; } return true; } @@ -236,7 +236,7 @@ void SyncerThread::OnShouldStopSyncingPermanently() { void SyncerThread::ThreadMainLoop() { // This is called with lock_ acquired. lock_.AssertAcquired(); - LOG(INFO) << "In thread main loop."; + VLOG(1) << "In thread main loop."; // Use the short poll value by default. vault_.current_wait_interval_.poll_delta = @@ -251,11 +251,11 @@ void SyncerThread::ThreadMainLoop() { #endif if (vault_.syncer_ == NULL) { - LOG(INFO) << "Syncer thread waiting for database initialization."; + VLOG(1) << "Syncer thread waiting for database initialization."; while (vault_.syncer_ == NULL && !vault_.stop_syncer_thread_) vault_field_changed_.Wait(); - LOG_IF(INFO, !(vault_.syncer_ == NULL)) - << "Syncer was found after DB started."; + LOG_IF(INFO, !(vault_.syncer_ == NULL)) << "Syncer was found after DB " + "started."; } while (!vault_.stop_syncer_thread_) { @@ -291,8 +291,8 @@ void SyncerThread::ThreadMainLoop() { if (!throttled && !vault_.pending_nudge_time_.is_null()) { end_wait = std::min(end_wait, vault_.pending_nudge_time_); } - LOG(INFO) << "end_wait is " << end_wait.ToInternalValue(); - LOG(INFO) << "next_poll is " << next_poll.ToInternalValue(); + VLOG(1) << "end_wait is " << end_wait.ToInternalValue() + << "\nnext_poll is " << next_poll.ToInternalValue(); // We block until the CV is signaled (e.g a control field changed, loss of // network connection, nudge, spurious, etc), or the poll interval elapses. @@ -319,11 +319,11 @@ void SyncerThread::ThreadMainLoop() { bool nudged = UpdateNudgeSource(throttled, continue_sync_cycle, &initial_sync_for_thread); - LOG(INFO) << "Calling Sync Main at time " << Time::Now().ToInternalValue(); + VLOG(1) << "Calling Sync Main at time " << Time::Now().ToInternalValue(); SyncMain(vault_.syncer_); last_sync_time = TimeTicks::Now(); - LOG(INFO) << "Updating the next polling time after SyncMain"; + VLOG(1) << "Updating the next polling time after SyncMain"; vault_.current_wait_interval_ = CalculatePollingWaitTime( static_cast<int>(vault_.current_wait_interval_.poll_delta.InSeconds()), &user_idle_milliseconds, &continue_sync_cycle, nudged); @@ -334,7 +334,7 @@ void SyncerThread::ThreadMainLoop() { } void SyncerThread::WaitUntilConnectedOrQuit() { - LOG(INFO) << "Syncer thread waiting for connection."; + VLOG(1) << "Syncer thread waiting for connection."; Notify(SyncEngineEvent::SYNCER_THREAD_WAITING_FOR_CONNECTION); bool is_paused = vault_.paused_; @@ -345,13 +345,13 @@ void SyncerThread::WaitUntilConnectedOrQuit() { // enter the paused state. EnterPausedState(); is_paused = true; - LOG(INFO) << "Syncer thread entering disconnected pause."; + VLOG(1) << "Syncer thread entering disconnected pause."; } if (is_paused && !vault_.paused_) { ExitPausedState(); is_paused = false; - LOG(INFO) << "Syncer thread exiting disconnected pause."; + VLOG(1) << "Syncer thread exiting disconnected pause."; } vault_field_changed_.Wait(); @@ -359,12 +359,12 @@ void SyncerThread::WaitUntilConnectedOrQuit() { if (!vault_.stop_syncer_thread_) { Notify(SyncEngineEvent::SYNCER_THREAD_CONNECTED); - LOG(INFO) << "Syncer thread found connection."; + VLOG(1) << "Syncer thread found connection."; } } void SyncerThread::PauseUntilResumedOrQuit() { - LOG(INFO) << "Syncer thread entering pause."; + VLOG(1) << "Syncer thread entering pause."; // If pause was requested (rather than already being paused), send // the PAUSED notification. if (vault_.pause_requested_) @@ -379,7 +379,7 @@ void SyncerThread::PauseUntilResumedOrQuit() { if (!vault_.stop_syncer_thread_) ExitPausedState(); - LOG(INFO) << "Syncer thread exiting pause."; + VLOG(1) << "Syncer thread exiting pause."; } void SyncerThread::EnterPausedState() { @@ -421,9 +421,9 @@ SyncerThread::WaitInterval SyncerThread::CalculatePollingWaitTime( // Determine if the syncer has unfinished work to do. SyncSessionSnapshot* snapshot = session_context_->previous_session_snapshot(); const bool syncer_has_work_to_do = snapshot && - (snapshot->num_server_changes_remaining > snapshot->max_local_timestamp - || snapshot->unsynced_count > 0); - LOG(INFO) << "syncer_has_work_to_do is " << syncer_has_work_to_do; + (snapshot->num_server_changes_remaining > snapshot->max_local_timestamp || + snapshot->unsynced_count > 0); + VLOG(1) << "syncer_has_work_to_do is " << syncer_has_work_to_do; // First calculate the expected wait time, figuring in any backoff because of // user idle time. next_wait is in seconds @@ -472,9 +472,8 @@ SyncerThread::WaitInterval SyncerThread::CalculatePollingWaitTime( DCHECK_GE(return_interval.poll_delta.InSeconds(), default_next_wait); } - LOG(INFO) << "Sync wait: idle " << default_next_wait - << " non-idle or backoff " - << return_interval.poll_delta.InSeconds() << "."; + VLOG(1) << "Sync wait: idle " << default_next_wait + << " non-idle or backoff " << return_interval.poll_delta.InSeconds(); return return_interval; } @@ -485,7 +484,7 @@ void SyncerThread::ThreadMain() { // and unblock it's caller. thread_main_started_.Signal(); ThreadMainLoop(); - LOG(INFO) << "Syncer thread ThreadMain is done."; + VLOG(1) << "Syncer thread ThreadMain is done."; Notify(SyncEngineEvent::SYNCER_THREAD_EXITING); } @@ -498,10 +497,9 @@ void SyncerThread::SyncMain(Syncer* syncer) { silenced_until_ = base::TimeTicks(); AutoUnlock unlock(lock_); - while (syncer->SyncShare(this) && silenced_until_.is_null()) { - LOG(INFO) << "Looping in sync share"; - } - LOG(INFO) << "Done looping in sync share"; + while (syncer->SyncShare(this) && silenced_until_.is_null()) + VLOG(1) << "Looping in sync share"; + VLOG(1) << "Done looping in sync share"; } bool SyncerThread::UpdateNudgeSource(bool was_throttled, @@ -510,9 +508,8 @@ bool SyncerThread::UpdateNudgeSource(bool was_throttled, bool nudged = false; NudgeSource nudge_source = kUnknown; // Has the previous sync cycle completed? - if (continue_sync_cycle) { + if (continue_sync_cycle) nudge_source = kContinuation; - } // Update the nudge source if a new nudge has come through during the // previous sync cycle. if (!vault_.pending_nudge_time_.is_null()) { @@ -520,10 +517,8 @@ bool SyncerThread::UpdateNudgeSource(bool was_throttled, nudge_source = vault_.pending_nudge_source_; nudged = true; } - LOG(INFO) << "Clearing pending nudge from " - << vault_.pending_nudge_source_ - << " at tick " - << vault_.pending_nudge_time_.ToInternalValue(); + VLOG(1) << "Clearing pending nudge from " << vault_.pending_nudge_source_ + << " at tick " << vault_.pending_nudge_time_.ToInternalValue(); vault_.pending_nudge_source_ = kUnknown; vault_.pending_nudge_time_ = base::TimeTicks(); } @@ -565,7 +560,7 @@ void SyncerThread::SetUpdatesSource(bool nudged, NudgeSource nudge_source, void SyncerThread::CreateSyncer(const std::string& dirname) { AutoLock lock(lock_); - LOG(INFO) << "Creating syncer up for: " << dirname; + VLOG(1) << "Creating syncer up for: " << dirname; // The underlying database structure is ready, and we should create // the syncer. CHECK(vault_.syncer_ == NULL); @@ -677,13 +672,13 @@ void SyncerThread::NudgeSyncImpl(int milliseconds_from_now, const TimeTicks nudge_time = TimeTicks::Now() + TimeDelta::FromMilliseconds(milliseconds_from_now); if (nudge_time <= vault_.pending_nudge_time_) { - LOG(INFO) << "Nudge for source " << source - << " dropped due to existing later pending nudge"; + VLOG(1) << "Nudge for source " << source + << " dropped due to existing later pending nudge"; return; } - LOG(INFO) << "Replacing pending nudge for source " - << source << " at " << nudge_time.ToInternalValue(); + VLOG(1) << "Replacing pending nudge for source " << source + << " at " << nudge_time.ToInternalValue(); vault_.pending_nudge_source_ = source; vault_.pending_nudge_time_ = nudge_time; vault_field_changed_.Broadcast(); @@ -750,21 +745,18 @@ int SyncerThread::UserIdleTime() { if (!success) { LOG(WARNING) << "Could not get IOHIDSystem's HIDIdleTime property's value"; return 0; - } else { - return idle_time / 1000000; // nano to milli } + return idle_time / 1000000; // nano to milli #elif defined(OS_LINUX) - if (idle_query_.get()) { + if (idle_query_.get()) return idle_query_->IdleTime(); - } else { - return 0; - } + return 0; #else static bool was_logged = false; if (!was_logged) { was_logged = true; - LOG(INFO) << "UserIdleTime unimplemented on this platform, " - "synchronization will not throttle when user idle"; + VLOG(1) << "UserIdleTime unimplemented on this platform, synchronization " + "will not throttle when user idle"; } #endif diff --git a/chrome/browser/sync/engine/syncer_util.cc b/chrome/browser/sync/engine/syncer_util.cc index c279e26..b1893de 100644 --- a/chrome/browser/sync/engine/syncer_util.cc +++ b/chrome/browser/sync/engine/syncer_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -231,9 +231,9 @@ syncable::Id SyncerUtil::FindLocalIdToUpdate( // Just a quick sanity check. DCHECK(!local_entry.Get(ID).ServerKnows()); - LOG(INFO) << "Reuniting lost commit response IDs." - << " server id: " << update.id() << " local id: " - << local_entry.Get(ID) << " new version: " << new_version; + VLOG(1) << "Reuniting lost commit response IDs. server id: " + << update.id() << " local id: " << local_entry.Get(ID) + << " new version: " << new_version; return local_entry.Get(ID); } @@ -255,8 +255,8 @@ UpdateAttemptResponse SyncerUtil::AttemptToUpdateEntry( syncable::Id id = entry->Get(ID); if (entry->Get(IS_UNSYNCED)) { - LOG(INFO) << "Skipping update, returning conflict for: " << id - << " ; it's unsynced."; + VLOG(1) << "Skipping update, returning conflict for: " << id + << " ; it's unsynced."; return CONFLICT; } if (!entry->Get(SERVER_IS_DEL)) { @@ -273,8 +273,8 @@ UpdateAttemptResponse SyncerUtil::AttemptToUpdateEntry( } if (entry->Get(PARENT_ID) != new_parent) { if (!entry->Get(IS_DEL) && !IsLegalNewParent(trans, id, new_parent)) { - LOG(INFO) << "Not updating item " << id << ", illegal new parent " - "(would cause loop)."; + VLOG(1) << "Not updating item " << id + << ", illegal new parent (would cause loop)."; return CONFLICT; } } @@ -284,7 +284,7 @@ UpdateAttemptResponse SyncerUtil::AttemptToUpdateEntry( if (!handles.empty()) { // If we have still-existing children, then we need to deal with // them before we can process this change. - LOG(INFO) << "Not deleting directory; it's not empty " << *entry; + VLOG(1) << "Not deleting directory; it's not empty " << *entry; return CONFLICT; } } @@ -506,8 +506,8 @@ void SyncerUtil::SplitServerInformationIntoNewEntry( CopyServerFields(entry, &new_entry); ClearServerData(entry); - LOG(INFO) << "Splitting server information, local entry: " << *entry << - " server entry: " << new_entry; + VLOG(1) << "Splitting server information, local entry: " << *entry + << " server entry: " << new_entry; } // This function is called on an entry when we can update the user-facing data @@ -791,8 +791,8 @@ VerifyResult SyncerUtil::VerifyUndelete(syncable::WriteTransaction* trans, // (where items go to version 0 when they're deleted), or else // removed entirely (if this type of undeletion is indeed impossible). CHECK(target->good()); - LOG(INFO) << "Server update is attempting undelete. " << *target - << "Update:" << SyncerProtoUtil::SyncEntityDebugString(update); + VLOG(1) << "Server update is attempting undelete. " << *target + << "Update:" << SyncerProtoUtil::SyncEntityDebugString(update); // Move the old one aside and start over. It's too tricky to get the old one // back into a state that would pass CheckTreeInvariants(). if (target->Get(IS_DEL)) { @@ -805,8 +805,9 @@ VerifyResult SyncerUtil::VerifyUndelete(syncable::WriteTransaction* trans, return VERIFY_SUCCESS; } if (update.version() < target->Get(SERVER_VERSION)) { - LOG(WARNING) << "Update older than current server version for" << - *target << "Update:" << SyncerProtoUtil::SyncEntityDebugString(update); + LOG(WARNING) << "Update older than current server version for " + << *target << " Update:" + << SyncerProtoUtil::SyncEntityDebugString(update); return VERIFY_SUCCESS; // Expected in new sync protocol. } return VERIFY_UNDECIDED; diff --git a/chrome/browser/sync/engine/update_applicator.cc b/chrome/browser/sync/engine/update_applicator.cc index aee4aae..6922c0f 100644 --- a/chrome/browser/sync/engine/update_applicator.cc +++ b/chrome/browser/sync/engine/update_applicator.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -48,7 +48,7 @@ bool UpdateApplicator::AttemptOneApplication( if (!progress_) return false; - LOG(INFO) << "UpdateApplicator doing additional pass."; + VLOG(1) << "UpdateApplicator doing additional pass."; pointer_ = begin_; progress_ = false; diff --git a/chrome/browser/sync/engine/verify_updates_command.cc b/chrome/browser/sync/engine/verify_updates_command.cc index 0c27e72..02fb3c9 100644 --- a/chrome/browser/sync/engine/verify_updates_command.cc +++ b/chrome/browser/sync/engine/verify_updates_command.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -28,7 +28,7 @@ VerifyUpdatesCommand::~VerifyUpdatesCommand() {} void VerifyUpdatesCommand::ModelChangingExecuteImpl( sessions::SyncSession* session) { - LOG(INFO) << "Beginning Update Verification"; + VLOG(1) << "Beginning Update Verification"; ScopedDirLookup dir(session->context()->directory_manager(), session->context()->account_name()); if (!dir.good()) { @@ -40,7 +40,7 @@ void VerifyUpdatesCommand::ModelChangingExecuteImpl( const GetUpdatesResponse& updates = status->updates_response().get_updates(); int update_count = updates.entries().size(); - LOG(INFO) << update_count << " entries to verify"; + VLOG(1) << update_count << " entries to verify"; for (int i = 0; i < update_count; i++) { const SyncEntity& update = *reinterpret_cast<const SyncEntity *>(&(updates.entries(i))); |