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

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

Issue 8189003: Send important client side event information to the server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review Created 9 years, 2 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
Index: chrome/browser/sync/engine/download_updates_command.cc
diff --git a/chrome/browser/sync/engine/download_updates_command.cc b/chrome/browser/sync/engine/download_updates_command.cc
index 7677989210cb691c5fe38a06dea474419a67a0e1..f42df83e00c57b9ea3769b7368a9a0cc067524e5 100644
--- a/chrome/browser/sync/engine/download_updates_command.cc
+++ b/chrome/browser/sync/engine/download_updates_command.cc
@@ -16,6 +16,8 @@
using syncable::ScopedDirLookup;
+using sync_pb::DebugInfo;
+
namespace browser_sync {
using sessions::StatusController;
using sessions::SyncSession;
@@ -83,6 +85,8 @@ void DownloadUpdatesCommand::ExecuteImpl(SyncSession* session) {
SyncerProtoUtil::AddRequestBirthday(dir, &client_to_server_message);
+ AppendClientDebugInfoIfNeeded(session, &client_to_server_message);
tim (not reviewing) 2011/10/13 16:04:14 This method should take a DebugInfo*, not ClientTo
lipalani1 2011/10/13 21:39:18 Done.
+
bool ok = SyncerProtoUtil::PostClientToServerMessage(
client_to_server_message,
&update_response,
@@ -126,4 +130,22 @@ void DownloadUpdatesCommand::SetRequestedTypes(
DCHECK_LT(0, requested_type_count) << "Doing GetUpdates with empty filter.";
}
+void DownloadUpdatesCommand::AppendClientDebugInfoIfNeeded(
+ sessions::SyncSession* session,
+ sync_pb::ClientToServerMessage* client_to_server_message) {
+ // We want to send the debug info only once per sync cycle. Check if it has
+ // already been sent.
+ if (!session->status_controller()->debug_info_sent()) {
tim (not reviewing) 2011/10/13 16:04:14 The getter should track this. If we're building t
tim (not reviewing) 2011/10/13 16:08:22 It occurred to me that maybe you were mimicing wha
lipalani1 2011/10/13 21:39:18 Keeping the getter as the data only object. After
lipalani1 2011/10/13 21:39:18 Done.
+ VLOG(1) << "Sending client debug info ...";
+ DebugInfo* debug_info = client_to_server_message->mutable_debug_info();
+ // could be null in some unit tests.
+ if (session->context()->debug_info_getter()) {
+ session->context()->debug_info_getter()->GetAndClearDebugInfo(
+ debug_info);
+ }
+ session->status_controller()->set_debug_info_sent(true);
+ }
+}
+
+
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698