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/sync/syncable/write_transaction_info.h" | 5 #include "components/sync/syncable/write_transaction_info.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 size_t max_mutations_size) const { | 34 size_t max_mutations_size) const { |
35 base::DictionaryValue* dict = new base::DictionaryValue(); | 35 base::DictionaryValue* dict = new base::DictionaryValue(); |
36 dict->SetString("id", base::Int64ToString(id)); | 36 dict->SetString("id", base::Int64ToString(id)); |
37 dict->SetString("location", location_string); | 37 dict->SetString("location", location_string); |
38 dict->SetString("writer", WriterTagToString(writer)); | 38 dict->SetString("writer", WriterTagToString(writer)); |
39 std::unique_ptr<base::Value> mutations_value; | 39 std::unique_ptr<base::Value> mutations_value; |
40 const size_t mutations_size = mutations.Get().size(); | 40 const size_t mutations_size = mutations.Get().size(); |
41 if (mutations_size <= max_mutations_size) { | 41 if (mutations_size <= max_mutations_size) { |
42 mutations_value = EntryKernelMutationMapToValue(mutations.Get()); | 42 mutations_value = EntryKernelMutationMapToValue(mutations.Get()); |
43 } else { | 43 } else { |
44 mutations_value = base::MakeUnique<base::StringValue>( | 44 mutations_value = base::MakeUnique<base::Value>( |
45 base::SizeTToString(mutations_size) + " mutations"); | 45 base::SizeTToString(mutations_size) + " mutations"); |
46 } | 46 } |
47 dict->Set("mutations", std::move(mutations_value)); | 47 dict->Set("mutations", std::move(mutations_value)); |
48 return dict; | 48 return dict; |
49 } | 49 } |
50 | 50 |
51 } // namespace syncable | 51 } // namespace syncable |
52 } // namespace syncer | 52 } // namespace syncer |
OLD | NEW |