Make WebsitePolicies a proper class with getters and setters
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Dec 2017 22:07:47 +0000 (22:07 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Dec 2017 22:07:47 +0000 (22:07 +0000)
commit4bd13de681856fc8561d94bc99a54a7d193c4b35
tree90ea53da25fb82271ac33bf06d05bea20eaaefd5
parent86971eabb2aea6b9994d4dc8186d2cd67fd2ec9c
Make WebsitePolicies a proper class with getters and setters
https://bugs.webkit.org/show_bug.cgi?id=180788

Reviewed by Andy Estes.

Also introduce WebsitePolicies::applyToDocumentLoader to reduce duplicate code.
This has a side-effect of now applying custom http header fields and content blocking enabled status
when updating WebsitePolicies.  This will result in these being applied when a user updates
the per-site settings, and they weren't before.

* CMakeLists.txt:
* Shared/WebsitePolicies.cpp: Added.
(WebKit::WebsitePolicies::WebsitePolicies):
(WebKit::WebsitePolicies::encode const):
(WebKit::WebsitePolicies::decode):
(WebKit::WebsitePolicies::applyToDocumentLoader):
* Shared/WebsitePolicies.h:
(WebKit::WebsitePolicies::contentBlockersEnabled const):
(WebKit::WebsitePolicies::setContentBlockersEnabled):
(WebKit::WebsitePolicies::allowedAutoplayQuirks const):
(WebKit::WebsitePolicies::setAllowedAutoplayQuirks):
(WebKit::WebsitePolicies::autoplayPolicy const):
(WebKit::WebsitePolicies::setAutoplayPolicy):
(WebKit::WebsitePolicies::customHeaderFields):
(WebKit::WebsitePolicies::takeCustomHeaderFields):
(WebKit::WebsitePolicies::setCustomHeaderFields):
(WebKit::WebsitePolicies::encode const): Deleted.
(WebKit::WebsitePolicies::decode): Deleted.
* UIProcess/API/APIWebsitePolicies.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::applyToDocumentLoader):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateWebsitePolicies):
* WebProcess/WebPage/WebPage.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebsitePolicies.cpp [new file with mode: 0644]
Source/WebKit/Shared/WebsitePolicies.h
Source/WebKit/UIProcess/API/APIWebsitePolicies.h
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h