| OLD | NEW |
| 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 "chrome/browser/net/spdyproxy/data_saving_metrics.h" | 5 #include "chrome/browser/net/spdyproxy/data_saving_metrics.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 base::ListValue* list_update) { | 36 base::ListValue* list_update) { |
| 37 int64 value = 0; | 37 int64 value = 0; |
| 38 std::string old_string_value; | 38 std::string old_string_value; |
| 39 bool rv = list_update->GetString(index, &old_string_value); | 39 bool rv = list_update->GetString(index, &old_string_value); |
| 40 DCHECK(rv); | 40 DCHECK(rv); |
| 41 if (rv) { | 41 if (rv) { |
| 42 rv = base::StringToInt64(old_string_value, &value); | 42 rv = base::StringToInt64(old_string_value, &value); |
| 43 DCHECK(rv); | 43 DCHECK(rv); |
| 44 } | 44 } |
| 45 value += length; | 45 value += length; |
| 46 list_update->Set(index, Value::CreateStringValue(base::Int64ToString(value))); | 46 list_update->Set(index, |
| 47 base::Value::CreateStringValue(base::Int64ToString(value))); |
| 47 } | 48 } |
| 48 | 49 |
| 49 int64 ListPrefInt64Value(const base::ListValue& list_update, size_t index) { | 50 int64 ListPrefInt64Value(const base::ListValue& list_update, size_t index) { |
| 50 std::string string_value; | 51 std::string string_value; |
| 51 if (!list_update.GetString(index, &string_value)) { | 52 if (!list_update.GetString(index, &string_value)) { |
| 52 NOTREACHED(); | 53 NOTREACHED(); |
| 53 return 0; | 54 return 0; |
| 54 } | 55 } |
| 55 | 56 |
| 56 int64 value = 0; | 57 int64 value = 0; |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 original_content_length, | 542 original_content_length, |
| 542 with_data_reduction_proxy_enabled, | 543 with_data_reduction_proxy_enabled, |
| 543 data_reduction_type, | 544 data_reduction_type, |
| 544 base::Time::Now(), | 545 base::Time::Now(), |
| 545 prefs); | 546 prefs); |
| 546 #endif // defined(OS_ANDROID) || defined(OS_IOS) | 547 #endif // defined(OS_ANDROID) || defined(OS_IOS) |
| 547 | 548 |
| 548 } | 549 } |
| 549 | 550 |
| 550 } // namespace spdyproxy | 551 } // namespace spdyproxy |
| OLD | NEW |