summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/events/poll_get_updates_request_event.cc
blob: c6eecb9807459f3e86a2ee14a471deae1530387e (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 2014 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/internal_api/public/events/poll_get_updates_request_event.h"

#include "sync/protocol/proto_value_conversions.h"

namespace syncer {

PollGetUpdatesRequestEvent::PollGetUpdatesRequestEvent(
      base::Time timestamp,
      const sync_pb::ClientToServerMessage& request)
  : timestamp_(timestamp),
    request_(request) { }

PollGetUpdatesRequestEvent::~PollGetUpdatesRequestEvent() {}

base::Time PollGetUpdatesRequestEvent::GetTimestamp() const {
  return timestamp_;
}

std::string PollGetUpdatesRequestEvent::GetType() const {
  return "Poll GetUpdate request";
}

std::string PollGetUpdatesRequestEvent::GetDetails() const {
  return std::string();
}

scoped_ptr<base::DictionaryValue>
PollGetUpdatesRequestEvent::GetProtoMessage() const {
  return scoped_ptr<base::DictionaryValue>(
    ClientToServerMessageToValue(request_, false));
}

scoped_ptr<ProtocolEvent> PollGetUpdatesRequestEvent::Clone() const {
  return scoped_ptr<ProtocolEvent>(
      new PollGetUpdatesRequestEvent(
          timestamp_,
          request_));
}

}  // namespace