| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 return it->second; | 53 return it->second; |
| 54 } | 54 } |
| 55 | 55 |
| 56 std::string ModelSafeGroupToString(ModelSafeGroup group) { | 56 std::string ModelSafeGroupToString(ModelSafeGroup group) { |
| 57 switch (group) { | 57 switch (group) { |
| 58 case GROUP_UI: | 58 case GROUP_UI: |
| 59 return "GROUP_UI"; | 59 return "GROUP_UI"; |
| 60 case GROUP_DB: | 60 case GROUP_DB: |
| 61 return "GROUP_DB"; | 61 return "GROUP_DB"; |
| 62 case GROUP_FILE: |
| 63 return "GROUP_FILE"; |
| 62 case GROUP_HISTORY: | 64 case GROUP_HISTORY: |
| 63 return "GROUP_HISTORY"; | 65 return "GROUP_HISTORY"; |
| 64 case GROUP_PASSIVE: | 66 case GROUP_PASSIVE: |
| 65 return "GROUP_PASSIVE"; | 67 return "GROUP_PASSIVE"; |
| 66 case GROUP_PASSWORD: | 68 case GROUP_PASSWORD: |
| 67 return "GROUP_PASSWORD"; | 69 return "GROUP_PASSWORD"; |
| 68 default: | 70 default: |
| 69 NOTREACHED(); | 71 NOTREACHED(); |
| 70 return "INVALID"; | 72 return "INVALID"; |
| 71 } | 73 } |
| 72 } | 74 } |
| 73 | 75 |
| 74 ModelSafeWorker::ModelSafeWorker() {} | 76 ModelSafeWorker::ModelSafeWorker() {} |
| 75 | 77 |
| 76 ModelSafeWorker::~ModelSafeWorker() {} | 78 ModelSafeWorker::~ModelSafeWorker() {} |
| 77 | 79 |
| 78 void ModelSafeWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) { | 80 void ModelSafeWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) { |
| 79 work->Run(); // For GROUP_PASSIVE, we do the work on the current thread. | 81 work->Run(); // For GROUP_PASSIVE, we do the work on the current thread. |
| 80 } | 82 } |
| 81 | 83 |
| 82 ModelSafeGroup ModelSafeWorker::GetModelSafeGroup() { | 84 ModelSafeGroup ModelSafeWorker::GetModelSafeGroup() { |
| 83 return GROUP_PASSIVE; | 85 return GROUP_PASSIVE; |
| 84 } | 86 } |
| 85 | 87 |
| 86 } // namespace browser_sync | 88 } // namespace browser_sync |
| OLD | NEW |