| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "components/sync_driver/glue/synced_session.h" | 5 #include "components/sync_sessions/synced_session.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 | 8 |
| 9 namespace sync_driver { | 9 namespace sync_driver { |
| 10 | 10 |
| 11 SyncedSession::SyncedSession() | 11 SyncedSession::SyncedSession() |
| 12 : session_tag("invalid"), device_type(TYPE_UNSET) { | 12 : session_tag("invalid"), device_type(TYPE_UNSET) {} |
| 13 } | |
| 14 | 13 |
| 15 SyncedSession::~SyncedSession() { | 14 SyncedSession::~SyncedSession() { |
| 16 STLDeleteContainerPairSecondPointers(windows.begin(), windows.end()); | 15 STLDeleteContainerPairSecondPointers(windows.begin(), windows.end()); |
| 17 } | 16 } |
| 18 | 17 |
| 19 sync_pb::SessionHeader SyncedSession::ToSessionHeader() const { | 18 sync_pb::SessionHeader SyncedSession::ToSessionHeader() const { |
| 20 sync_pb::SessionHeader header; | 19 sync_pb::SessionHeader header; |
| 21 SyncedWindowMap::const_iterator iter; | 20 SyncedWindowMap::const_iterator iter; |
| 22 for (iter = windows.begin(); iter != windows.end(); ++iter) { | 21 for (iter = windows.begin(); iter != windows.end(); ++iter) { |
| 23 sync_pb::SessionWindow* w = header.add_window(); | 22 sync_pb::SessionWindow* w = header.add_window(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 46 case SyncedSession::TYPE_OTHER: | 45 case SyncedSession::TYPE_OTHER: |
| 47 // Intentionally fall-through | 46 // Intentionally fall-through |
| 48 default: | 47 default: |
| 49 header.set_device_type(sync_pb::SyncEnums_DeviceType_TYPE_OTHER); | 48 header.set_device_type(sync_pb::SyncEnums_DeviceType_TYPE_OTHER); |
| 50 break; | 49 break; |
| 51 } | 50 } |
| 52 return header; | 51 return header; |
| 53 } | 52 } |
| 54 | 53 |
| 55 } // namespace sync_driver | 54 } // namespace sync_driver |
| OLD | NEW |