#ifndef CONTENT_PUBLIC_BROWSER_BACKGROUND_SYNC_CONTEXT_H_
#define CONTENT_PUBLIC_BROWSER_BACKGROUND_SYNC_CONTEXT_H_
#include "base/functional/callback_forward.h"
#include "build/build_config.h"
#include "content/common/content_export.h"
#include "third_party/blink/public/mojom/background_sync/background_sync.mojom.h"
#include "url/origin.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/jni_android.h"
#include "base/android/scoped_java_ref.h"
#endif
namespace content {
class BrowserContext;
class StoragePartition;
class CONTENT_EXPORT BackgroundSyncContext {
public:
#if BUILDFLAG(IS_ANDROID)
static void FireBackgroundSyncEventsAcrossPartitions(
BrowserContext* browser_context,
blink::mojom::BackgroundSyncType sync_type,
const base::android::JavaParamRef<jobject>& j_runnable);
#endif
BackgroundSyncContext() = default;
BackgroundSyncContext(const BackgroundSyncContext&) = delete;
BackgroundSyncContext& operator=(const BackgroundSyncContext&) = delete;
virtual void FireBackgroundSyncEvents(
blink::mojom::BackgroundSyncType sync_type,
base::OnceClosure done_closure) = 0;
virtual void RevivePeriodicBackgroundSyncRegistrations(
url::Origin origin) = 0;
virtual void UnregisterPeriodicSyncForOrigin(url::Origin origin) = 0;
protected:
virtual ~BackgroundSyncContext() = default;
};
}
#endif