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

Side by Side Diff: chrome/browser/predictors/resource_prefetch_predictor_android.h

Issue 2377643002: predictors: Make the resource_prefetch_predictor accessible from Java. (Closed)
Patch Set: Address comments. Created 4 years, 2 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
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698