Ignore:
Timestamp:
Jan 6, 2022, 9:21:06 AM (3 years ago)
Author:
Chris Dumez
Message:

Drop implementation for COOP / COEP violation reporting
https://bugs.webkit.org/show_bug.cgi?id=234899

Reviewed by Geoffrey Garen.

Source/WebCore:

Drop implementation for COOP / COEP violation reporting. The implementation was based on an outdated version of the specification
and has never shipped. Many COOP/COEP reporting tests are also flaky.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • loader/CrossOriginEmbedderPolicy.cpp:

(WebCore::contextURLForReport): Deleted.
(WebCore::sendCOEPPolicyInheritenceViolation): Deleted.
(WebCore::sendCOEPCORPViolation): Deleted.

  • loader/CrossOriginEmbedderPolicy.h:
  • loader/CrossOriginOpenerPolicy.cpp:

(WebCore::enforceResponseCrossOriginOpenerPolicy):
(WebCore::doCrossOriginOpenerHandlingOfResponse):
(WebCore::crossOriginOpenerPolicyValueToEffectivePolicyString): Deleted.
(WebCore::sendViolationReportWhenNavigatingToCOOPResponse): Deleted.
(WebCore::sendViolationReportWhenNavigatingAwayFromCOOPResponse): Deleted.

  • loader/CrossOriginOpenerPolicy.h:
  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::doCrossOriginOpenerHandlingOfResponse):
(WebCore::DocumentLoader::responseReceived):

  • loader/PingLoader.cpp:

(WebCore::PingLoader::sendReportToEndpoint): Deleted.

  • loader/PingLoader.h:
  • loader/ReportingEndpointsCache.cpp: Removed.

(WebCore::ReportingEndpointsCache::Endpoint::Endpoint): Deleted.
(WebCore::ReportingEndpointsCache::Endpoint::hasExpired const): Deleted.
(WebCore::ReportingEndpointsCache::create): Deleted.
(WebCore::ReportingEndpointsCache::addEndpointsFromResponse): Deleted.
(WebCore::ReportingEndpointsCache::addEndpointsFromReportToHeader): Deleted.
(WebCore::ReportingEndpointsCache::addEndpointFromDictionary): Deleted.
(WebCore::ReportingEndpointsCache::endpointURL const): Deleted.

  • loader/ReportingEndpointsCache.h: Removed.
  • page/Page.cpp:
  • page/Page.h:

(WebCore::Page::reportingEndpointsCache): Deleted.

  • page/PageConfiguration.cpp:
  • page/PageConfiguration.h:

Source/WebKit:

Drop implementation for COOP / COEP violation reporting. The implementation was based on an outdated version of the specification
and has never shipped. Many COOP/COEP reporting tests are also flaky.

  • NetworkProcess/NetworkLoadChecker.cpp:

(WebKit::performCORPCheck):

  • NetworkProcess/NetworkResourceLoader.cpp:

(WebKit::NetworkResourceLoader::shouldInterruptNavigationForCrossOriginEmbedderPolicy):
(WebKit::NetworkResourceLoader::shouldInterruptWorkerLoadForCrossOriginEmbedderPolicy):
(WebKit::NetworkResourceLoader::doCrossOriginOpenerHandlingOfResponse):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::m_appHighlightsVisible):
(WebKit::WebPage::sendCOEPPolicyInheritenceViolation): Deleted.
(WebKit::WebPage::sendCOEPCORPViolation): Deleted.
(WebKit::WebPage::sendViolationReportWhenNavigatingToCOOPResponse): Deleted.
(WebKit::WebPage::sendViolationReportWhenNavigatingAwayFromCOOPResponse): Deleted.

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/WebPage.messages.in:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::WebProcess):

  • WebProcess/WebProcess.h:

(WebKit::WebProcess::webSocketChannelManager):
(WebKit::WebProcess::reportingEndpointsCache): Deleted.

LayoutTests:

Skip all COOP / COEP reporting tests instead of marking individual tests as flaky or failing.

  • TestExpectations:
  • platform/ios-wk2/TestExpectations:
  • platform/mac-wk2/TestExpectations:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/loader/PingLoader.cpp

    r286383 r287693  
    5050#include "PlatformStrategies.h"
    5151#include "ProgressTracker.h"
    52 #include "ReportingEndpointsCache.h"
    5352#include "ResourceError.h"
    5453#include "ResourceHandle.h"
     
    251250}
    252251
    253 // https://www.w3.org/TR/reporting/#try-delivery
    254 void PingLoader::sendReportToEndpoint(Frame& frame, const SecurityOriginData& origin, const String& endpoint, const String& type, const URL& reportURL, const String& userAgent, const Function<void(JSON::Object&)>& populateReportBody)
    255 {
    256     ASSERT(!endpoint.isEmpty());
    257     auto reportingEndpointsCache = frame.page() ? frame.page()->reportingEndpointsCache() : nullptr;
    258     if (!reportingEndpointsCache)
    259         return;
    260     auto endpointURL = reportingEndpointsCache->endpointURL(origin, endpoint);
    261     if (!endpointURL.isValid())
    262         return;
    263 
    264     auto body = JSON::Object::create();
    265     populateReportBody(body);
    266 
    267     auto reportObject = JSON::Object::create();
    268     reportObject->setString("type"_s, type);
    269     if (reportURL.isValid())
    270         reportObject->setString("url"_s, reportURL.string());
    271     reportObject->setString("user_agent", userAgent);
    272     reportObject->setInteger("age", 0); // We currently do not delay sending the reports.
    273     reportObject->setObject("body"_s, WTFMove(body));
    274 
    275     auto reportList = JSON::Array::create();
    276     reportList->pushObject(reportObject);
    277 
    278     auto report = FormData::create(reportList->toJSONString().utf8());
    279     sendViolationReport(frame, endpointURL, WTFMove(report), ViolationReportType::StandardReportingAPIViolation);
    280 }
    281 
    282252} // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.