[webkit-changes] [WebKit/WebKit] 8d3bcb: [ResourceMonitor] Add support of monitoring for if...

Basuke Suzuki noreply at github.com
Mon Dec 16 11:08:01 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8d3bcb122bc19a1aaa1c15fa1d6b2165d771a669
      https://github.com/WebKit/WebKit/commit/8d3bcb122bc19a1aaa1c15fa1d6b2165d771a669
  Author: Basuke Suzuki <basuke at apple.com>
  Date:   2024-12-16 (Mon, 16 Dec 2024)

  Changed paths:
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/html/HTMLIFrameElement.cpp
    M Source/WebCore/html/HTMLIFrameElement.h
    M Source/WebCore/loader/DocumentLoader.cpp
    M Source/WebCore/loader/ResourceLoader.cpp
    M Source/WebCore/loader/ResourceLoader.h
    M Source/WebCore/loader/ResourceMonitor.cpp
    M Source/WebCore/loader/ResourceMonitor.h

  Log Message:
  -----------
  [ResourceMonitor] Add support of monitoring for iframes created by script.
https://bugs.webkit.org/show_bug.cgi?id=284639
rdar://137691088

Reviewed by Ben Nham.

If the iframe is created runtime, the script URL that creates the element is also the
target of checking the eligibility.

This patch add support for this case by checking the stack trace when iframe is created
and keep the URL of the known source in HTMLIFrameElement object. Then when document of
the frame is created, ResourceMonitor is also checks those URL.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::resourceMonitorIfExists):
(WebCore::Document::resourceMonitor):
(WebCore::Document::protectedResourceMonitor):
(WebCore::Document::parentResourceMonitorIfExists):
(WebCore::Document::setResourceMonitor): Deleted.
(WebCore::Document::parentResourceMonitor): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::HTMLIFrameElement):
* Source/WebCore/html/HTMLIFrameElement.h:
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* Source/WebCore/loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponse):
(WebCore::ResourceLoader::didReceiveBuffer):
(WebCore::ResourceLoader::resourceMonitorIfExists):
(WebCore::ResourceLoader::resourceMonitor): Deleted.
* Source/WebCore/loader/ResourceLoader.h:
* Source/WebCore/loader/ResourceMonitor.cpp:
(WebCore::ResourceMonitor::create):
(WebCore::ResourceMonitor::ResourceMonitor):
(WebCore::ResourceMonitor::setEligibility):
(WebCore::ResourceMonitor::setDocumentURL):
(WebCore::ResourceMonitor::addNetworkUsage):
(WebCore::ResourceMonitor::checkNetworkUsageExcessIfNecessary):
(WebCore::ResourceMonitor::parentResourceMonitorIfExists const):
(WebCore::ResourceMonitor::parentResourceMonitor const): Deleted.
* Source/WebCore/loader/ResourceMonitor.h:

Canonical link: https://commits.webkit.org/287897@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list