Commit b74373dd authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

Remove platform/graphics dependency on network and web_settings

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ia2f39271db9f31ff6c462cb11ca65d436ed3018b
Reviewed-on: https://chromium-review.googlesource.com/1155803Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579293}
parent 9025984c
......@@ -262,8 +262,10 @@ Document* DOMImplementation::createDocument(const String& type,
init, plugin_data->PluginBackgroundColorForMimeType(type));
}
// multipart/x-mixed-replace is only supported for images.
if (Image::SupportsType(type) || type == "multipart/x-mixed-replace")
if (MIMETypeRegistry::IsSupportedImageResourceMIMEType(type) ||
type == "multipart/x-mixed-replace") {
return ImageDocument::Create(init);
}
// Check to see if the type can be played by our media player, if so create a
// MediaDocument
......
......@@ -750,4 +750,11 @@ void WebSettingsImpl::SetLazyFrameLoadingDistanceThresholdPx4G(
settings_->SetLazyFrameLoadingDistanceThresholdPx4G(distance_px);
}
STATIC_ASSERT_ENUM(WebSettings::kImageAnimationPolicyAllowed,
kImageAnimationPolicyAllowed);
STATIC_ASSERT_ENUM(WebSettings::kImageAnimationPolicyAnimateOnce,
kImageAnimationPolicyAnimateOnce);
STATIC_ASSERT_ENUM(WebSettings::kImageAnimationPolicyNoAnimation,
kImageAnimationPolicyNoAnimation);
} // namespace blink
......@@ -542,7 +542,7 @@ HTMLPlugInElement::ObjectContentType HTMLPlugInElement::GetObjectContentType()
bool HTMLPlugInElement::IsImageType() const {
if (GetDocument().GetFrame())
return GetObjectContentType() == ObjectContentType::kImage;
return Image::SupportsType(service_type_);
return MIMETypeRegistry::IsSupportedImageResourceMIMEType(service_type_);
}
LayoutEmbeddedObject* HTMLPlugInElement::GetLayoutEmbeddedObject() const {
......
......@@ -38,7 +38,6 @@ include_rules = [
"+third_party/blink/renderer/platform/json",
"+third_party/blink/renderer/platform/length.h",
"+third_party/blink/renderer/platform/mojo/mojo_helper.h",
"+third_party/blink/renderer/platform/network/mime/mime_type_registry.h",
"+third_party/blink/renderer/platform/platform_export.h",
"+third_party/blink/renderer/platform/runtime_enabled_features.h",
"+third_party/blink/renderer/platform/scheduler",
......@@ -52,7 +51,6 @@ include_rules = [
"+third_party/blink/renderer/platform/weborigin/kurl.h",
"+third_party/blink/renderer/platform/web_task_runner.h",
"+third_party/blink/renderer/platform/wtf",
"+third_party/blink/public/web/web_settings.h",
"+ui/gfx/geometry",
]
......
......@@ -32,7 +32,6 @@
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_macros.h"
#include "third_party/blink/public/web/web_settings.h"
#include "third_party/blink/renderer/platform/geometry/float_rect.h"
#include "third_party/blink/renderer/platform/graphics/bitmap_image_metrics.h"
#include "third_party/blink/renderer/platform/graphics/deferred_image_decoder.h"
......@@ -414,11 +413,4 @@ void BitmapImage::SetAnimationPolicy(ImageAnimationPolicy policy) {
ResetAnimation();
}
STATIC_ASSERT_ENUM(WebSettings::kImageAnimationPolicyAllowed,
kImageAnimationPolicyAllowed);
STATIC_ASSERT_ENUM(WebSettings::kImageAnimationPolicyAnimateOnce,
kImageAnimationPolicyAnimateOnce);
STATIC_ASSERT_ENUM(WebSettings::kImageAnimationPolicyNoAnimation,
kImageAnimationPolicyNoAnimation);
} // namespace blink
......@@ -46,7 +46,6 @@
#include "third_party/blink/renderer/platform/instrumentation/platform_instrumentation.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/length.h"
#include "third_party/blink/renderer/platform/network/mime/mime_type_registry.h"
#include "third_party/blink/renderer/platform/shared_buffer.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
......@@ -95,10 +94,6 @@ scoped_refptr<Image> Image::LoadPlatformResource(const char* name) {
return image;
}
bool Image::SupportsType(const String& type) {
return MIMETypeRegistry::IsSupportedImageResourceMIMEType(type);
}
Image::SizeAvailability Image::SetData(scoped_refptr<SharedBuffer> data,
bool all_data_received) {
encoded_image_data_ = std::move(data);
......
......@@ -75,7 +75,6 @@ class PLATFORM_EXPORT Image : public ThreadSafeRefCounted<Image> {
static cc::ImageDecodeCache& SharedCCDecodeCache();
static scoped_refptr<Image> LoadPlatformResource(const char* name);
static bool SupportsType(const String&);
virtual bool IsSVGImage() const { return false; }
virtual bool IsBitmapImage() const { return false; }
......
......@@ -37,7 +37,6 @@
#include "base/memory/ptr_util.h"
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
#include "third_party/blink/renderer/platform/image-encoders/image_encoder.h"
#include "third_party/blink/renderer/platform/network/mime/mime_type_registry.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/text/base64.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
......@@ -154,7 +153,6 @@ bool ImageDataBuffer::EncodeImageInternal(const String& mime_type,
String ImageDataBuffer::ToDataURL(const String& mime_type,
const double& quality) const {
DCHECK(is_valid_);
DCHECK(MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding(mime_type));
// toDataURL always encodes in sRGB and does not include the color space
// information.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment