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

Unified Diff: chrome/browser/sync/engine/syncapi.cc

Issue 7024058: [Sync] Clean up sync logging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments Created 9 years, 6 months 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 | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/engine/syncapi_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncapi.cc
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 30b95689fec325745cf01f2fa84ce136d344a6b1..4f5b30833cf25c667c2b9520ff99ec81e24a8330 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -17,6 +17,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/command_line.h"
+#include "base/compiler_specific.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -479,8 +480,16 @@ void WriteNode::EncryptIfNecessary(sync_pb::EntitySpecifics* unencrypted) {
}
sync_pb::EntitySpecifics encrypted;
syncable::AddDefaultExtensionValue(type, &encrypted);
- VLOG(2) << "Encrypted specifics of type " << syncable::ModelTypeToString(type)
- << " with content: " << unencrypted->SerializeAsString() << "\n";
+ if (VLOG_IS_ON(2)) {
+ std::string unencrypted_base64;
+ if (!base::Base64Encode(unencrypted->SerializeAsString(),
+ &unencrypted_base64)) {
+ NOTREACHED();
+ }
+ VLOG(2) << "Encrypted specifics of type "
+ << syncable::ModelTypeToString(type)
+ << " with content: " << unencrypted_base64 << "\n";
+ }
if (!GetTransaction()->GetCryptographer()->Encrypt(
*unencrypted,
encrypted.mutable_encrypted())) {
@@ -1195,8 +1204,9 @@ class SyncManager::SyncInternal
static const int kDefaultNudgeDelayMilliseconds;
static const int kPreferencesNudgeDelayMilliseconds;
public:
- explicit SyncInternal(SyncManager* sync_manager)
- : core_message_loop_(NULL),
+ SyncInternal(const std::string& name, SyncManager* sync_manager)
+ : name_(name),
+ core_message_loop_(NULL),
parent_router_(NULL),
sync_manager_(sync_manager),
registrar_(NULL),
@@ -1597,6 +1607,8 @@ class SyncManager::SyncInternal
browser_sync::JsArgList FindNodesContainingString(
const browser_sync::JsArgList& args);
+ const std::string name_;
+
// We couple the DirectoryManager and username together in a UserShare member
// so we can return a handle to share_ to clients of the API for use when
// constructing any transaction type.
@@ -1667,9 +1679,8 @@ const int SyncManager::SyncInternal::kPreferencesNudgeDelayMilliseconds = 2000;
SyncManager::Observer::~Observer() {}
-SyncManager::SyncManager() {
- data_ = new SyncInternal(this);
-}
+SyncManager::SyncManager(const std::string& name)
+ : data_(new SyncInternal(name, ALLOW_THIS_IN_INITIALIZER_LIST(this))) {}
bool SyncManager::Init(const FilePath& database_location,
const char* sync_server_and_path,
@@ -1837,7 +1848,8 @@ bool SyncManager::SyncInternal::Init(
listeners);
context->set_account_name(credentials.email);
// The SyncerThread takes ownership of |context|.
- syncer_thread_.reset(new SyncerThread(context, new Syncer()));
+ syncer_thread_.reset(
+ new SyncerThread(name_, context, new Syncer()));
}
bool signed_in = SignIn(credentials);
« no previous file with comments | « chrome/browser/sync/engine/syncapi.h ('k') | chrome/browser/sync/engine/syncapi_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698