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

Side by Side Diff: net/http/http_server_properties_manager.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various builds. Created 4 years, 7 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "net/http/http_server_properties_manager.h" 5 #include "net/http/http_server_properties_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 AlternativeServiceMap* alternative_service_map) { 709 AlternativeServiceMap* alternative_service_map) {
710 DCHECK(alternative_service_map->Peek(server) == 710 DCHECK(alternative_service_map->Peek(server) ==
711 alternative_service_map->end()); 711 alternative_service_map->end());
712 const base::ListValue* alternative_service_list; 712 const base::ListValue* alternative_service_list;
713 if (!server_pref_dict.GetListWithoutPathExpansion( 713 if (!server_pref_dict.GetListWithoutPathExpansion(
714 kAlternativeServiceKey, &alternative_service_list)) { 714 kAlternativeServiceKey, &alternative_service_list)) {
715 return true; 715 return true;
716 } 716 }
717 717
718 AlternativeServiceInfoVector alternative_service_info_vector; 718 AlternativeServiceInfoVector alternative_service_info_vector;
719 for (const base::Value* alternative_service_list_item : 719 for (const auto& alternative_service_list_item : *alternative_service_list) {
720 *alternative_service_list) {
721 const base::DictionaryValue* alternative_service_dict; 720 const base::DictionaryValue* alternative_service_dict;
722 if (!alternative_service_list_item->GetAsDictionary( 721 if (!alternative_service_list_item->GetAsDictionary(
723 &alternative_service_dict)) 722 &alternative_service_dict))
724 return false; 723 return false;
725 AlternativeServiceInfo alternative_service_info; 724 AlternativeServiceInfo alternative_service_info;
726 if (!ParseAlternativeServiceDict(*alternative_service_dict, 725 if (!ParseAlternativeServiceDict(*alternative_service_dict,
727 server.Serialize(), 726 server.Serialize(),
728 &alternative_service_info)) { 727 &alternative_service_info)) {
729 return false; 728 return false;
730 } 729 }
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 quic_servers_dict); 1262 quic_servers_dict);
1264 } 1263 }
1265 1264
1266 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { 1265 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() {
1267 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); 1266 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread());
1268 if (!setting_prefs_) 1267 if (!setting_prefs_)
1269 ScheduleUpdateCacheOnPrefThread(); 1268 ScheduleUpdateCacheOnPrefThread();
1270 } 1269 }
1271 1270
1272 } // namespace net 1271 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698