Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp

Issue 2301323003: Add deprecation warning for script fetches with invalid types (Closed)
Patch Set: Update deprecation message with chromestatus entry Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp b/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp
index f0e6d0003f039faa1730bf1cc5e1e3956877a441..eb81c9b02c5b51ad343555facaf4df31a8fec75b 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp
@@ -29,6 +29,7 @@
#include "core/fetch/CSSStyleSheetResource.h"
#include "core/fetch/FetchInitiatorInfo.h"
#include "core/fetch/ResourceFetcher.h"
+#include "core/frame/Deprecation.h"
#include "core/frame/Settings.h"
#include "core/loader/DocumentLoader.h"
#include "platform/Histogram.h"
@@ -91,6 +92,10 @@ void HTMLResourcePreloader::preload(std::unique_ptr<PreloadRequest> preload, con
DEFINE_STATIC_LOCAL(CustomCountHistogram, preloadDelayHistogram, ("WebCore.PreloadDelayMs", 0, 2000, 20));
preloadDelayHistogram.count(duration);
+ if (preload->scriptHasInvalidTypeOrLanguage()) {
+ Deprecation::countDeprecation(m_document, UseCounter::ScriptInvalidTypeOrLanguage);
+ }
+
Resource* resource = m_document->loader()->startPreload(preload->resourceType(), request);
if (resource && preload->resourceType() == Resource::CSSStyleSheet) {
Settings* settings = m_document->settings();

Powered by Google App Engine
This is Rietveld 408576698