| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_ANDROID_H_ |
| 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_ANDROID_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 |
| 12 class Profile; |
| 13 |
| 14 namespace base { |
| 15 namespace android { |
| 16 template <typename T> |
| 17 class JavaParamRef; |
| 18 } // namespace android |
| 19 } // namespace base |
| 20 |
| 21 namespace predictors { |
| 22 |
| 23 class ResourcePrefetchPredictor; |
| 24 |
| 25 class ResourcePrefetchPredictorAndroid { |
| 26 public: |
| 27 // See ResourcePrefetchPredictor::StartPrefetching(). |
| 28 void StartPrefetching(JNIEnv* env, |
| 29 const base::android::JavaParamRef<jobject>& jcaller, |
| 30 const base::android::JavaParamRef<jstring>& j_url); |
| 31 // See ResourcePrefetchPredictor::StopPrefetching(). |
| 32 void StopPrefetching(JNIEnv* env, |
| 33 const base::android::JavaParamRef<jobject>& jcaller, |
| 34 const base::android::JavaParamRef<jstring>& j_url); |
| 35 |
| 36 // Returns a pointer to a new instance of |ResourePrefetchPredictorAndroid|, |
| 37 // for a given profile. |
| 38 static jlong GetForProfile(JNIEnv* env, jclass clazz, jobject j_profile); |
| 39 static bool Register(JNIEnv* env); |
| 40 |
| 41 private: |
| 42 explicit ResourcePrefetchPredictorAndroid(Profile* profile); |
| 43 |
| 44 Profile* profile_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictorAndroid); |
| 47 }; |
| 48 |
| 49 } // namespace predictors |
| 50 |
| 51 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_ANDROID_H_ |
| OLD | NEW |