logo

etc_portage

Unnamed repository; edit this file 'description' to name the repository. git clone https://hacktivis.me/git/etc_portage.git

0002-Remove-support-for-PING-in-HTML-anchors-privacy.patch (20913B)


  1. From 84921f7b5e96acf31472acd7752ca77158b4c657 Mon Sep 17 00:00:00 2001
  2. From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
  3. Date: Fri, 2 Nov 2018 18:14:21 +0100
  4. Subject: [PATCH 2/8] Remove support for PING in HTML anchors [privacy]
  5. ---
  6. Source/WebCore/Sources.txt | 1 -
  7. Source/WebCore/html/HTMLAnchorElement.cpp | 16 --
  8. .../html/parser/XSSAuditorDelegate.cpp | 4 -
  9. Source/WebCore/loader/DocumentLoader.cpp | 6 -
  10. Source/WebCore/loader/PingLoader.cpp | 218 ------------------
  11. Source/WebCore/loader/PingLoader.h | 62 -----
  12. .../loader/cache/CachedResourceLoader.cpp | 3 -
  13. .../page/csp/ContentSecurityPolicy.cpp | 5 -
  14. Source/WebKit/WebProcess/WebPage/WebPage.cpp | 3 -
  15. 9 files changed, 318 deletions(-)
  16. delete mode 100644 Source/WebCore/loader/PingLoader.cpp
  17. delete mode 100644 Source/WebCore/loader/PingLoader.h
  18. diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt
  19. index 704e50c773..bbee4a0695 100644
  20. --- a/Source/WebCore/Sources.txt
  21. +++ b/Source/WebCore/Sources.txt
  22. @@ -1276,7 +1276,6 @@ loader/NavigationAction.cpp
  23. loader/NavigationScheduler.cpp
  24. loader/NetscapePlugInStreamLoader.cpp
  25. loader/ServerTimingParser.cpp
  26. -loader/PingLoader.cpp
  27. loader/PolicyChecker.cpp
  28. loader/ProgressTracker.cpp
  29. loader/ResourceCryptographicDigest.cpp
  30. diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp
  31. index 0155fc70a1..e53302748d 100644
  32. --- a/Source/WebCore/html/HTMLAnchorElement.cpp
  33. +++ b/Source/WebCore/html/HTMLAnchorElement.cpp
  34. @@ -39,7 +39,6 @@
  35. #include "HTMLPictureElement.h"
  36. #include "KeyboardEvent.h"
  37. #include "MouseEvent.h"
  38. -#include "PingLoader.h"
  39. #include "PlatformMouseEvent.h"
  40. #include "RenderImage.h"
  41. #include "ResourceRequest.h"
  42. @@ -364,19 +363,6 @@ bool HTMLAnchorElement::isLiveLink() const
  43. return isLink() && treatLinkAsLiveForEventType(m_wasShiftKeyDownOnMouseDown ? MouseEventWithShiftKey : MouseEventWithoutShiftKey);
  44. }
  45. -void HTMLAnchorElement::sendPings(const URL& destinationURL)
  46. -{
  47. - if (!document().frame())
  48. - return;
  49. -
  50. - if (!hasAttributeWithoutSynchronization(pingAttr) || !document().settings().hyperlinkAuditingEnabled())
  51. - return;
  52. -
  53. - SpaceSplitString pingURLs(attributeWithoutSynchronization(pingAttr), false);
  54. - for (unsigned i = 0; i < pingURLs.size(); i++)
  55. - PingLoader::sendPing(*document().frame(), document().completeURL(pingURLs[i]), destinationURL);
  56. -}
  57. -
  58. #if USE(SYSTEM_PREVIEW)
  59. bool HTMLAnchorElement::isSystemPreviewLink() const
  60. {
  61. @@ -442,8 +428,6 @@ void HTMLAnchorElement::handleClick(Event& event)
  62. ShouldSendReferrer shouldSendReferrer = hasRel(Relation::NoReferrer) ? NeverSendReferrer : MaybeSendReferrer;
  63. auto newFrameOpenerPolicy = hasRel(Relation::NoOpener) ? std::make_optional(NewFrameOpenerPolicy::Suppress) : std::nullopt;
  64. frame->loader().urlSelected(completedURL, target(), &event, LockHistory::No, LockBackForwardList::No, shouldSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate(), newFrameOpenerPolicy, downloadAttribute, systemPreviewInfo);
  65. -
  66. - sendPings(completedURL);
  67. }
  68. HTMLAnchorElement::EventType HTMLAnchorElement::eventType(Event& event)
  69. diff --git a/Source/WebCore/html/parser/XSSAuditorDelegate.cpp b/Source/WebCore/html/parser/XSSAuditorDelegate.cpp
  70. index 80b4213669..e8c69162aa 100644
  71. --- a/Source/WebCore/html/parser/XSSAuditorDelegate.cpp
  72. +++ b/Source/WebCore/html/parser/XSSAuditorDelegate.cpp
  73. @@ -35,7 +35,6 @@
  74. #include "FrameLoaderClient.h"
  75. #include "HTMLParserIdioms.h"
  76. #include "NavigationScheduler.h"
  77. -#include "PingLoader.h"
  78. #include <wtf/JSONValues.h>
  79. #include <wtf/text/StringBuilder.h>
  80. #include <wtf/text/CString.h>
  81. @@ -104,9 +103,6 @@ void XSSAuditorDelegate::didBlockScript(const XSSInfo& xssInfo)
  82. m_didSendNotifications = true;
  83. frameLoader.client().didDetectXSS(m_document.url(), xssInfo.m_didBlockEntirePage);
  84. -
  85. - if (!m_reportURL.isEmpty())
  86. - PingLoader::sendViolationReport(*m_document.frame(), m_reportURL, generateViolationReport(xssInfo), ViolationReportType::XSSAuditor);
  87. }
  88. if (xssInfo.m_didBlockEntirePage)
  89. diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp
  90. index b9fc289660..37cf9602b2 100644
  91. --- a/Source/WebCore/loader/DocumentLoader.cpp
  92. +++ b/Source/WebCore/loader/DocumentLoader.cpp
  93. @@ -65,7 +65,6 @@
  94. #include "MemoryCache.h"
  95. #include "NetworkLoadMetrics.h"
  96. #include "Page.h"
  97. -#include "PingLoader.h"
  98. #include "PlatformStrategies.h"
  99. #include "PolicyChecker.h"
  100. #include "ProgressTracker.h"
  101. @@ -2058,11 +2057,6 @@ void DocumentLoader::addConsoleMessage(MessageSource messageSource, MessageLevel
  102. static_cast<ScriptExecutionContext*>(m_frame->document())->addConsoleMessage(messageSource, messageLevel, message, requestIdentifier);
  103. }
  104. -void DocumentLoader::sendCSPViolationReport(URL&& reportURL, Ref<FormData>&& report)
  105. -{
  106. - PingLoader::sendViolationReport(*m_frame, WTFMove(reportURL), WTFMove(report), ViolationReportType::ContentSecurityPolicy);
  107. -}
  108. -
  109. void DocumentLoader::enqueueSecurityPolicyViolationEvent(SecurityPolicyViolationEvent::Init&& eventInit)
  110. {
  111. m_frame->document()->enqueueSecurityPolicyViolationEvent(WTFMove(eventInit));
  112. diff --git a/Source/WebCore/loader/PingLoader.cpp b/Source/WebCore/loader/PingLoader.cpp
  113. deleted file mode 100644
  114. index 134e5560e6..0000000000
  115. --- a/Source/WebCore/loader/PingLoader.cpp
  116. +++ /dev/null
  117. @@ -1,218 +0,0 @@
  118. -/*
  119. - * Copyright (C) 2010 Google Inc. All rights reserved.
  120. - * Copyright (C) 2015 Roopesh Chander (roop@roopc.net)
  121. - * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
  122. - *
  123. - * Redistribution and use in source and binary forms, with or without
  124. - * modification, are permitted provided that the following conditions are
  125. - * met:
  126. - *
  127. - * * Redistributions of source code must retain the above copyright
  128. - * notice, this list of conditions and the following disclaimer.
  129. - * * Redistributions in binary form must reproduce the above
  130. - * copyright notice, this list of conditions and the following disclaimer
  131. - * in the documentation and/or other materials provided with the
  132. - * distribution.
  133. - * * Neither the name of Google Inc. nor the names of its
  134. - * contributors may be used to endorse or promote products derived from
  135. - * this software without specific prior written permission.
  136. - *
  137. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  138. - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  139. - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  140. - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  141. - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  142. - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  143. - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  144. - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  145. - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  146. - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  147. - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  148. - *
  149. - */
  150. -
  151. -#include "config.h"
  152. -#include "PingLoader.h"
  153. -
  154. -#include "ContentSecurityPolicy.h"
  155. -#include "Document.h"
  156. -#include "Frame.h"
  157. -#include "FrameLoader.h"
  158. -#include "FrameLoaderClient.h"
  159. -#include "InspectorInstrumentation.h"
  160. -#include "LoaderStrategy.h"
  161. -#include "NetworkLoadMetrics.h"
  162. -#include "Page.h"
  163. -#include "PlatformStrategies.h"
  164. -#include "ProgressTracker.h"
  165. -#include "ResourceHandle.h"
  166. -#include "ResourceLoadInfo.h"
  167. -#include "ResourceRequest.h"
  168. -#include "ResourceResponse.h"
  169. -#include "SecurityOrigin.h"
  170. -#include "SecurityPolicy.h"
  171. -#include "UserContentController.h"
  172. -#include <wtf/text/CString.h>
  173. -
  174. -namespace WebCore {
  175. -
  176. -#if !ENABLE(CONTENT_EXTENSIONS)
  177. -
  178. -// Returns true if we should block the load.
  179. -static inline bool processContentExtensionRulesForLoad(const Frame&, ResourceRequest&, ResourceType)
  180. -{
  181. - return false;
  182. -}
  183. -
  184. -#else
  185. -
  186. -// Returns true if we should block the load.
  187. -static bool processContentExtensionRulesForLoad(const Frame& frame, ResourceRequest& request, ResourceType resourceType)
  188. -{
  189. - auto* documentLoader = frame.loader().documentLoader();
  190. - if (!documentLoader)
  191. - return false;
  192. - auto* page = frame.page();
  193. - if (!page)
  194. - return false;
  195. - auto status = page->userContentProvider().processContentExtensionRulesForLoad(request.url(), resourceType, *documentLoader);
  196. - applyBlockedStatusToRequest(status, page, request);
  197. - return status.blockedLoad;
  198. -}
  199. -
  200. -#endif
  201. -
  202. -void PingLoader::loadImage(Frame& frame, const URL& url)
  203. -{
  204. - ASSERT(frame.document());
  205. - auto& document = *frame.document();
  206. -
  207. - if (!document.securityOrigin().canDisplay(url)) {
  208. - FrameLoader::reportLocalLoadFailed(&frame, url);
  209. - return;
  210. - }
  211. -
  212. - ResourceRequest request(url);
  213. - if (processContentExtensionRulesForLoad(frame, request, ResourceType::Image))
  214. - return;
  215. -
  216. - document.contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
  217. -
  218. - request.setHTTPHeaderField(HTTPHeaderName::CacheControl, "max-age=0");
  219. -
  220. - HTTPHeaderMap originalRequestHeader = request.httpHeaderFields();
  221. -
  222. - String referrer = SecurityPolicy::generateReferrerHeader(document.referrerPolicy(), request.url(), frame.loader().outgoingReferrer());
  223. - if (!referrer.isEmpty())
  224. - request.setHTTPReferrer(referrer);
  225. - frame.loader().addExtraFieldsToSubresourceRequest(request);
  226. -
  227. - startPingLoad(frame, request, WTFMove(originalRequestHeader), ShouldFollowRedirects::Yes);
  228. -}
  229. -
  230. -// http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing
  231. -void PingLoader::sendPing(Frame& frame, const URL& pingURL, const URL& destinationURL)
  232. -{
  233. - ASSERT(frame.document());
  234. -
  235. - if (!pingURL.protocolIsInHTTPFamily())
  236. - return;
  237. -
  238. - ResourceRequest request(pingURL);
  239. - if (processContentExtensionRulesForLoad(frame, request, ResourceType::Raw))
  240. - return;
  241. -
  242. - auto& document = *frame.document();
  243. - document.contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
  244. -
  245. - request.setHTTPMethod("POST");
  246. - request.setHTTPContentType("text/ping");
  247. - request.setHTTPBody(FormData::create("PING"));
  248. - request.setHTTPHeaderField(HTTPHeaderName::CacheControl, "max-age=0");
  249. -
  250. - HTTPHeaderMap originalRequestHeader = request.httpHeaderFields();
  251. -
  252. - frame.loader().addExtraFieldsToSubresourceRequest(request);
  253. -
  254. - auto& sourceOrigin = document.securityOrigin();
  255. - FrameLoader::addHTTPOriginIfNeeded(request, sourceOrigin.toString());
  256. - request.setHTTPHeaderField(HTTPHeaderName::PingTo, destinationURL);
  257. - if (!SecurityPolicy::shouldHideReferrer(pingURL, frame.loader().outgoingReferrer())) {
  258. - request.setHTTPHeaderField(HTTPHeaderName::PingFrom, document.url());
  259. - if (!sourceOrigin.isSameSchemeHostPort(SecurityOrigin::create(pingURL).get())) {
  260. - String referrer = SecurityPolicy::generateReferrerHeader(document.referrerPolicy(), pingURL, frame.loader().outgoingReferrer());
  261. - if (!referrer.isEmpty())
  262. - request.setHTTPReferrer(referrer);
  263. - }
  264. - }
  265. -
  266. - startPingLoad(frame, request, WTFMove(originalRequestHeader), ShouldFollowRedirects::Yes);
  267. -}
  268. -
  269. -void PingLoader::sendViolationReport(Frame& frame, const URL& reportURL, Ref<FormData>&& report, ViolationReportType reportType)
  270. -{
  271. - ASSERT(frame.document());
  272. -
  273. - ResourceRequest request(reportURL);
  274. - if (processContentExtensionRulesForLoad(frame, request, ResourceType::Raw))
  275. - return;
  276. -
  277. - auto& document = *frame.document();
  278. - document.contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
  279. -
  280. - request.setHTTPMethod("POST"_s);
  281. - request.setHTTPBody(WTFMove(report));
  282. - switch (reportType) {
  283. - case ViolationReportType::ContentSecurityPolicy:
  284. - request.setHTTPContentType("application/csp-report"_s);
  285. - break;
  286. - case ViolationReportType::XSSAuditor:
  287. - request.setHTTPContentType("application/json"_s);
  288. - break;
  289. - }
  290. -
  291. - bool removeCookies = true;
  292. - if (document.securityOrigin().isSameSchemeHostPort(SecurityOrigin::create(reportURL).get()))
  293. - removeCookies = false;
  294. - if (removeCookies)
  295. - request.setAllowCookies(false);
  296. -
  297. - HTTPHeaderMap originalRequestHeader = request.httpHeaderFields();
  298. -
  299. - frame.loader().addExtraFieldsToSubresourceRequest(request);
  300. -
  301. - String referrer = SecurityPolicy::generateReferrerHeader(document.referrerPolicy(), reportURL, frame.loader().outgoingReferrer());
  302. - if (!referrer.isEmpty())
  303. - request.setHTTPReferrer(referrer);
  304. -
  305. - startPingLoad(frame, request, WTFMove(originalRequestHeader), ShouldFollowRedirects::No);
  306. -}
  307. -
  308. -void PingLoader::startPingLoad(Frame& frame, ResourceRequest& request, HTTPHeaderMap&& originalRequestHeaders, ShouldFollowRedirects shouldFollowRedirects)
  309. -{
  310. - unsigned long identifier = frame.page()->progress().createUniqueIdentifier();
  311. - // FIXME: Why activeDocumentLoader? I would have expected documentLoader().
  312. - // It seems like the PingLoader should be associated with the current
  313. - // Document in the Frame, but the activeDocumentLoader will be associated
  314. - // with the provisional DocumentLoader if there is a provisional
  315. - // DocumentLoader.
  316. - bool shouldUseCredentialStorage = frame.loader().client().shouldUseCredentialStorage(frame.loader().activeDocumentLoader(), identifier);
  317. - FetchOptions options;
  318. - options.credentials = shouldUseCredentialStorage ? FetchOptions::Credentials::Include : FetchOptions::Credentials::Omit;
  319. - options.redirect = shouldFollowRedirects == ShouldFollowRedirects::Yes ? FetchOptions::Redirect::Follow : FetchOptions::Redirect::Error;
  320. -
  321. - // FIXME: Move ping loads to normal subresource loading to get normal inspector request instrumentation hooks.
  322. - InspectorInstrumentation::willSendRequestOfType(&frame, identifier, frame.loader().activeDocumentLoader(), request, InspectorInstrumentation::LoadType::Ping);
  323. -
  324. - platformStrategies()->loaderStrategy()->startPingLoad(frame, request, WTFMove(originalRequestHeaders), options, [protectedFrame = makeRef(frame), identifier] (const ResourceError& error, const ResourceResponse& response) {
  325. - if (!response.isNull())
  326. - InspectorInstrumentation::didReceiveResourceResponse(protectedFrame, identifier, protectedFrame->loader().activeDocumentLoader(), response, nullptr);
  327. - if (error.isNull()) {
  328. - NetworkLoadMetrics emptyMetrics;
  329. - InspectorInstrumentation::didFinishLoading(protectedFrame.ptr(), protectedFrame->loader().activeDocumentLoader(), identifier, emptyMetrics, nullptr);
  330. - } else
  331. - InspectorInstrumentation::didFailLoading(protectedFrame.ptr(), protectedFrame->loader().activeDocumentLoader(), identifier, error);
  332. - });
  333. -}
  334. -
  335. -}
  336. diff --git a/Source/WebCore/loader/PingLoader.h b/Source/WebCore/loader/PingLoader.h
  337. deleted file mode 100644
  338. index 15489dcf04..0000000000
  339. --- a/Source/WebCore/loader/PingLoader.h
  340. +++ /dev/null
  341. @@ -1,62 +0,0 @@
  342. -/*
  343. - * Copyright (C) 2010 Google Inc. All rights reserved.
  344. - * Copyright (C) 2017 Apple Inc. All rights reserved.
  345. - *
  346. - * Redistribution and use in source and binary forms, with or without
  347. - * modification, are permitted provided that the following conditions are
  348. - * met:
  349. - *
  350. - * * Redistributions of source code must retain the above copyright
  351. - * notice, this list of conditions and the following disclaimer.
  352. - * * Redistributions in binary form must reproduce the above
  353. - * copyright notice, this list of conditions and the following disclaimer
  354. - * in the documentation and/or other materials provided with the
  355. - * distribution.
  356. - * * Neither the name of Google Inc. nor the names of its
  357. - * contributors may be used to endorse or promote products derived from
  358. - * this software without specific prior written permission.
  359. - *
  360. - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  361. - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  362. - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  363. - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  364. - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  365. - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  366. - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  367. - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  368. - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  369. - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  370. - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  371. - *
  372. - */
  373. -
  374. -#pragma once
  375. -
  376. -#include <wtf/Forward.h>
  377. -#include <wtf/Ref.h>
  378. -
  379. -namespace WebCore {
  380. -
  381. -class FormData;
  382. -class Frame;
  383. -class HTTPHeaderMap;
  384. -class URL;
  385. -class ResourceRequest;
  386. -
  387. -enum class ViolationReportType {
  388. - ContentSecurityPolicy,
  389. - XSSAuditor,
  390. -};
  391. -
  392. -class PingLoader {
  393. -public:
  394. - static void loadImage(Frame&, const URL&);
  395. - static void sendPing(Frame&, const URL& pingURL, const URL& destinationURL);
  396. - WEBCORE_EXPORT static void sendViolationReport(Frame&, const URL& reportURL, Ref<FormData>&& report, ViolationReportType);
  397. -
  398. -private:
  399. - enum class ShouldFollowRedirects { No, Yes };
  400. - static void startPingLoad(Frame&, ResourceRequest&, HTTPHeaderMap&& originalRequestHeaders, ShouldFollowRedirects);
  401. -};
  402. -
  403. -} // namespace WebCore
  404. diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
  405. index 9d3d108113..614cfee9b5 100644
  406. --- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp
  407. +++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
  408. @@ -57,7 +57,6 @@
  409. #include "Logging.h"
  410. #include "MemoryCache.h"
  411. #include "Page.h"
  412. -#include "PingLoader.h"
  413. #include "PlatformStrategies.h"
  414. #include "RenderElement.h"
  415. #include "ResourceLoadInfo.h"
  416. @@ -202,8 +201,6 @@ ResourceErrorOr<CachedResourceHandle<CachedImage>> CachedResourceLoader::request
  417. if (Document* document = frame->document())
  418. request.upgradeInsecureRequestIfNeeded(*document);
  419. URL requestURL = request.resourceRequest().url();
  420. - if (requestURL.isValid() && canRequest(CachedResource::Type::ImageResource, requestURL, request, ForPreload::No))
  421. - PingLoader::loadImage(*frame, requestURL);
  422. return CachedResourceHandle<CachedImage> { };
  423. }
  424. }
  425. diff --git a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp
  426. index 9b966fa02b..f1b1b51da1 100644
  427. --- a/Source/WebCore/page/csp/ContentSecurityPolicy.cpp
  428. +++ b/Source/WebCore/page/csp/ContentSecurityPolicy.cpp
  429. @@ -45,7 +45,6 @@
  430. #include "JSExecState.h"
  431. #include "JSWindowProxy.h"
  432. #include "ParsingUtilities.h"
  433. -#include "PingLoader.h"
  434. #include "ResourceRequest.h"
  435. #include "RuntimeEnabledFeatures.h"
  436. #include "SchemeRegistry.h"
  437. @@ -759,10 +758,6 @@ void ContentSecurityPolicy::reportViolation(const String& effectiveViolatedDirec
  438. if (m_client) {
  439. for (const auto& url : reportURIs)
  440. m_client->sendCSPViolationReport(URL { m_protectedURL, url }, report.copyRef());
  441. - } else {
  442. - auto& document = downcast<Document>(*m_scriptExecutionContext);
  443. - for (const auto& url : reportURIs)
  444. - PingLoader::sendViolationReport(*document.frame(), URL { m_protectedURL, url }, report.copyRef(), ViolationReportType::ContentSecurityPolicy);
  445. }
  446. }
  447. diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp
  448. index 5de12b10cc..e161de3599 100644
  449. --- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp
  450. +++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp
  451. @@ -181,7 +181,6 @@
  452. #include <WebCore/NotImplemented.h>
  453. #include <WebCore/Page.h>
  454. #include <WebCore/PageConfiguration.h>
  455. -#include <WebCore/PingLoader.h>
  456. #include <WebCore/PlatformKeyboardEvent.h>
  457. #include <WebCore/PluginDocument.h>
  458. #include <WebCore/PrintContext.h>
  459. @@ -3359,8 +3358,6 @@ void WebPage::sendCSPViolationReport(uint64_t frameID, const WebCore::URL& repor
  460. auto report = reportData.takeData();
  461. if (!report)
  462. return;
  463. - if (auto* frame = WebProcess::singleton().webFrame(frameID))
  464. - PingLoader::sendViolationReport(*frame->coreFrame(), reportURL, report.releaseNonNull(), ViolationReportType::ContentSecurityPolicy);
  465. }
  466. void WebPage::enqueueSecurityPolicyViolationEvent(uint64_t frameID, SecurityPolicyViolationEvent::Init&& eventInit)
  467. --
  468. 2.19.2