|
Lines 56-61
a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp_sec1
|
| 56 |
#include "WebSWServerToContextConnectionMessages.h" |
56 |
#include "WebSWServerToContextConnectionMessages.h" |
| 57 |
#include "WebsiteDataStoreParameters.h" |
57 |
#include "WebsiteDataStoreParameters.h" |
| 58 |
#include <WebCore/NetworkStorageSession.h> |
58 |
#include <WebCore/NetworkStorageSession.h> |
|
|
59 |
#include <WebCore/ResourceLoadStatistics.h> |
| 59 |
#include <WebCore/ResourceRequest.h> |
60 |
#include <WebCore/ResourceRequest.h> |
| 60 |
#include <WebCore/SameSiteInfo.h> |
61 |
#include <WebCore/SameSiteInfo.h> |
| 61 |
#include <WebCore/SecurityPolicy.h> |
62 |
#include <WebCore/SecurityPolicy.h> |
|
Lines 559-647
void NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession()
a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp_sec2
|
| 559 |
m_networkProcess->addWebsiteDataStore(WebsiteDataStoreParameters::legacyPrivateSessionParameters()); |
560 |
m_networkProcess->addWebsiteDataStore(WebsiteDataStoreParameters::legacyPrivateSessionParameters()); |
| 560 |
} |
561 |
} |
| 561 |
|
562 |
|
|
|
563 |
#if ENABLE(RESOURCE_LOAD_STATISTICS) |
| 562 |
void NetworkConnectionToWebProcess::removeStorageAccessForFrame(PAL::SessionID sessionID, uint64_t frameID, uint64_t pageID) |
564 |
void NetworkConnectionToWebProcess::removeStorageAccessForFrame(PAL::SessionID sessionID, uint64_t frameID, uint64_t pageID) |
| 563 |
{ |
565 |
{ |
| 564 |
#if ENABLE(RESOURCE_LOAD_STATISTICS) |
|
|
| 565 |
if (auto* storageSession = networkProcess().storageSession(sessionID)) |
566 |
if (auto* storageSession = networkProcess().storageSession(sessionID)) |
| 566 |
storageSession->removeStorageAccessForFrame(frameID, pageID); |
567 |
storageSession->removeStorageAccessForFrame(frameID, pageID); |
| 567 |
#else |
|
|
| 568 |
UNUSED_PARAM(sessionID); |
| 569 |
UNUSED_PARAM(frameID); |
| 570 |
UNUSED_PARAM(pageID); |
| 571 |
#endif |
| 572 |
} |
568 |
} |
| 573 |
|
569 |
|
| 574 |
void NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage(PAL::SessionID sessionID, uint64_t pageID) |
570 |
void NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage(PAL::SessionID sessionID, uint64_t pageID) |
| 575 |
{ |
571 |
{ |
| 576 |
#if ENABLE(RESOURCE_LOAD_STATISTICS) |
|
|
| 577 |
if (auto* storageSession = networkProcess().storageSession(sessionID)) |
572 |
if (auto* storageSession = networkProcess().storageSession(sessionID)) |
| 578 |
storageSession->removeStorageAccessForAllFramesOnPage(pageID); |
573 |
storageSession->removeStorageAccessForAllFramesOnPage(pageID); |
| 579 |
#else |
|
|
| 580 |
UNUSED_PARAM(sessionID); |
| 581 |
UNUSED_PARAM(pageID); |
| 582 |
#endif |
| 583 |
} |
574 |
} |
| 584 |
|
575 |
|
| 585 |
void NetworkConnectionToWebProcess::logUserInteraction(PAL::SessionID sessionID, const String& topLevelOrigin) |
576 |
void NetworkConnectionToWebProcess::logUserInteraction(PAL::SessionID sessionID, const String& topLevelOrigin) |
| 586 |
{ |
577 |
{ |
| 587 |
#if ENABLE(RESOURCE_LOAD_STATISTICS) |
|
|
| 588 |
if (auto networkSession = networkProcess().networkSession(sessionID)) { |
578 |
if (auto networkSession = networkProcess().networkSession(sessionID)) { |
| 589 |
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) |
579 |
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) |
| 590 |
resourceLoadStatistics->logUserInteraction(topLevelOrigin, [] { }); |
580 |
resourceLoadStatistics->logUserInteraction(topLevelOrigin, [] { }); |
| 591 |
} |
581 |
} |
| 592 |
#else |
|
|
| 593 |
UNUSED_PARAM(sessionID); |
| 594 |
UNUSED_PARAM(topLevelOrigin); |
| 595 |
#endif |
| 596 |
} |
582 |
} |
| 597 |
|
583 |
|
| 598 |
void NetworkConnectionToWebProcess::logWebSocketLoading(PAL::SessionID sessionID, const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, WallTime lastSeen) |
584 |
void NetworkConnectionToWebProcess::logWebSocketLoading(PAL::SessionID sessionID, const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, WallTime lastSeen) |
| 599 |
{ |
585 |
{ |
| 600 |
#if ENABLE(RESOURCE_LOAD_STATISTICS) |
|
|
| 601 |
if (auto networkSession = networkProcess().networkSession(sessionID)) { |
586 |
if (auto networkSession = networkProcess().networkSession(sessionID)) { |
| 602 |
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) |
587 |
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) |
| 603 |
resourceLoadStatistics->logWebSocketLoading(targetPrimaryDomain, mainFramePrimaryDomain, lastSeen, [] { }); |
588 |
resourceLoadStatistics->logWebSocketLoading(targetPrimaryDomain, mainFramePrimaryDomain, lastSeen, [] { }); |
| 604 |
} |
589 |
} |
| 605 |
#else |
|
|
| 606 |
UNUSED_PARAM(sessionID); |
| 607 |
UNUSED_PARAM(targetPrimaryDomain); |
| 608 |
UNUSED_PARAM(mainFramePrimaryDomain); |
| 609 |
UNUSED_PARAM(lastSeen); |
| 610 |
#endif |
| 611 |
} |
590 |
} |
| 612 |
|
591 |
|
| 613 |
void NetworkConnectionToWebProcess::logSubresourceLoading(PAL::SessionID sessionID, const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, WallTime lastSeen) |
592 |
void NetworkConnectionToWebProcess::logSubresourceLoading(PAL::SessionID sessionID, const String& targetPrimaryDomain, const String& mainFramePrimaryDomain, WallTime lastSeen) |
| 614 |
{ |
593 |
{ |
| 615 |
#if ENABLE(RESOURCE_LOAD_STATISTICS) |
|
|
| 616 |
if (auto networkSession = networkProcess().networkSession(sessionID)) { |
594 |
if (auto networkSession = networkProcess().networkSession(sessionID)) { |
| 617 |
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) |
595 |
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) |
| 618 |
resourceLoadStatistics->logSubresourceLoading(targetPrimaryDomain, mainFramePrimaryDomain, lastSeen, [] { }); |
596 |
resourceLoadStatistics->logSubresourceLoading(targetPrimaryDomain, mainFramePrimaryDomain, lastSeen, [] { }); |
| 619 |
} |
597 |
} |
| 620 |
#else |
|
|
| 621 |
UNUSED_PARAM(sessionID); |
| 622 |
UNUSED_PARAM(targetPrimaryDomain); |
| 623 |
UNUSED_PARAM(mainFramePrimaryDomain); |
| 624 |
UNUSED_PARAM(lastSeen); |
| 625 |
#endif |
| 626 |
} |
598 |
} |
| 627 |
|
599 |
|
| 628 |
void NetworkConnectionToWebProcess::logSubresourceRedirect(PAL::SessionID sessionID, const String& sourcePrimaryDomain, const String& targetPrimaryDomain) |
600 |
void NetworkConnectionToWebProcess::logSubresourceRedirect(PAL::SessionID sessionID, const String& sourcePrimaryDomain, const String& targetPrimaryDomain) |
| 629 |
{ |
601 |
{ |
| 630 |
#if ENABLE(RESOURCE_LOAD_STATISTICS) |
|
|
| 631 |
if (auto networkSession = networkProcess().networkSession(sessionID)) { |
602 |
if (auto networkSession = networkProcess().networkSession(sessionID)) { |
| 632 |
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) |
603 |
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) |
| 633 |
resourceLoadStatistics->logSubresourceRedirect(sourcePrimaryDomain, targetPrimaryDomain, [] { }); |
604 |
resourceLoadStatistics->logSubresourceRedirect(sourcePrimaryDomain, targetPrimaryDomain, [] { }); |
| 634 |
} |
605 |
} |
| 635 |
#else |
|
|
| 636 |
UNUSED_PARAM(sessionID); |
| 637 |
UNUSED_PARAM(sourcePrimaryDomain); |
| 638 |
UNUSED_PARAM(targetPrimaryDomain); |
| 639 |
#endif |
| 640 |
} |
606 |
} |
| 641 |
|
607 |
|
| 642 |
void NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate() |
608 |
void NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate() |
| 643 |
{ |
609 |
{ |
| 644 |
#if ENABLE(RESOURCE_LOAD_STATISTICS) |
|
|
| 645 |
for (auto& networkSession : networkProcess().networkSessions().values()) { |
610 |
for (auto& networkSession : networkProcess().networkSessions().values()) { |
| 646 |
if (networkSession->sessionID().isEphemeral()) |
611 |
if (networkSession->sessionID().isEphemeral()) |
| 647 |
continue; |
612 |
continue; |
|
Lines 649-657
void NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate()
a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp_sec3
|
| 649 |
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) |
614 |
if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) |
| 650 |
resourceLoadStatistics->requestUpdate(); |
615 |
resourceLoadStatistics->requestUpdate(); |
| 651 |
} |
616 |
} |
| 652 |
#endif |
|
|
| 653 |
} |
617 |
} |
| 654 |
|
618 |
|
|
|
619 |
void NetworkConnectionToWebProcess::hasStorageAccess(PAL::SessionID sessionID, const String& subFrameHost, const String& topFrameHost, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&& completionHandler) |
| 620 |
{ |
| 621 |
networkProcess().hasStorageAccess(sessionID, subFrameHost, topFrameHost, frameID, pageID, WTFMove(completionHandler)); |
| 622 |
} |
| 623 |
|
| 624 |
void NetworkConnectionToWebProcess::requestStorageAccess(PAL::SessionID sessionID, const String& subFrameHost, const String& topFrameHost, uint64_t frameID, uint64_t pageID, bool promptEnabled, CompletionHandler<void(bool)>&& completionHandler) |
| 625 |
{ |
| 626 |
networkProcess().requestStorageAccessGranted(sessionID, subFrameHost, topFrameHost, frameID, pageID, promptEnabled, WTFMove(completionHandler)); |
| 627 |
} |
| 628 |
#endif |
| 629 |
|
| 655 |
void NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains) |
630 |
void NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains) |
| 656 |
{ |
631 |
{ |
| 657 |
SecurityPolicy::addOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains); |
632 |
SecurityPolicy::addOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains); |