| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/sync/glue/session_model_associator.h" | 5 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 // a pre-existing node that has encryption issues. But, since we can't | 628 // a pre-existing node that has encryption issues. But, since we can't |
| 629 // load the item, we can't remove it, and error out at this point. | 629 // load the item, we can't remove it, and error out at this point. |
| 630 return error_handler_->CreateAndUploadError( | 630 return error_handler_->CreateAndUploadError( |
| 631 FROM_HERE, | 631 FROM_HERE, |
| 632 "Failed to create sessions header sync node.", | 632 "Failed to create sessions header sync node.", |
| 633 model_type()); | 633 model_type()); |
| 634 } | 634 } |
| 635 | 635 |
| 636 // Write the initial values to the specifics so that in case of a crash or | 636 // Write the initial values to the specifics so that in case of a crash or |
| 637 // error we don't persist a half-written node. | 637 // error we don't persist a half-written node. |
| 638 write_node.SetTitle(UTF8ToWide(current_machine_tag_)); | 638 write_node.SetTitle(base::UTF8ToWide(current_machine_tag_)); |
| 639 sync_pb::SessionSpecifics base_specifics; | 639 sync_pb::SessionSpecifics base_specifics; |
| 640 base_specifics.set_session_tag(current_machine_tag_); | 640 base_specifics.set_session_tag(current_machine_tag_); |
| 641 sync_pb::SessionHeader* header_s = base_specifics.mutable_header(); | 641 sync_pb::SessionHeader* header_s = base_specifics.mutable_header(); |
| 642 header_s->set_client_name(current_session_name_); | 642 header_s->set_client_name(current_session_name_); |
| 643 header_s->set_device_type(DeviceInfo::GetLocalDeviceType()); | 643 header_s->set_device_type(DeviceInfo::GetLocalDeviceType()); |
| 644 write_node.SetSessionSpecifics(base_specifics); | 644 write_node.SetSessionSpecifics(base_specifics); |
| 645 | 645 |
| 646 local_session_syncid_ = write_node.GetId(); | 646 local_session_syncid_ = write_node.GetId(); |
| 647 } | 647 } |
| 648 #if defined(OS_ANDROID) | 648 #if defined(OS_ANDROID) |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 tab_s->set_tab_id(new_tab_id); | 1210 tab_s->set_tab_id(new_tab_id); |
| 1211 tab_node.SetSessionSpecifics(session_specifics); | 1211 tab_node.SetSessionSpecifics(session_specifics); |
| 1212 // Update tab node pool with the new association. | 1212 // Update tab node pool with the new association. |
| 1213 local_tab_pool_.ReassociateTabNode(tab_node_id, new_tab_id); | 1213 local_tab_pool_.ReassociateTabNode(tab_node_id, new_tab_id); |
| 1214 } | 1214 } |
| 1215 } | 1215 } |
| 1216 } | 1216 } |
| 1217 } | 1217 } |
| 1218 | 1218 |
| 1219 } // namespace browser_sync | 1219 } // namespace browser_sync |
| OLD | NEW |