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

Side by Side Diff: chrome/browser/sync/engine/syncapi.cc

Issue 5705004: [SYNC] Sessions datatype refactor. Most things related to sessions under-the-... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Tests! And the refactors that helped them. And Rebase. And Comments. Created 9 years, 12 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/engine/syncapi.h" 5 #include "chrome/browser/sync/engine/syncapi.h"
6 6
7 #include <bitset> 7 #include <bitset>
8 #include <iomanip> 8 #include <iomanip>
9 #include <list> 9 #include <list>
10 #include <string> 10 #include <string>
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 int64 BaseNode::GetParentId() const { 211 int64 BaseNode::GetParentId() const {
212 return IdToMetahandle(GetTransaction()->GetWrappedTrans(), 212 return IdToMetahandle(GetTransaction()->GetWrappedTrans(),
213 GetEntry()->Get(syncable::PARENT_ID)); 213 GetEntry()->Get(syncable::PARENT_ID));
214 } 214 }
215 215
216 int64 BaseNode::GetId() const { 216 int64 BaseNode::GetId() const {
217 return GetEntry()->Get(syncable::META_HANDLE); 217 return GetEntry()->Get(syncable::META_HANDLE);
218 } 218 }
219 219
220 int64 BaseNode::GetModificationTime() const {
221 return GetEntry()->Get(syncable::MTIME);
222 }
223
220 bool BaseNode::GetIsFolder() const { 224 bool BaseNode::GetIsFolder() const {
221 return GetEntry()->Get(syncable::IS_DIR); 225 return GetEntry()->Get(syncable::IS_DIR);
222 } 226 }
223 227
224 std::wstring BaseNode::GetTitle() const { 228 std::wstring BaseNode::GetTitle() const {
225 std::wstring result; 229 std::wstring result;
226 ServerNameToSyncAPIName(GetEntry()->Get(syncable::NON_UNIQUE_NAME), &result); 230 ServerNameToSyncAPIName(GetEntry()->Get(syncable::NON_UNIQUE_NAME), &result);
227 return result; 231 return result;
228 } 232 }
229 233
(...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2348 DCHECK(data_->initialized()) << "GetUserShare requires initialization!"; 2352 DCHECK(data_->initialized()) << "GetUserShare requires initialization!";
2349 return data_->GetUserShare(); 2353 return data_->GetUserShare();
2350 } 2354 }
2351 2355
2352 bool SyncManager::HasUnsyncedItems() const { 2356 bool SyncManager::HasUnsyncedItems() const {
2353 sync_api::ReadTransaction trans(GetUserShare()); 2357 sync_api::ReadTransaction trans(GetUserShare());
2354 return (trans.GetWrappedTrans()->directory()->unsynced_entity_count() != 0); 2358 return (trans.GetWrappedTrans()->directory()->unsynced_entity_count() != 0);
2355 } 2359 }
2356 2360
2357 } // namespace sync_api 2361 } // namespace sync_api
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698