Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: ui/app_list/search/dictionary_data_store.cc

Issue 1539583003: Convert Pass()→std::move() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/folder_image_unittest.cc ('k') | ui/app_list/search/history.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/app_list/search/dictionary_data_store.h" 5 #include "ui/app_list/search/dictionary_data_store.h"
6 6
7 #include <utility>
8
7 #include "base/callback.h" 9 #include "base/callback.h"
8 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
9 #include "base/json/json_string_value_serializer.h" 11 #include "base/json/json_string_value_serializer.h"
10 #include "base/logging.h" 12 #include "base/logging.h"
11 #include "base/sequenced_task_runner.h" 13 #include "base/sequenced_task_runner.h"
12 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
13 #include "base/task_runner_util.h" 15 #include "base/task_runner_util.h"
14 #include "base/threading/sequenced_worker_pool.h" 16 #include "base/threading/sequenced_worker_pool.h"
15 #include "base/values.h" 17 #include "base/values.h"
16 18
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 std::string error_message; 70 std::string error_message;
69 JSONFileValueDeserializer deserializer(data_file_); 71 JSONFileValueDeserializer deserializer(data_file_);
70 scoped_ptr<base::DictionaryValue> dict_value = base::DictionaryValue::From( 72 scoped_ptr<base::DictionaryValue> dict_value = base::DictionaryValue::From(
71 deserializer.Deserialize(&error_code, &error_message)); 73 deserializer.Deserialize(&error_code, &error_message));
72 if (error_code != JSONFileValueDeserializer::JSON_NO_ERROR || !dict_value) { 74 if (error_code != JSONFileValueDeserializer::JSON_NO_ERROR || !dict_value) {
73 return nullptr; 75 return nullptr;
74 } 76 }
75 77
76 scoped_ptr<base::DictionaryValue> return_dict = 78 scoped_ptr<base::DictionaryValue> return_dict =
77 make_scoped_ptr(dict_value.get()->DeepCopy()); 79 make_scoped_ptr(dict_value.get()->DeepCopy());
78 cached_dict_ = dict_value.Pass(); 80 cached_dict_ = std::move(dict_value);
79 return return_dict; 81 return return_dict;
80 } 82 }
81 83
82 bool DictionaryDataStore::SerializeData(std::string* data) { 84 bool DictionaryDataStore::SerializeData(std::string* data) {
83 JSONStringValueSerializer serializer(data); 85 JSONStringValueSerializer serializer(data);
84 serializer.set_pretty_print(true); 86 serializer.set_pretty_print(true);
85 return serializer.Serialize(*cached_dict_.get()); 87 return serializer.Serialize(*cached_dict_.get());
86 } 88 }
87 89
88 } // namespace app_list 90 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/folder_image_unittest.cc ('k') | ui/app_list/search/history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698