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

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

Issue 608133002: [SyncFS] Use nullptr for scoped_ptr initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nullptr
Patch Set: Created 6 years, 2 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 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 app_root_tracker->set_tracker_kind(TRACKER_KIND_REGULAR); 183 app_root_tracker->set_tracker_kind(TRACKER_KIND_REGULAR);
184 app_root_tracker->set_dirty(false); 184 app_root_tracker->set_dirty(false);
185 app_root_tracker->set_active(false); 185 app_root_tracker->set_active(false);
186 app_root_tracker->set_needs_folder_listing(false); 186 app_root_tracker->set_needs_folder_listing(false);
187 *app_root_tracker->mutable_synced_details() = app_root_metadata.details(); 187 *app_root_tracker->mutable_synced_details() = app_root_metadata.details();
188 return app_root_tracker.Pass(); 188 return app_root_tracker.Pass();
189 } 189 }
190 190
191 scoped_ptr<FileTracker> CloneFileTracker(const FileTracker* obj) { 191 scoped_ptr<FileTracker> CloneFileTracker(const FileTracker* obj) {
192 if (!obj) 192 if (!obj)
193 return scoped_ptr<FileTracker>(); 193 return nullptr;
194 return scoped_ptr<FileTracker>(new FileTracker(*obj)); 194 return scoped_ptr<FileTracker>(new FileTracker(*obj));
195 } 195 }
196 196
197 // Returns true if |db| has no content. 197 // Returns true if |db| has no content.
198 bool IsDatabaseEmpty(LevelDBWrapper* db) { 198 bool IsDatabaseEmpty(LevelDBWrapper* db) {
199 DCHECK(db); 199 DCHECK(db);
200 scoped_ptr<LevelDBWrapper::Iterator> itr(db->NewIterator()); 200 scoped_ptr<LevelDBWrapper::Iterator> itr(db->NewIterator());
201 itr->SeekToFirst(); 201 itr->SeekToFirst();
202 return !itr->Valid(); 202 return !itr->Valid();
203 } 203 }
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1791 return false; 1791 return false;
1792 1792
1793 if (!parents.empty()) 1793 if (!parents.empty())
1794 return false; 1794 return false;
1795 1795
1796 return true; 1796 return true;
1797 } 1797 }
1798 1798
1799 } // namespace drive_backend 1799 } // namespace drive_backend
1800 } // namespace sync_file_system 1800 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698