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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/metadata_database.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
OLDNEW
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 "chrome/browser/sync_file_system/drive_backend/metadata_database.h" 5 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 file->Set("details", details); 1622 file->Set("details", details);
1623 1623
1624 files->Append(file); 1624 files->Append(file);
1625 } 1625 }
1626 1626
1627 return files; 1627 return files;
1628 } 1628 }
1629 1629
1630 std::unique_ptr<base::ListValue> MetadataDatabase::DumpDatabase() { 1630 std::unique_ptr<base::ListValue> MetadataDatabase::DumpDatabase() {
1631 std::unique_ptr<base::ListValue> list(new base::ListValue); 1631 std::unique_ptr<base::ListValue> list(new base::ListValue);
1632 list->Append(DumpTrackers().release()); 1632 list->Append(DumpTrackers());
1633 list->Append(DumpMetadata().release()); 1633 list->Append(DumpMetadata());
1634 return list; 1634 return list;
1635 } 1635 }
1636 1636
1637 bool MetadataDatabase::HasNewerFileMetadata(const std::string& file_id, 1637 bool MetadataDatabase::HasNewerFileMetadata(const std::string& file_id,
1638 int64_t change_id) { 1638 int64_t change_id) {
1639 FileMetadata metadata; 1639 FileMetadata metadata;
1640 if (!index_->GetFileMetadata(file_id, &metadata)) 1640 if (!index_->GetFileMetadata(file_id, &metadata))
1641 return false; 1641 return false;
1642 DCHECK(metadata.has_details()); 1642 DCHECK(metadata.has_details());
1643 return metadata.details().change_id() >= change_id; 1643 return metadata.details().change_id() >= change_id;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 return false; 1804 return false;
1805 1805
1806 if (!parents.empty()) 1806 if (!parents.empty())
1807 return false; 1807 return false;
1808 1808
1809 return true; 1809 return true;
1810 } 1810 }
1811 1811
1812 } // namespace drive_backend 1812 } // namespace drive_backend
1813 } // namespace sync_file_system 1813 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698