#include "content/browser/notifications/notification_storage.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "content/browser/notifications/notification_database_conversions.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
namespace content {
namespace {
const char kNotificationPrefix[] = …;
std::string CreateDataKey(const std::string& notification_id) { … }
void UpdateNotificationClickTimestamps(NotificationDatabaseData* data) { … }
}
NotificationStorage::NotificationStorage(
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context)
: … { … }
NotificationStorage::~NotificationStorage() = default;
void NotificationStorage::WriteNotificationData(
const NotificationDatabaseData& data,
PlatformNotificationContext::WriteResultCallback callback) { … }
void NotificationStorage::OnWriteComplete(
const NotificationDatabaseData& data,
PlatformNotificationContext::WriteResultCallback callback,
blink::ServiceWorkerStatusCode status) { … }
void NotificationStorage::ReadNotificationDataAndRecordInteraction(
int64_t service_worker_registration_id,
const std::string& notification_id,
PlatformNotificationContext::Interaction interaction,
PlatformNotificationContext::ReadResultCallback callback) { … }
void NotificationStorage::OnReadCompleteUpdateInteraction(
int64_t service_worker_registration_id,
PlatformNotificationContext::Interaction interaction,
PlatformNotificationContext::ReadResultCallback callback,
const std::vector<std::string>& database_data,
blink::ServiceWorkerStatusCode status) { … }
void NotificationStorage::OnInteractionUpdateComplete(
std::unique_ptr<NotificationDatabaseData> data,
PlatformNotificationContext::ReadResultCallback callback,
blink::ServiceWorkerStatusCode status) { … }
}