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

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h" 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 DCHECK_EQ(length, list->GetSize()); 69 DCHECK_EQ(length, list->GetSize());
70 } 70 }
71 71
72 // Increments an int64_t, stored as a string, in a ListPref at the specified 72 // Increments an int64_t, stored as a string, in a ListPref at the specified
73 // index. The value must already exist and be a string representation of a 73 // index. The value must already exist and be a string representation of a
74 // number. 74 // number.
75 void AddInt64ToListPref(size_t index, 75 void AddInt64ToListPref(size_t index,
76 int64_t length, 76 int64_t length,
77 base::ListValue* list_update) { 77 base::ListValue* list_update) {
78 int64_t value = GetInt64PrefValue(*list_update, index) + length; 78 int64_t value = GetInt64PrefValue(*list_update, index) + length;
79 list_update->Set(index, new base::StringValue(base::Int64ToString(value))); 79 list_update->Set(index, new base::Value(base::Int64ToString(value)));
80 } 80 }
81 81
82 // DailyContentLengthUpdate maintains a data saving pref. The pref is a list 82 // DailyContentLengthUpdate maintains a data saving pref. The pref is a list
83 // of |kNumDaysInHistory| elements of daily total content lengths for the past 83 // of |kNumDaysInHistory| elements of daily total content lengths for the past
84 // |kNumDaysInHistory| days. 84 // |kNumDaysInHistory| days.
85 void RecordDailyContentLengthHistograms( 85 void RecordDailyContentLengthHistograms(
86 int64_t original_length, 86 int64_t original_length,
87 int64_t received_length, 87 int64_t received_length,
88 int64_t original_length_with_data_reduction_enabled, 88 int64_t original_length_with_data_reduction_enabled,
89 int64_t received_length_with_data_reduction_enabled, 89 int64_t received_length_with_data_reduction_enabled,
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 std::string DataReductionProxyCompressionStats::NormalizeHostname( 1252 std::string DataReductionProxyCompressionStats::NormalizeHostname(
1253 const std::string& host) { 1253 const std::string& host) {
1254 size_t pos = host.find("://"); 1254 size_t pos = host.find("://");
1255 if (pos != std::string::npos) 1255 if (pos != std::string::npos)
1256 return host.substr(pos + 3); 1256 return host.substr(pos + 3);
1257 1257
1258 return host; 1258 return host;
1259 } 1259 }
1260 1260
1261 } // namespace data_reduction_proxy 1261 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698