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

Side by Side Diff: components/sync/engine/events/configure_get_updates_request_event.cc

Issue 2374223003: Sync MDP: reimplement value conversions ontop of visitors
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/sync/engine/events/configure_get_updates_request_event.h" 5 #include "components/sync/engine/events/configure_get_updates_request_event.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "components/sync/protocol/proto_enum_conversions.h" 8 #include "components/sync/protocol/proto_enum_conversions.h"
9 #include "components/sync/protocol/proto_value_conversions.h" 9 #include "components/sync/protocol/proto_value_conversions.h"
10 10
11 namespace syncer { 11 namespace syncer {
12 12
13 ConfigureGetUpdatesRequestEvent::ConfigureGetUpdatesRequestEvent( 13 ConfigureGetUpdatesRequestEvent::ConfigureGetUpdatesRequestEvent(
14 base::Time timestamp, 14 base::Time timestamp,
15 sync_pb::SyncEnums::GetUpdatesOrigin origin, 15 sync_pb::SyncEnums::GetUpdatesOrigin origin,
16 const sync_pb::ClientToServerMessage& request) 16 const sync_pb::ClientToServerMessage& request)
17 : timestamp_(timestamp), origin_(origin), request_(request) {} 17 : timestamp_(timestamp), origin_(origin), request_(request) {}
18 18
19 ConfigureGetUpdatesRequestEvent::~ConfigureGetUpdatesRequestEvent() {} 19 ConfigureGetUpdatesRequestEvent::~ConfigureGetUpdatesRequestEvent() {}
20 20
21 base::Time ConfigureGetUpdatesRequestEvent::GetTimestamp() const { 21 base::Time ConfigureGetUpdatesRequestEvent::GetTimestamp() const {
22 return timestamp_; 22 return timestamp_;
23 } 23 }
24 24
25 std::string ConfigureGetUpdatesRequestEvent::GetType() const { 25 std::string ConfigureGetUpdatesRequestEvent::GetType() const {
26 return "Initial GetUpdates"; 26 return "Initial GetUpdates";
27 } 27 }
28 28
29 std::string ConfigureGetUpdatesRequestEvent::GetDetails() const { 29 std::string ConfigureGetUpdatesRequestEvent::GetDetails() const {
30 return base::StringPrintf("Reason: %s", GetUpdatesOriginString(origin_)); 30 return base::StringPrintf("Reason: %s", ProtoEnumToString(origin_));
31 } 31 }
32 32
33 std::unique_ptr<base::DictionaryValue> 33 std::unique_ptr<base::DictionaryValue>
34 ConfigureGetUpdatesRequestEvent::GetProtoMessage() const { 34 ConfigureGetUpdatesRequestEvent::GetProtoMessage() const {
35 return std::unique_ptr<base::DictionaryValue>( 35 return std::unique_ptr<base::DictionaryValue>(
36 ClientToServerMessageToValue(request_, false)); 36 ClientToServerMessageToValue(request_, false));
37 } 37 }
38 38
39 std::unique_ptr<ProtocolEvent> ConfigureGetUpdatesRequestEvent::Clone() const { 39 std::unique_ptr<ProtocolEvent> ConfigureGetUpdatesRequestEvent::Clone() const {
40 return std::unique_ptr<ProtocolEvent>( 40 return std::unique_ptr<ProtocolEvent>(
41 new ConfigureGetUpdatesRequestEvent(timestamp_, origin_, request_)); 41 new ConfigureGetUpdatesRequestEvent(timestamp_, origin_, request_));
42 } 42 }
43 43
44 } // namespace syncer 44 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698