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/browser_sync/profile_sync_service.h" | 5 #include "components/browser_sync/profile_sync_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cstddef> | 9 #include <cstddef> |
10 #include <map> | 10 #include <map> |
(...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2132 } | 2132 } |
2133 } | 2133 } |
2134 | 2134 |
2135 // Called when the set of nodes for a type has been returned. | 2135 // Called when the set of nodes for a type has been returned. |
2136 // Only return one type of nodes each time. | 2136 // Only return one type of nodes each time. |
2137 void GetAllNodesRequestHelper::OnReceivedNodesForType( | 2137 void GetAllNodesRequestHelper::OnReceivedNodesForType( |
2138 const syncer::ModelType type, | 2138 const syncer::ModelType type, |
2139 std::unique_ptr<base::ListValue> node_list) { | 2139 std::unique_ptr<base::ListValue> node_list) { |
2140 DCHECK(thread_checker_.CalledOnValidThread()); | 2140 DCHECK(thread_checker_.CalledOnValidThread()); |
2141 | 2141 |
2142 // Add these results to our list. | 2142 if (node_list) { |
2143 std::unique_ptr<base::DictionaryValue> type_dict(new base::DictionaryValue()); | 2143 // Add these results to our list. |
2144 type_dict->SetString("type", ModelTypeToString(type)); | 2144 std::unique_ptr<base::DictionaryValue> type_dict( |
2145 type_dict->Set("nodes", std::move(node_list)); | 2145 new base::DictionaryValue()); |
2146 result_accumulator_->Append(std::move(type_dict)); | 2146 type_dict->SetString("type", ModelTypeToString(type)); |
| 2147 type_dict->Set("nodes", std::move(node_list)); |
| 2148 result_accumulator_->Append(std::move(type_dict)); |
| 2149 } |
2147 | 2150 |
2148 // Remember that this part of the request is satisfied. | 2151 // Remember that this part of the request is satisfied. |
2149 awaiting_types_.Remove(type); | 2152 awaiting_types_.Remove(type); |
2150 | 2153 |
2151 if (awaiting_types_.Empty()) { | 2154 if (awaiting_types_.Empty()) { |
2152 callback_.Run(std::move(result_accumulator_)); | 2155 callback_.Run(std::move(result_accumulator_)); |
2153 callback_.Reset(); | 2156 callback_.Reset(); |
2154 } | 2157 } |
2155 } | 2158 } |
2156 | 2159 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2450 return; | 2453 return; |
2451 | 2454 |
2452 DCHECK(startup_controller_->IsSetupInProgress()); | 2455 DCHECK(startup_controller_->IsSetupInProgress()); |
2453 startup_controller_->SetSetupInProgress(false); | 2456 startup_controller_->SetSetupInProgress(false); |
2454 | 2457 |
2455 if (IsEngineInitialized()) | 2458 if (IsEngineInitialized()) |
2456 ReconfigureDatatypeManager(); | 2459 ReconfigureDatatypeManager(); |
2457 NotifyObservers(); | 2460 NotifyObservers(); |
2458 } | 2461 } |
2459 } // namespace browser_sync | 2462 } // namespace browser_sync |
OLD | NEW |