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

Side by Side Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.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: More fixes Created 4 years, 6 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
« no previous file with comments | « components/arc/net/arc_net_host_impl.cc ('k') | components/ntp_snippets/ntp_snippet.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 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 "components/data_reduction_proxy/core/common/data_reduction_proxy_event _store.h" 5 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event _store.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 const StringToConstant kDataReductionProxyBypassActionTypeTable[] = { 47 const StringToConstant kDataReductionProxyBypassActionTypeTable[] = {
48 #define BYPASS_ACTION_TYPE(label, value) \ 48 #define BYPASS_ACTION_TYPE(label, value) \
49 { #label, data_reduction_proxy::BYPASS_ACTION_TYPE_##label } \ 49 { #label, data_reduction_proxy::BYPASS_ACTION_TYPE_##label } \
50 , 50 ,
51 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_bypas s_action_list.h" 51 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_bypas s_action_list.h"
52 #undef BYPASS_ACTION_TYPE 52 #undef BYPASS_ACTION_TYPE
53 }; 53 };
54 54
55 std::string JoinListValueStrings(base::ListValue* list_value) { 55 std::string JoinListValueStrings(base::ListValue* list_value) {
56 std::vector<std::string> values; 56 std::vector<std::string> values;
57 for (auto it = list_value->begin(); it != list_value->end(); ++it) { 57 for (const auto& value : *list_value) {
58 std::string value_string; 58 std::string value_string;
59 base::Value* value = *it;
60 if (!value->GetAsString(&value_string)) 59 if (!value->GetAsString(&value_string))
61 return std::string(); 60 return std::string();
62 61
63 values.push_back(value_string); 62 values.push_back(value_string);
64 } 63 }
65 64
66 return base::JoinString(values, ";"); 65 return base::JoinString(values, ";");
67 } 66 }
68 67
69 } // namespace 68 } // namespace
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 last_bypass->SetString("url", clean_url.spec()); 269 last_bypass->SetString("url", clean_url.spec());
271 } 270 }
272 } 271 }
273 272
274 std::string json; 273 std::string json;
275 base::JSONWriter::Write(*last_bypass.get(), &json); 274 base::JSONWriter::Write(*last_bypass.get(), &json);
276 return json; 275 return json;
277 } 276 }
278 277
279 } // namespace data_reduction_proxy 278 } // namespace data_reduction_proxy
OLDNEW
« no previous file with comments | « components/arc/net/arc_net_host_impl.cc ('k') | components/ntp_snippets/ntp_snippet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698