OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync/internal_api/debug_info_event_listener.h" | 5 #include "chrome/browser/sync/internal_api/debug_info_event_listener.h" |
6 | 6 |
7 using browser_sync::sessions::SyncSessionSnapshot; | 7 using browser_sync::sessions::SyncSessionSnapshot; |
8 namespace sync_api { | 8 namespace sync_api { |
9 | 9 |
10 DebugInfoEventListener::DebugInfoEventListener() | 10 DebugInfoEventListener::DebugInfoEventListener() |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 sync_completed_event_info->set_num_encryption_conflicts( | 26 sync_completed_event_info->set_num_encryption_conflicts( |
27 snapshot->num_encryption_conflicts); | 27 snapshot->num_encryption_conflicts); |
28 sync_completed_event_info->set_num_hierarchy_conflicts( | 28 sync_completed_event_info->set_num_hierarchy_conflicts( |
29 snapshot->num_hierarchy_conflicts); | 29 snapshot->num_hierarchy_conflicts); |
30 sync_completed_event_info->set_num_simple_conflicts( | 30 sync_completed_event_info->set_num_simple_conflicts( |
31 snapshot->num_simple_conflicts); | 31 snapshot->num_simple_conflicts); |
32 sync_completed_event_info->set_num_server_conflicts( | 32 sync_completed_event_info->set_num_server_conflicts( |
33 snapshot->num_server_conflicts); | 33 snapshot->num_server_conflicts); |
34 | 34 |
| 35 sync_completed_event_info->set_num_updates_downloaded( |
| 36 snapshot->syncer_status.num_updates_downloaded_total); |
| 37 sync_completed_event_info->set_num_reflected_updates_downloaded( |
| 38 snapshot->syncer_status.num_reflected_updates_downloaded_total); |
| 39 sync_completed_event_info->mutable_caller_info()->set_source( |
| 40 snapshot->source.updates_source); |
| 41 sync_completed_event_info->mutable_caller_info()->set_notifications_enabled( |
| 42 snapshot->notifications_enabled); |
| 43 |
35 AddEventToQueue(event_info); | 44 AddEventToQueue(event_info); |
36 } | 45 } |
37 | 46 |
38 void DebugInfoEventListener::OnInitializationComplete( | 47 void DebugInfoEventListener::OnInitializationComplete( |
39 const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend, | 48 const browser_sync::WeakHandle<browser_sync::JsBackend>& js_backend, |
40 bool success) { | 49 bool success) { |
41 CreateAndAddEvent(sync_pb::DebugEventInfo::INITIALIZATION_COMPLETE); | 50 CreateAndAddEvent(sync_pb::DebugEventInfo::INITIALIZATION_COMPLETE); |
42 } | 51 } |
43 | 52 |
44 void DebugInfoEventListener::OnConnectionStatusChange( | 53 void DebugInfoEventListener::OnConnectionStatusChange( |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 if (events_.size() >= sync_api::kMaxEntries) { | 130 if (events_.size() >= sync_api::kMaxEntries) { |
122 DVLOG(1) << "DebugInfoEventListener::AddEventToQueue Dropping an old event " | 131 DVLOG(1) << "DebugInfoEventListener::AddEventToQueue Dropping an old event " |
123 << "because of full queue"; | 132 << "because of full queue"; |
124 | 133 |
125 events_.pop(); | 134 events_.pop(); |
126 events_dropped_ = true; | 135 events_dropped_ = true; |
127 } | 136 } |
128 events_.push(event_info); | 137 events_.push(event_info); |
129 } | 138 } |
130 } // namespace sync_api | 139 } // namespace sync_api |
OLD | NEW |