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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 std::ostringstream ss; | 84 std::ostringstream ss; |
85 ss << "{ "; | 85 ss << "{ "; |
86 for (size_t i = 0; i < list_.size(); ++i) | 86 for (size_t i = 0; i < list_.size(); ++i) |
87 ss << list_[i].DebugString() << ", "; | 87 ss << list_[i].DebugString() << ", "; |
88 ss << "}"; | 88 ss << "}"; |
89 return ss.str(); | 89 return ss.str(); |
90 } | 90 } |
91 | 91 |
92 FileChange::FileChange() { | 92 FileChange::FileChange() { |
93 } | 93 } |
| 94 FileChange::FileChange(const FileChange& other) = default; |
94 FileChange::~FileChange() {} | 95 FileChange::~FileChange() {} |
95 | 96 |
96 void FileChange::Update(const base::FilePath file_path, | 97 void FileChange::Update(const base::FilePath file_path, |
97 const FileChange::Change& new_change) { | 98 const FileChange::Change& new_change) { |
98 map_[file_path].Update(new_change); | 99 map_[file_path].Update(new_change); |
99 } | 100 } |
100 | 101 |
101 void FileChange::Update(const base::FilePath file_path, | 102 void FileChange::Update(const base::FilePath file_path, |
102 const FileChange::ChangeList& new_change) { | 103 const FileChange::ChangeList& new_change) { |
103 for (ChangeList::List::const_iterator it = new_change.list().begin(); | 104 for (ChangeList::List::const_iterator it = new_change.list().begin(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 ss << "{ "; | 147 ss << "{ "; |
147 for (FileChange::Map::const_iterator it = map_.begin(); it != map_.end(); | 148 for (FileChange::Map::const_iterator it = map_.begin(); it != map_.end(); |
148 it++) { | 149 it++) { |
149 ss << it->first.value() << ": " << it->second.DebugString() << ", "; | 150 ss << it->first.value() << ": " << it->second.DebugString() << ", "; |
150 } | 151 } |
151 ss << "}"; | 152 ss << "}"; |
152 return ss.str(); | 153 return ss.str(); |
153 } | 154 } |
154 | 155 |
155 } // namespace drive | 156 } // namespace drive |
OLD | NEW |