summaryrefslogtreecommitdiffstats
path: root/sync/sessions/syncer_status.cc
blob: ba318e427a1df46413ad6a6b74a692133bd9ff6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2012 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 "sync/sessions/syncer_status.h"

#include "base/values.h"

namespace browser_sync {
namespace sessions {

SyncerStatus::SyncerStatus()
    : invalid_store(false),
      num_successful_commits(0),
      num_successful_bookmark_commits(0),
      num_updates_downloaded_total(0),
      num_tombstone_updates_downloaded_total(0),
      num_reflected_updates_downloaded_total(0),
      num_local_overwrites(0),
      num_server_overwrites(0) {
}

SyncerStatus::~SyncerStatus() {
}

DictionaryValue* SyncerStatus::ToValue() const {
  DictionaryValue* value = new DictionaryValue();
  value->SetBoolean("invalidStore", invalid_store);
  value->SetInteger("numSuccessfulCommits", num_successful_commits);
  value->SetInteger("numSuccessfulBookmarkCommits",
                num_successful_bookmark_commits);
  value->SetInteger("numUpdatesDownloadedTotal",
                num_updates_downloaded_total);
  value->SetInteger("numTombstoneUpdatesDownloadedTotal",
                num_tombstone_updates_downloaded_total);
  value->SetInteger("numReflectedUpdatesDownloadedTotal",
                num_reflected_updates_downloaded_total);
  value->SetInteger("numLocalOverwrites", num_local_overwrites);
  value->SetInteger("numServerOverwrites", num_server_overwrites);
  return value;
}

}  // namespace sessions
}  // namespace browser_sync