| 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/public/engine/model_safe_worker.h" | 5 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 6 | 6 |
| 7 #include <memory> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/values.h" | 11 #include "base/values.h" |
| 11 | 12 |
| 12 namespace syncer { | 13 namespace syncer { |
| 13 | 14 |
| 14 scoped_ptr<base::DictionaryValue> ModelSafeRoutingInfoToValue( | 15 std::unique_ptr<base::DictionaryValue> ModelSafeRoutingInfoToValue( |
| 15 const ModelSafeRoutingInfo& routing_info) { | 16 const ModelSafeRoutingInfo& routing_info) { |
| 16 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 17 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 17 for (ModelSafeRoutingInfo::const_iterator it = routing_info.begin(); | 18 for (ModelSafeRoutingInfo::const_iterator it = routing_info.begin(); |
| 18 it != routing_info.end(); ++it) { | 19 it != routing_info.end(); ++it) { |
| 19 dict->SetString(ModelTypeToString(it->first), | 20 dict->SetString(ModelTypeToString(it->first), |
| 20 ModelSafeGroupToString(it->second)); | 21 ModelSafeGroupToString(it->second)); |
| 21 } | 22 } |
| 22 return dict; | 23 return dict; |
| 23 } | 24 } |
| 24 | 25 |
| 25 std::string ModelSafeRoutingInfoToString( | 26 std::string ModelSafeRoutingInfoToString( |
| 26 const ModelSafeRoutingInfo& routing_info) { | 27 const ModelSafeRoutingInfo& routing_info) { |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return; | 192 return; |
| 192 DCHECK_EQ(base::MessageLoop::current(), working_loop_); | 193 DCHECK_EQ(base::MessageLoop::current(), working_loop_); |
| 193 } | 194 } |
| 194 | 195 |
| 195 DCHECK(stopped_); | 196 DCHECK(stopped_); |
| 196 base::MessageLoop::current()->RemoveDestructionObserver(this); | 197 base::MessageLoop::current()->RemoveDestructionObserver(this); |
| 197 unregister_done_callback.Run(GetModelSafeGroup()); | 198 unregister_done_callback.Run(GetModelSafeGroup()); |
| 198 } | 199 } |
| 199 | 200 |
| 200 } // namespace syncer | 201 } // namespace syncer |
| OLD | NEW |