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

Side by Side Diff: sync/internal_api/events/commit_request_event.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sync/internal_api/public/events/commit_request_event.h"
6
7 #include <stddef.h>
8
9 #include "base/format_macros.h"
10 #include "base/strings/stringprintf.h"
11 #include "sync/protocol/proto_value_conversions.h"
12
13 namespace syncer {
14
15 CommitRequestEvent::CommitRequestEvent(
16 base::Time timestamp,
17 size_t num_items,
18 ModelTypeSet contributing_types,
19 const sync_pb::ClientToServerMessage& request)
20 : timestamp_(timestamp),
21 num_items_(num_items),
22 contributing_types_(contributing_types),
23 request_(request) {}
24
25 CommitRequestEvent::~CommitRequestEvent() {}
26
27 base::Time CommitRequestEvent::GetTimestamp() const {
28 return timestamp_;
29 }
30
31 std::string CommitRequestEvent::GetType() const {
32 return "Commit Request";
33 }
34
35 std::string CommitRequestEvent::GetDetails() const {
36 return base::StringPrintf(
37 "Item count: %" PRIuS "\n"
38 "Contributing types: %s",
39 num_items_,
40 ModelTypeSetToString(contributing_types_).c_str());
41 }
42
43 std::unique_ptr<base::DictionaryValue> CommitRequestEvent::GetProtoMessage()
44 const {
45 return std::unique_ptr<base::DictionaryValue>(
46 ClientToServerMessageToValue(request_, false));
47 }
48
49 std::unique_ptr<ProtocolEvent> CommitRequestEvent::Clone() const {
50 return std::unique_ptr<ProtocolEvent>(new CommitRequestEvent(
51 timestamp_, num_items_, contributing_types_, request_));
52 }
53
54 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/events/clear_server_data_response_event.cc ('k') | sync/internal_api/events/commit_response_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698