#include "third_party/blink/renderer/modules/notifications/notification_resources_loader.h"
#include <cmath>
#include <optional>
#include "base/time/time.h"
#include "third_party/blink/public/common/notifications/notification_constants.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/mojom/notifications/notification.mojom-blink.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/threading.h"
namespace blink {
namespace {
constexpr base::TimeDelta kImageFetchTimeout = …;
enum class NotificationIconType { … };
gfx::Size GetIconDimensions(NotificationIconType type) { … }
}
NotificationResourcesLoader::NotificationResourcesLoader(
CompletionCallback completion_callback)
: … { … }
NotificationResourcesLoader::~NotificationResourcesLoader() = default;
void NotificationResourcesLoader::Start(
ExecutionContext* context,
const mojom::blink::NotificationData& notification_data) { … }
mojom::blink::NotificationResourcesPtr
NotificationResourcesLoader::GetResources() const { … }
void NotificationResourcesLoader::Stop() { … }
void NotificationResourcesLoader::Trace(Visitor* visitor) const { … }
void NotificationResourcesLoader::LoadIcon(
ExecutionContext* context,
const KURL& url,
const gfx::Size& resize_dimensions,
ThreadedIconLoader::IconCallback icon_callback) { … }
void NotificationResourcesLoader::DidLoadIcon(SkBitmap* out_icon,
SkBitmap icon,
double resize_scale) { … }
void NotificationResourcesLoader::DidFinishRequest() { … }
}