OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/sync_file_system/file_change.h" | 9 #include "chrome/browser/sync_file_system/file_change.h" |
10 | 10 |
11 namespace sync_file_system { | 11 namespace sync_file_system { |
12 | 12 |
13 FileChange::FileChange( | 13 FileChange::FileChange( |
14 ChangeType change, | 14 ChangeType change, |
15 SyncFileType file_type) | 15 SyncFileType file_type) |
16 : change_(change), | 16 : change_(change), |
17 file_type_(file_type) {} | 17 file_type_(file_type) {} |
18 | 18 |
19 std::string FileChange::DebugString() const { | 19 std::string FileChange::DebugString() const { |
20 const char* change_string = NULL; | 20 const char* change_string = nullptr; |
21 switch (change()) { | 21 switch (change()) { |
22 case FILE_CHANGE_ADD_OR_UPDATE: | 22 case FILE_CHANGE_ADD_OR_UPDATE: |
23 change_string = "ADD_OR_UPDATE"; | 23 change_string = "ADD_OR_UPDATE"; |
24 break; | 24 break; |
25 case FILE_CHANGE_DELETE: | 25 case FILE_CHANGE_DELETE: |
26 change_string = "DELETE"; | 26 change_string = "DELETE"; |
27 break; | 27 break; |
28 } | 28 } |
29 const char* type_string = "UNKNOWN"; | 29 const char* type_string = "UNKNOWN"; |
30 switch (file_type()) { | 30 switch (file_type()) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 std::string FileChangeList::DebugString() const { | 80 std::string FileChangeList::DebugString() const { |
81 std::ostringstream ss; | 81 std::ostringstream ss; |
82 ss << "{ "; | 82 ss << "{ "; |
83 for (size_t i = 0; i < list_.size(); ++i) | 83 for (size_t i = 0; i < list_.size(); ++i) |
84 ss << list_[i].DebugString() << ", "; | 84 ss << list_[i].DebugString() << ", "; |
85 ss << "}"; | 85 ss << "}"; |
86 return ss.str(); | 86 return ss.str(); |
87 } | 87 } |
88 | 88 |
89 } // namespace sync_file_system | 89 } // namespace sync_file_system |
OLD | NEW |