OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/drive/file_change.h" | 5 #include "components/drive/file_change.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 break; | 36 break; |
37 case FILE_TYPE_NO_INFO: | 37 case FILE_TYPE_NO_INFO: |
38 // Keeps it as "no_info". | 38 // Keeps it as "no_info". |
39 break; | 39 break; |
40 } | 40 } |
41 return base::StringPrintf("%s:%s", change_string, type_string); | 41 return base::StringPrintf("%s:%s", change_string, type_string); |
42 } | 42 } |
43 | 43 |
44 FileChange::ChangeList::ChangeList() { | 44 FileChange::ChangeList::ChangeList() { |
45 } | 45 } |
| 46 FileChange::ChangeList::ChangeList(const ChangeList& other) = default; |
46 FileChange::ChangeList::~ChangeList() { | 47 FileChange::ChangeList::~ChangeList() { |
47 } | 48 } |
48 | 49 |
49 void FileChange::ChangeList::Update(const Change& new_change) { | 50 void FileChange::ChangeList::Update(const Change& new_change) { |
50 if (list_.empty()) { | 51 if (list_.empty()) { |
51 list_.push_back(new_change); | 52 list_.push_back(new_change); |
52 return; | 53 return; |
53 } | 54 } |
54 | 55 |
55 Change& last = list_.back(); | 56 Change& last = list_.back(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 ss << "{ "; | 146 ss << "{ "; |
146 for (FileChange::Map::const_iterator it = map_.begin(); it != map_.end(); | 147 for (FileChange::Map::const_iterator it = map_.begin(); it != map_.end(); |
147 it++) { | 148 it++) { |
148 ss << it->first.value() << ": " << it->second.DebugString() << ", "; | 149 ss << it->first.value() << ": " << it->second.DebugString() << ", "; |
149 } | 150 } |
150 ss << "}"; | 151 ss << "}"; |
151 return ss.str(); | 152 return ss.str(); |
152 } | 153 } |
153 | 154 |
154 } // namespace drive | 155 } // namespace drive |
OLD | NEW |