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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/BackgroundSchedulerBridge.java

Issue 1928813002: Adds initial JNI bridge code for Background Scheduler implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 package org.chromium.chrome.browser.offlinepages;
6
7 import org.chromium.base.annotations.CalledByNative;
8 import org.chromium.base.annotations.JNINamespace;
9 import org.chromium.chrome.browser.profiles.Profile;
10
11 /**
12 * Provides Java scheduling support from native offlining code as
13 * well as JNI interface to tell native code to start processing
14 * queued requests.
15 */
16 @JNINamespace("offline_pages::android")
17 public class BackgroundSchedulerBridge {
18
19 /**
20 * Callback used to determine when request processing is done.
21 */
22 public interface ProcessingDoneCallback {
23 @CalledByNative("ProcessingDoneCallback")
24 void onResult();
fgorski 2016/04/28 11:44:00 Do we not want to pass anything for result? Even i
dougarnett 2016/04/28 22:45:23 I think we will want to return boolean - possible
25 }
26
27 public static boolean startProcessing(
fgorski 2016/04/28 11:44:00 documentation.
dougarnett 2016/04/28 22:45:23 Done.
28 Profile profile, ProcessingDoneCallback callback) {
29 return nativeStartProcessing(profile, callback);
30 }
31
32 @CalledByNative
33 private static void ensureScheduled() {
fgorski 2016/04/28 11:44:00 schedule/unschedule. After all the semantics of b
dougarnett 2016/04/28 22:45:23 As discussed, do like that better along with addin
34 // TODO(dougarnett): call GcmNetworkManager to schedule for
35 // OfflinePageUtils.TASK_TAG.
36 }
37
38 @CalledByNative
39 private static void clearScheduled() {
40 // TODO(dougarnett): call GcmNetworkManager to unschedule for
41 // OfflinePageUtils.TASK_TAG.
42 }
43
44 private static native boolean nativeStartProcessing(
45 Profile profile, ProcessingDoneCallback callback);
46 }
47
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java_sources.gni » ('j') | chrome/browser/android/offline_pages/background_scheduler_bridge.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698