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

Side by Side Diff: chrome/browser/sync/api/sync_change.cc

Issue 7978044: Sync/Valgrind: Add gmock printers for SyncChange, SyncData, SyncError. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes 3. Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/sync/api/sync_change.h" 5 #include "chrome/browser/sync/api/sync_change.h"
6 6
7 #include <ostream>
8
7 SyncChange::SyncChange() : change_type_(ACTION_INVALID) { 9 SyncChange::SyncChange() : change_type_(ACTION_INVALID) {
8 } 10 }
9 11
10 SyncChange::SyncChange(SyncChangeType change_type, const SyncData& sync_data) 12 SyncChange::SyncChange(SyncChangeType change_type, const SyncData& sync_data)
11 : change_type_(change_type), 13 : change_type_(change_type),
12 sync_data_(sync_data) { 14 sync_data_(sync_data) {
13 DCHECK(IsValid()); 15 DCHECK(IsValid());
14 } 16 }
15 17
16 SyncChange::~SyncChange() {} 18 SyncChange::~SyncChange() {}
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return "ACTION_ADD"; 54 return "ACTION_ADD";
53 case ACTION_UPDATE: 55 case ACTION_UPDATE:
54 return "ACTION_UPDATE"; 56 return "ACTION_UPDATE";
55 case ACTION_DELETE: 57 case ACTION_DELETE:
56 return "ACTION_DELETE"; 58 return "ACTION_DELETE";
57 default: 59 default:
58 NOTREACHED(); 60 NOTREACHED();
59 } 61 }
60 return std::string(); 62 return std::string();
61 } 63 }
64
65 std::string SyncChange::ToString() const {
66 return "{ changeType: " + ChangeTypeToString(change_type_) +
67 ", syncData: " + sync_data_.ToString() + "}";
68 }
69
70 void PrintTo(const SyncChange& sync_change, std::ostream* os) {
71 *os << sync_change.ToString();
72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698