summaryrefslogtreecommitdiff
path: root/chromium/components/background_task_scheduler
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-03 13:42:47 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-15 10:27:51 +0000
commit8c5c43c7b138c9b4b0bf56d946e61d3bbc111bec (patch)
treed29d987c4d7b173cf853279b79a51598f104b403 /chromium/components/background_task_scheduler
parent830c9e163d31a9180fadca926b3e1d7dfffb5021 (diff)
downloadqtwebengine-chromium-8c5c43c7b138c9b4b0bf56d946e61d3bbc111bec.tar.gz
BASELINE: Update Chromium to 66.0.3359.156
Change-Id: I0c9831ad39911a086b6377b16f995ad75a51e441 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/components/background_task_scheduler')
-rw-r--r--chromium/components/background_task_scheduler/BUILD.gn2
-rw-r--r--chromium/components/background_task_scheduler/README.md34
2 files changed, 28 insertions, 8 deletions
diff --git a/chromium/components/background_task_scheduler/BUILD.gn b/chromium/components/background_task_scheduler/BUILD.gn
index 50eb165d0b5..9525aff8171 100644
--- a/chromium/components/background_task_scheduler/BUILD.gn
+++ b/chromium/components/background_task_scheduler/BUILD.gn
@@ -92,8 +92,8 @@ if (is_android) {
"$google_play_services_package:google_play_services_tasks_java",
"//base:base_java",
"//base:base_java_test_support",
+ "//base:base_junit_test_support",
"//third_party/junit",
]
- srcjar_deps = [ "//base:base_build_config_gen" ]
}
}
diff --git a/chromium/components/background_task_scheduler/README.md b/chromium/components/background_task_scheduler/README.md
index bc83b48d005..db2322de82d 100644
--- a/chromium/components/background_task_scheduler/README.md
+++ b/chromium/components/background_task_scheduler/README.md
@@ -30,13 +30,9 @@ available (or available but not considered stable enough). That is, the
JobScheduler API is used on Android M+; and the GcmNetworkManager is used
otherwise.
-> **WARNING: The GcmNetworkManager fallback is not yet implemented.** Please
-> treat the above as a target state, and do not yet add any dependencies on the
-> BackgroundTaskScheduler API that require pre-M compatibility.
-
-> NOTE: Even with the GcmNetworkManager fallback, there are devices that would
-> remain unsupported, as not all devices have Google Play services
-> available. Ultimately, this component hopes to provide a full compatibility
+> NOTE: Some of the pre-M devices do not include Google Play services and
+> therefore remain unsupported by `background_task_scheduler`.
+> Ultimately, this component hopes to provide a full compatibility
> layer on top of `JobScheduler`. However, until that is implemented, please be
> thoughtful about whether this component provides the coverage that your
> background task needs.
@@ -179,3 +175,27 @@ if the task needs to be rescheduled since it was canceled, or false otherwise.
**The system will hold a wakelock from the time `onStartTask(...)` is invoked
until either the task itself invokes the `TaskFinishedCallback`, or
`onStopTask(...)` is invoked.**
+
+## Loading Native parts
+
+Some of the tasks running in the background require native parts of the browser
+to be initialized. In order to simplify implementation of such tasks, we provide
+an base `NativeBackgroundTask`
+[implementation](https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/NativeBackgroundTask.java)
+in the browser layer. It requires extending classes to implement 4 methods:
+
+ * `onStartTaskBeforeNativeLoaded(...)` where the background task can decide
+ whether conditions are correct to proceed with native initialization;
+ * `onStartTaskWithNative(...)` where the background task can be sure that
+ native initialization was completed, therefore it can depend on that part of
+ the browser;
+ * `onStopTaskBeforeNativeLoaded(...)` which is delivered to the background task
+ just like `onStopTask(...)` and the native parts of the browser are not
+ loaded;
+ * `onStopTaskWithNative(...)` which is delivered to the background task just
+ like `onStopTask(...)` and the native parts of the browser are loaded.
+
+While in a normal execution, both `onStart...` methods are called, only one of
+the stopping methods will be triggered, depending on whether the native parts of
+the browser are loaded at the time the underlying scheduler decides to stop the
+task.