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 "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 9 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
10 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 10 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 env, data_reduction_proxy::prefs::kDailyHttpReceivedContentLength); | 102 env, data_reduction_proxy::prefs::kDailyHttpReceivedContentLength); |
103 } | 103 } |
104 | 104 |
105 jboolean DataReductionProxySettingsAndroid::IsDataReductionProxyUnreachable( | 105 jboolean DataReductionProxySettingsAndroid::IsDataReductionProxyUnreachable( |
106 JNIEnv* env, jobject obj) { | 106 JNIEnv* env, jobject obj) { |
107 return Settings()->IsDataReductionProxyUnreachable(); | 107 return Settings()->IsDataReductionProxyUnreachable(); |
108 } | 108 } |
109 | 109 |
110 // static | 110 // static |
111 bool DataReductionProxySettingsAndroid::Register(JNIEnv* env) { | 111 bool DataReductionProxySettingsAndroid::Register(JNIEnv* env) { |
112 bool register_natives_impl_result = RegisterNativesImpl(env); | 112 return RegisterNativesImpl(env); |
113 return register_natives_impl_result; | |
114 } | 113 } |
115 | 114 |
116 ScopedJavaLocalRef<jlongArray> | 115 ScopedJavaLocalRef<jlongArray> |
117 DataReductionProxySettingsAndroid::GetDailyContentLengths( | 116 DataReductionProxySettingsAndroid::GetDailyContentLengths( |
118 JNIEnv* env, const char* pref_name) { | 117 JNIEnv* env, const char* pref_name) { |
119 jlongArray result = env->NewLongArray( | 118 jlongArray result = env->NewLongArray( |
120 data_reduction_proxy::kNumDaysInHistory); | 119 data_reduction_proxy::kNumDaysInHistory); |
121 | 120 |
122 DataReductionProxySettings::ContentLengthList lengths = | 121 DataReductionProxySettings::ContentLengthList lengths = |
123 Settings()->GetDailyContentLengths(pref_name); | 122 Settings()->GetDailyContentLengths(pref_name); |
(...skipping 13 matching lines...) Expand all Loading... |
137 ProfileManager::GetActiveUserProfile()); | 136 ProfileManager::GetActiveUserProfile()); |
138 DCHECK(settings); | 137 DCHECK(settings); |
139 return settings; | 138 return settings; |
140 } | 139 } |
141 | 140 |
142 | 141 |
143 // Used by generated jni code. | 142 // Used by generated jni code. |
144 static jlong Init(JNIEnv* env, jobject obj) { | 143 static jlong Init(JNIEnv* env, jobject obj) { |
145 return reinterpret_cast<intptr_t>(new DataReductionProxySettingsAndroid()); | 144 return reinterpret_cast<intptr_t>(new DataReductionProxySettingsAndroid()); |
146 } | 145 } |
OLD | NEW |