Chromium Code Reviews| 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_reduction_proxy_settings_android.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 data_reduction_proxy::kNumDaysInHistorySummary, | 109 data_reduction_proxy::kNumDaysInHistorySummary, |
| 110 &original_content_length, | 110 &original_content_length, |
| 111 &received_content_length, | 111 &received_content_length, |
| 112 &last_update_internal); | 112 &last_update_internal); |
| 113 | 113 |
| 114 return Java_ContentLengths_create(env, | 114 return Java_ContentLengths_create(env, |
| 115 original_content_length, | 115 original_content_length, |
| 116 received_content_length); | 116 received_content_length); |
| 117 } | 117 } |
| 118 | 118 |
| 119 jlong DataReductionProxySettingsAndroid::GetTotalHttpContentLengthSaved( | |
| 120 JNIEnv* env, | |
| 121 const JavaParamRef<jobject>& obj) { | |
| 122 return Settings()->GetHttpOriginalContentLength() - | |
|
tbansal1
2016/10/25 18:10:04
If only saved bytes are needed, then is it possibl
megjablon
2016/10/25 22:14:19
I implemented it this way so it was clear what con
| |
| 123 Settings()->GetHttpReceivedContentLength(); | |
| 124 } | |
| 125 | |
| 119 ScopedJavaLocalRef<jlongArray> | 126 ScopedJavaLocalRef<jlongArray> |
| 120 DataReductionProxySettingsAndroid::GetDailyOriginalContentLengths( | 127 DataReductionProxySettingsAndroid::GetDailyOriginalContentLengths( |
| 121 JNIEnv* env, | 128 JNIEnv* env, |
| 122 const JavaParamRef<jobject>& obj) { | 129 const JavaParamRef<jobject>& obj) { |
| 123 return GetDailyContentLengths( | 130 return GetDailyContentLengths( |
| 124 env, data_reduction_proxy::prefs::kDailyHttpOriginalContentLength); | 131 env, data_reduction_proxy::prefs::kDailyHttpOriginalContentLength); |
| 125 } | 132 } |
| 126 | 133 |
| 127 ScopedJavaLocalRef<jlongArray> | 134 ScopedJavaLocalRef<jlongArray> |
| 128 DataReductionProxySettingsAndroid::GetDailyReceivedContentLengths( | 135 DataReductionProxySettingsAndroid::GetDailyReceivedContentLengths( |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 if (!event_store) | 204 if (!event_store) |
| 198 return ConvertUTF8ToJavaString(env, std::string()); | 205 return ConvertUTF8ToJavaString(env, std::string()); |
| 199 | 206 |
| 200 return ConvertUTF8ToJavaString(env, event_store->SanitizedLastBypassEvent()); | 207 return ConvertUTF8ToJavaString(env, event_store->SanitizedLastBypassEvent()); |
| 201 } | 208 } |
| 202 | 209 |
| 203 // Used by generated jni code. | 210 // Used by generated jni code. |
| 204 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 211 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 205 return reinterpret_cast<intptr_t>(new DataReductionProxySettingsAndroid()); | 212 return reinterpret_cast<intptr_t>(new DataReductionProxySettingsAndroid()); |
| 206 } | 213 } |
| OLD | NEW |