| 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/engine/model_safe_worker.h" | 5 #include "chrome/browser/sync/engine/model_safe_worker.h" |
| 6 | 6 |
| 7 namespace browser_sync { | 7 namespace browser_sync { |
| 8 | 8 |
| 9 ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, | 9 ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, |
| 10 const ModelSafeRoutingInfo& routes) { | 10 const ModelSafeRoutingInfo& routes) { |
| 11 ModelSafeRoutingInfo::const_iterator it = routes.find(type); | 11 ModelSafeRoutingInfo::const_iterator it = routes.find(type); |
| 12 if (it == routes.end()) { | 12 if (it == routes.end()) { |
| 13 // TODO(tim): We shouldn't end up here for TOP_LEVEL_FOLDER, but an issue | 13 // TODO(tim): We shouldn't end up here for TOP_LEVEL_FOLDER, but an issue |
| 14 // with the server's PermanentItemPopulator is causing TLF updates in | 14 // with the server's PermanentItemPopulator is causing TLF updates in |
| 15 // some cases. See bug 36735. | 15 // some cases. See bug 36735. |
| 16 if (type != syncable::UNSPECIFIED && type != syncable::TOP_LEVEL_FOLDER) | 16 if (type != syncable::UNSPECIFIED && type != syncable::TOP_LEVEL_FOLDER) |
| 17 NOTREACHED() << "Entry does not belong to active ModelSafeGroup!"; | 17 LOG(WARNING) << "Entry does not belong to active ModelSafeGroup!"; |
| 18 return GROUP_PASSIVE; | 18 return GROUP_PASSIVE; |
| 19 } | 19 } |
| 20 return it->second; | 20 return it->second; |
| 21 } | 21 } |
| 22 | 22 |
| 23 std::string ModelSafeGroupToString(ModelSafeGroup group) { | 23 std::string ModelSafeGroupToString(ModelSafeGroup group) { |
| 24 switch (group) { | 24 switch (group) { |
| 25 case GROUP_UI: | 25 case GROUP_UI: |
| 26 return "GROUP_UI"; | 26 return "GROUP_UI"; |
| 27 case GROUP_DB: | 27 case GROUP_DB: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 49 ModelSafeGroup ModelSafeWorker::GetModelSafeGroup() { | 49 ModelSafeGroup ModelSafeWorker::GetModelSafeGroup() { |
| 50 return GROUP_PASSIVE; | 50 return GROUP_PASSIVE; |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool ModelSafeWorker::CurrentThreadIsWorkThread() { | 53 bool ModelSafeWorker::CurrentThreadIsWorkThread() { |
| 54 // The passive group is not the work thread for any browser model. | 54 // The passive group is not the work thread for any browser model. |
| 55 return false; | 55 return false; |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace browser_sync | 58 } // namespace browser_sync |
| OLD | NEW |