summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/image_downloader
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/image_downloader')
-rw-r--r--chromium/third_party/blink/renderer/modules/image_downloader/DEPS1
-rw-r--r--chromium/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.cc11
-rw-r--r--chromium/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.h8
-rw-r--r--chromium/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.cc1
-rw-r--r--chromium/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.h2
5 files changed, 13 insertions, 10 deletions
diff --git a/chromium/third_party/blink/renderer/modules/image_downloader/DEPS b/chromium/third_party/blink/renderer/modules/image_downloader/DEPS
index e0a2061a0eb..655b3ce8a6c 100644
--- a/chromium/third_party/blink/renderer/modules/image_downloader/DEPS
+++ b/chromium/third_party/blink/renderer/modules/image_downloader/DEPS
@@ -1,4 +1,5 @@
include_rules = [
+ "+services/network/public/cpp/request_destination.h",
"+skia/ext/image_operations.h",
"+ui/gfx/geometry/size.h",
]
diff --git a/chromium/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.cc b/chromium/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.cc
index d7a324a5cd7..ae4593165a6 100644
--- a/chromium/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.cc
+++ b/chromium/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.cc
@@ -84,7 +84,7 @@ void FilterAndResizeImagesForMaximalSize(
const WTF::Vector<SkBitmap>& unfiltered,
uint32_t max_image_size,
WTF::Vector<SkBitmap>* images,
- WTF::Vector<blink::WebSize>* original_image_sizes) {
+ WTF::Vector<gfx::Size>* original_image_sizes) {
images->clear();
original_image_sizes->clear();
@@ -147,7 +147,8 @@ void ImageDownloaderImpl::ProvideTo(LocalFrame& frame) {
ImageDownloaderImpl::ImageDownloaderImpl(LocalFrame& frame)
: Supplement<LocalFrame>(frame),
- ContextLifecycleObserver(frame.GetDocument()->GetExecutionContext()) {
+ ExecutionContextLifecycleObserver(
+ frame.GetDocument()->GetExecutionContext()) {
frame.GetInterfaceRegistry()->AddInterface(WTF::BindRepeating(
&ImageDownloaderImpl::CreateMojoService, WrapWeakPersistent(this)));
}
@@ -196,7 +197,7 @@ void ImageDownloaderImpl::DidDownloadImage(
int32_t http_status_code,
const WTF::Vector<SkBitmap>& images) {
WTF::Vector<SkBitmap> result_images;
- WTF::Vector<WebSize> result_original_image_sizes;
+ WTF::Vector<gfx::Size> result_original_image_sizes;
FilterAndResizeImagesForMaximalSize(images, max_image_size, &result_images,
&result_original_image_sizes);
@@ -253,10 +254,10 @@ void ImageDownloaderImpl::DidFetchImage(
void ImageDownloaderImpl::Trace(Visitor* visitor) {
Supplement<LocalFrame>::Trace(visitor);
- ContextLifecycleObserver::Trace(visitor);
+ ExecutionContextLifecycleObserver::Trace(visitor);
}
-void ImageDownloaderImpl::ContextDestroyed(ExecutionContext*) {
+void ImageDownloaderImpl::ContextDestroyed() {
for (const auto& fetcher : image_fetchers_) {
// Will run callbacks with an empty image vector.
fetcher->Dispose();
diff --git a/chromium/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.h b/chromium/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.h
index 233522255ec..19e25edcd10 100644
--- a/chromium/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.h
+++ b/chromium/third_party/blink/renderer/modules/image_downloader/image_downloader_impl.h
@@ -7,7 +7,7 @@
#include "mojo/public/cpp/bindings/receiver.h"
#include "third_party/blink/public/mojom/image_downloader/image_downloader.mojom-blink.h"
-#include "third_party/blink/renderer/core/execution_context/context_lifecycle_observer.h"
+#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
#include "third_party/blink/renderer/platform/supplementable.h"
namespace blink {
@@ -21,7 +21,7 @@ struct WebSize;
class ImageDownloaderImpl final : public GarbageCollected<ImageDownloaderImpl>,
public Supplement<LocalFrame>,
- public ContextLifecycleObserver,
+ public ExecutionContextLifecycleObserver,
public mojom::blink::ImageDownloader {
USING_PRE_FINALIZER(ImageDownloaderImpl, Dispose);
USING_GARBAGE_COLLECTED_MIXIN(ImageDownloaderImpl);
@@ -41,8 +41,8 @@ class ImageDownloaderImpl final : public GarbageCollected<ImageDownloaderImpl>,
void Trace(Visitor*) override;
- // OverContextLifecycleObserver overrides.
- void ContextDestroyed(ExecutionContext*) override;
+ // OverExecutionContextLifecycleObserver overrides.
+ void ContextDestroyed() override;
private:
// ImageDownloader implementation. Request to asynchronously download an
diff --git a/chromium/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.cc b/chromium/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.cc
index 689c426e491..d1d6f4d21f4 100644
--- a/chromium/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.cc
+++ b/chromium/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.cc
@@ -209,6 +209,7 @@ void MultiResolutionImageResourceFetcher::Start(
request_.SetSiteForCookies(frame->GetDocument()->SiteForCookies());
request_.SetMode(request_mode);
request_.SetCredentialsMode(credentials_mode);
+ request_.SetRequestDestination(network::mojom::RequestDestination::kImage);
client_ = std::make_unique<ClientImpl>(std::move(callback));
diff --git a/chromium/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.h b/chromium/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.h
index a092e5b6fc1..eaf5c752f73 100644
--- a/chromium/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.h
+++ b/chromium/third_party/blink/renderer/modules/image_downloader/multi_resolution_image_resource_fetcher.h
@@ -13,7 +13,7 @@
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink-forward.h"
#include "third_party/blink/public/platform/web_url_request.h"
#include "third_party/blink/public/web/web_associated_url_loader_options.h"
-#include "third_party/blink/renderer/core/execution_context/context_lifecycle_observer.h"
+#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
namespace blink {