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 "sync/internal_api/sync_manager_impl.h" | 5 #include "sync/internal_api/sync_manager_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 break; | 161 break; |
162 default: | 162 default: |
163 NOTREACHED(); | 163 NOTREACHED(); |
164 } | 164 } |
165 return delay; | 165 return delay; |
166 } | 166 } |
167 }; | 167 }; |
168 | 168 |
169 SyncManagerImpl::SyncManagerImpl(const std::string& name) | 169 SyncManagerImpl::SyncManagerImpl(const std::string& name) |
170 : name_(name), | 170 : name_(name), |
171 weak_ptr_factory_(this), | |
172 change_delegate_(NULL), | 171 change_delegate_(NULL), |
173 initialized_(false), | 172 initialized_(false), |
174 observing_network_connectivity_changes_(false), | 173 observing_network_connectivity_changes_(false), |
175 invalidator_state_(DEFAULT_INVALIDATION_ERROR), | 174 invalidator_state_(DEFAULT_INVALIDATION_ERROR), |
176 traffic_recorder_(kMaxMessagesToRecord, kMaxMessageSizeToRecord), | 175 traffic_recorder_(kMaxMessagesToRecord, kMaxMessageSizeToRecord), |
177 encryptor_(NULL), | 176 encryptor_(NULL), |
178 report_unrecoverable_error_function_(NULL) { | 177 report_unrecoverable_error_function_(NULL), |
| 178 weak_ptr_factory_(this) { |
179 // Pre-fill |notification_info_map_|. | 179 // Pre-fill |notification_info_map_|. |
180 for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) { | 180 for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) { |
181 notification_info_map_.insert( | 181 notification_info_map_.insert( |
182 std::make_pair(ModelTypeFromInt(i), NotificationInfo())); | 182 std::make_pair(ModelTypeFromInt(i), NotificationInfo())); |
183 } | 183 } |
184 | 184 |
185 // Bind message handlers. | 185 // Bind message handlers. |
186 BindJsMessageHandler( | 186 BindJsMessageHandler( |
187 "getNotificationState", | 187 "getNotificationState", |
188 &SyncManagerImpl::GetNotificationState); | 188 &SyncManagerImpl::GetNotificationState); |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1337 int SyncManagerImpl::GetDefaultNudgeDelay() { |
1338 return kDefaultNudgeDelayMilliseconds; | 1338 return kDefaultNudgeDelayMilliseconds; |
1339 } | 1339 } |
1340 | 1340 |
1341 // static. | 1341 // static. |
1342 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1342 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
1343 return kPreferencesNudgeDelayMilliseconds; | 1343 return kPreferencesNudgeDelayMilliseconds; |
1344 } | 1344 } |
1345 | 1345 |
1346 } // namespace syncer | 1346 } // namespace syncer |
OLD | NEW |