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

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: . 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 namespace base {
13 namespace android {
14 template <typename T>
15 class JavaParamRef;
16 } // namespace android
17 } // namespace base
18
19 namespace predictors {
20
21 class ResourcePrefetchPredictor;
22
23 class ResourcePrefetchPredictorAndroid {
24 public:
25 // See ResourcePrefetchPredictor::StartPrefetching().
26 void StartPrefetching(JNIEnv* env,
27 const base::android::JavaParamRef<jobject>& jcaller,
28 const base::android::JavaParamRef<jstring>& j_url);
29 // See ResourcePrefetchPredictor::StopPrefetching().
30 void StopPrefetching(JNIEnv* env,
31 const base::android::JavaParamRef<jobject>& jcaller,
32 const base::android::JavaParamRef<jstring>& j_url);
33
34 // Returns a pointer to a new instance of |ResourePrefetchPredictorAndroid|,
35 // for a given profile.
36 static jlong GetForProfile(JNIEnv* env, jclass clazz, jobject j_profile);
37 static bool Register(JNIEnv* env);
38
39 private:
40 explicit ResourcePrefetchPredictorAndroid(
41 ResourcePrefetchPredictor* predictor);
42
43 ResourcePrefetchPredictor* predictor_;
pasko 2016/09/27 16:54:31 What if ResourcePrefetchPredictor is destroyed? Sh
Benoit L 2016/09/28 12:15:25 Changed to have the object hold a pointer to the p
44
45 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictorAndroid);
46 };
47
48 } // namespace predictors
49
50 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698