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

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

Issue 7978044: Sync/Valgrind: Add gmock printers for SyncChange, SyncData, SyncError. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_error.h" 5 #include "chrome/browser/sync/api/sync_error.h"
6 6
7 #include <iostream>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/tracked.h" 10 #include "base/tracked.h"
9 11
10 SyncError::SyncError() { 12 SyncError::SyncError() {
11 Clear(); 13 Clear();
12 } 14 }
13 15
14 SyncError::SyncError(const tracked_objects::Location& location, 16 SyncError::SyncError(const tracked_objects::Location& location,
15 const std::string& message, 17 const std::string& message,
16 syncable::ModelType type) { 18 syncable::ModelType type) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return type_; 85 return type_;
84 } 86 }
85 87
86 void SyncError::PrintLogError() const { 88 void SyncError::PrintLogError() const {
87 LAZY_STREAM(logging::LogMessage(location_->file_name(), 89 LAZY_STREAM(logging::LogMessage(location_->file_name(),
88 location_->line_number(), 90 location_->line_number(),
89 logging::LOG_ERROR).stream(), 91 logging::LOG_ERROR).stream(),
90 LOG_IS_ON(ERROR)) 92 LOG_IS_ON(ERROR))
91 << syncable::ModelTypeToString(type_) << " Sync Error: " << message_; 93 << syncable::ModelTypeToString(type_) << " Sync Error: " << message_;
92 } 94 }
95
96 std::ostream& operator<<(std::ostream& os, const SyncError& sync_error) {
97 return os <<
98 "{" << sync_error.IsSet() <<
99 ", " << sync_error.type() <<
akalin 2011/09/21 23:12:58 print out location to: use location->ToString()
akalin 2011/09/21 23:12:58 use ModelTypeToString()
James Hawkins 2011/09/22 01:15:26 Done.
James Hawkins 2011/09/22 01:15:26 Done.
100 ", " << sync_error.message() <<
101 "}";
102 }
OLDNEW
« chrome/browser/sync/api/sync_data.cc ('K') | « chrome/browser/sync/api/sync_error.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698