summaryrefslogtreecommitdiff
path: root/chromium/components/background_task_scheduler
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-05-12 15:59:20 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-05-25 06:57:22 +0000
commitf7eaed5286974984ba5f9e3189d8f49d03e99f81 (patch)
treecaed19b2af2024f35449fb0b781d0a25e09d4f8f /chromium/components/background_task_scheduler
parent9729c4479fe23554eae6e6dd1f30ff488f470c84 (diff)
downloadqtwebengine-chromium-f7eaed5286974984ba5f9e3189d8f49d03e99f81.tar.gz
BASELINE: Update Chromium to 100.0.4896.167
Change-Id: I98cbeb5d7543d966ffe04d8cefded0c493a11333 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/background_task_scheduler')
-rw-r--r--chromium/components/background_task_scheduler/background_task.h4
-rw-r--r--chromium/components/background_task_scheduler/background_task_scheduler_factory.cc4
-rw-r--r--chromium/components/background_task_scheduler/internal/android/javatests/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerJobServiceTest.java2
-rw-r--r--chromium/components/background_task_scheduler/internal/android/javatests/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverterTest.java2
-rw-r--r--chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerPrefsTest.java2
-rw-r--r--chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerUmaTest.java3
-rw-r--r--chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BroadcastReceiverRobolectricTest.java2
-rw-r--r--chromium/components/background_task_scheduler/task_ids.h1
8 files changed, 9 insertions, 11 deletions
diff --git a/chromium/components/background_task_scheduler/background_task.h b/chromium/components/background_task_scheduler/background_task.h
index cd1b1e88bdb..d5ce57ec74e 100644
--- a/chromium/components/background_task_scheduler/background_task.h
+++ b/chromium/components/background_task_scheduler/background_task.h
@@ -15,6 +15,7 @@ class BrowserContext;
namespace background_task {
+// Boolean parameter indicates whether the task needs to be rescheduled.
using TaskFinishedCallback = base::OnceCallback<void(bool)>;
// Entry point for callbacks from BackgroundTaskScheduler. Any classes
@@ -25,7 +26,8 @@ class BackgroundTask {
// The following two methods represent the callback from
// BackgroundTaskScheduler when your task should start processing. It is
// invoked on the main thread, and after your task finishes, you should
- // run the |callback|. While this method is running the system holds a
+ // run the |callback|, with a boolean parameter indicating whether the task
+ // needs to be rescheduled. While this method is running the system holds a
// wakelock and the wakelock is not released until either the |callback| is
// invoked, or the system calls onStopTask. Depending on whether Chrome is
// running in service manager only mode or full browser mode, one or both of
diff --git a/chromium/components/background_task_scheduler/background_task_scheduler_factory.cc b/chromium/components/background_task_scheduler/background_task_scheduler_factory.cc
index a1de62fa760..e215c7e61fb 100644
--- a/chromium/components/background_task_scheduler/background_task_scheduler_factory.cc
+++ b/chromium/components/background_task_scheduler/background_task_scheduler_factory.cc
@@ -11,7 +11,7 @@
#include "components/background_task_scheduler/background_task_scheduler.h"
#include "components/keyed_service/core/simple_dependency_manager.h"
-#if defined(OS_ANDROID)
+#if BUILDFLAG(IS_ANDROID)
#include "components/background_task_scheduler/internal/android/native_task_scheduler.h"
#endif
@@ -38,7 +38,7 @@ BackgroundTaskSchedulerFactory::~BackgroundTaskSchedulerFactory() = default;
std::unique_ptr<KeyedService>
BackgroundTaskSchedulerFactory::BuildServiceInstanceFor(
SimpleFactoryKey* key) const {
-#if defined(OS_ANDROID)
+#if BUILDFLAG(IS_ANDROID)
return std::make_unique<NativeTaskScheduler>();
#else
return nullptr;
diff --git a/chromium/components/background_task_scheduler/internal/android/javatests/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerJobServiceTest.java b/chromium/components/background_task_scheduler/internal/android/javatests/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerJobServiceTest.java
index f6036c5c39e..8a4b33e482c 100644
--- a/chromium/components/background_task_scheduler/internal/android/javatests/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerJobServiceTest.java
+++ b/chromium/components/background_task_scheduler/internal/android/javatests/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerJobServiceTest.java
@@ -4,7 +4,6 @@
package org.chromium.components.background_task_scheduler.internal;
-import android.annotation.TargetApi;
import android.app.job.JobInfo;
import android.os.Build;
import android.os.Bundle;
@@ -29,7 +28,6 @@ import java.util.concurrent.TimeUnit;
* Tests for {@link BackgroundTaskSchedulerJobService}.
*/
@RunWith(BaseJUnit4ClassRunner.class)
-@TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
@MinAndroidSdkLevel(Build.VERSION_CODES.LOLLIPOP_MR1)
public class BackgroundTaskSchedulerJobServiceTest {
private static final long CLOCK_TIME_MS = 1415926535000L;
diff --git a/chromium/components/background_task_scheduler/internal/android/javatests/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverterTest.java b/chromium/components/background_task_scheduler/internal/android/javatests/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverterTest.java
index 576ec1638a0..2b82b3c0db2 100644
--- a/chromium/components/background_task_scheduler/internal/android/javatests/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverterTest.java
+++ b/chromium/components/background_task_scheduler/internal/android/javatests/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverterTest.java
@@ -4,7 +4,6 @@
package org.chromium.components.background_task_scheduler.internal;
-import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import android.os.PersistableBundle;
@@ -26,7 +25,6 @@ import java.util.Set;
* Tests for {@link BundleToPersistableBundleConverter}.
*/
@RunWith(BaseJUnit4ClassRunner.class)
-@TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
@MinAndroidSdkLevel(Build.VERSION_CODES.LOLLIPOP_MR1)
public class BundleToPersistableBundleConverterTest {
@Test
diff --git a/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerPrefsTest.java b/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerPrefsTest.java
index 206f31bb696..61391a78232 100644
--- a/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerPrefsTest.java
+++ b/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerPrefsTest.java
@@ -16,6 +16,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
+import org.robolectric.annotation.LooperMode;
import org.robolectric.util.ReflectionHelpers;
import org.chromium.base.ContextUtils;
@@ -34,6 +35,7 @@ import java.util.concurrent.TimeUnit;
/** Unit tests for {@link BackgroundTaskSchedulerPrefs}. */
@RunWith(BaseRobolectricTestRunner.class)
@Config(manifest = Config.NONE)
+@LooperMode(LooperMode.Mode.LEGACY)
public class BackgroundTaskSchedulerPrefsTest {
private TaskInfo mTask1;
private TaskInfo mTask2;
diff --git a/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerUmaTest.java b/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerUmaTest.java
index 9e2844f7109..0d5fd481b10 100644
--- a/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerUmaTest.java
+++ b/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BackgroundTaskSchedulerUmaTest.java
@@ -125,9 +125,6 @@ public class BackgroundTaskSchedulerUmaTest {
BackgroundTaskSchedulerUma.toUmaEnumValueFromTaskId(TaskIds.QUERY_TILE_JOB_ID));
assertEquals(BackgroundTaskSchedulerUma.BACKGROUND_TASK_FEEDV2_REFRESH,
BackgroundTaskSchedulerUma.toUmaEnumValueFromTaskId(TaskIds.FEEDV2_REFRESH_JOB_ID));
- assertEquals(BackgroundTaskSchedulerUma.BACKGROUND_TASK_OFFLINE_MEASUREMENTS,
- BackgroundTaskSchedulerUma.toUmaEnumValueFromTaskId(
- TaskIds.OFFLINE_MEASUREMENT_JOB_ID));
assertEquals(BackgroundTaskSchedulerUma.BACKGROUND_TASK_WEBVIEW_COMPONENT_UPDATE,
BackgroundTaskSchedulerUma.toUmaEnumValueFromTaskId(
TaskIds.WEBVIEW_COMPONENT_UPDATE_JOB_ID));
diff --git a/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BroadcastReceiverRobolectricTest.java b/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BroadcastReceiverRobolectricTest.java
index 717661bebdd..ca8b4e04bdb 100644
--- a/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BroadcastReceiverRobolectricTest.java
+++ b/chromium/components/background_task_scheduler/internal/android/junit/src/org/chromium/components/background_task_scheduler/internal/BroadcastReceiverRobolectricTest.java
@@ -18,6 +18,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
+import org.robolectric.annotation.LooperMode;
import org.robolectric.shadows.ShadowBatteryManager;
import org.robolectric.shadows.ShadowConnectivityManager;
@@ -39,6 +40,7 @@ import java.util.concurrent.TimeUnit;
@RunWith(BaseRobolectricTestRunner.class)
@Config(manifest = Config.NONE,
shadows = {ShadowBatteryManager.class, ShadowConnectivityManager.class})
+@LooperMode(LooperMode.Mode.LEGACY)
public final class BroadcastReceiverRobolectricTest {
private static final long WAIT_TIME_MS = 10;
private CountDownLatch mScheduleLatch;
diff --git a/chromium/components/background_task_scheduler/task_ids.h b/chromium/components/background_task_scheduler/task_ids.h
index 067e1111201..2881c52abd5 100644
--- a/chromium/components/background_task_scheduler/task_ids.h
+++ b/chromium/components/background_task_scheduler/task_ids.h
@@ -48,7 +48,6 @@ enum class TaskIds {
PERIODIC_BACKGROUND_SYNC_CHROME_WAKEUP_TASK_JOB_ID = 105,
QUERY_TILE_JOB_ID = 106,
FEEDV2_REFRESH_JOB_ID = 107,
- OFFLINE_MEASUREMENT_JOB_ID = 108,
WEBFEEDS_REFRESH_JOB_ID = 109,
WEBVIEW_COMPONENT_UPDATE_JOB_ID = 110,
ATTRIBUTION_PROVIDER_FLUSH_JOB_ID = 111,