OLD | NEW |
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/glue/session_model_associator.h" | 5 #include "chrome/browser/sync/glue/session_model_associator.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 int64* sync_id) { | 92 int64* sync_id) { |
93 sync_api::ReadTransaction trans( | 93 sync_api::ReadTransaction trans( |
94 sync_service_->backend()->GetUserShareHandle()); | 94 sync_service_->backend()->GetUserShareHandle()); |
95 sync_api::ReadNode node(&trans); | 95 sync_api::ReadNode node(&trans); |
96 if (!node.InitByClientTagLookup(syncable::SESSIONS, *tag)) | 96 if (!node.InitByClientTagLookup(syncable::SESSIONS, *tag)) |
97 return false; | 97 return false; |
98 *sync_id = node.GetId(); | 98 *sync_id = node.GetId(); |
99 return true; | 99 return true; |
100 } | 100 } |
101 | 101 |
102 int64 SessionModelAssociator::GetSyncIdFromChromeId(std::string id) { | 102 int64 SessionModelAssociator::GetSyncIdFromChromeId(const std::string& id) { |
103 sync_api::ReadTransaction trans( | 103 sync_api::ReadTransaction trans( |
104 sync_service_->backend()->GetUserShareHandle()); | 104 sync_service_->backend()->GetUserShareHandle()); |
105 sync_api::ReadNode node(&trans); | 105 sync_api::ReadNode node(&trans); |
106 if (!node.InitByClientTagLookup(syncable::SESSIONS, id)) | 106 if (!node.InitByClientTagLookup(syncable::SESSIONS, id)) |
107 return sync_api::kInvalidId; | 107 return sync_api::kInvalidId; |
108 return node.GetId(); | 108 return node.GetId(); |
109 } | 109 } |
110 | 110 |
111 bool SessionModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) { | 111 bool SessionModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) { |
112 DCHECK(CalledOnValidThread()); | 112 DCHECK(CalledOnValidThread()); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 return false; | 563 return false; |
564 } | 564 } |
565 create_node.SetSessionSpecifics(*session_data); | 565 create_node.SetSessionSpecifics(*session_data); |
566 return true; | 566 return true; |
567 } | 567 } |
568 write_node.SetSessionSpecifics(*session_data); | 568 write_node.SetSessionSpecifics(*session_data); |
569 return true; | 569 return true; |
570 } | 570 } |
571 | 571 |
572 } // namespace browser_sync | 572 } // namespace browser_sync |
OLD | NEW |