summaryrefslogtreecommitdiffstats
path: root/sync/sessions/sync_source_info.h
blob: 0eedd40b0d21a9325a838f3859d250811751c638 (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
// 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.

#ifndef SYNC_SESSIONS_SYNC_SOURCE_INFO_H_
#define SYNC_SESSIONS_SYNC_SOURCE_INFO_H_
#pragma once

#include "base/basictypes.h"
#include "sync/engine/syncproto.h"
#include "sync/syncable/model_type.h"
#include "sync/syncable/model_type_payload_map.h"

namespace base {
class DictionaryValue;
}

namespace browser_sync {
namespace sessions {

// A container for the source of a sync session. This includes the update
// source, the datatypes triggering the sync session, and possible session
// specific payloads which should be sent to the server.
struct SyncSourceInfo {
  SyncSourceInfo();
  explicit SyncSourceInfo(const syncable::ModelTypePayloadMap& t);
  SyncSourceInfo(
      const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& u,
      const syncable::ModelTypePayloadMap& t);
  ~SyncSourceInfo();

  // Caller takes ownership of the returned dictionary.
  base::DictionaryValue* ToValue() const;

  sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source;
  syncable::ModelTypePayloadMap types;
};

}  // namespace sessions
}  // namespace browser_sync

#endif  // SYNC_SESSIONS_SYNC_SOURCE_INFO_H_