WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage...
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Sep 2016 00:27:11 +0000 (00:27 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Sep 2016 00:27:11 +0000 (00:27 +0000)
commit869e4c6342c7cd8eb3c8af86363ee76dc2480ffa
tree5c9be7e256277634f5f1a739a07c6e058b79f039
parent4cf1431c18fa5443d5e3c5ce06135d177fdc51e9
WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage (even if it has http resources).
<rdar://problem/27681261> and https://bugs.webkit.org/show_bug.cgi?id=162043

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests (Not possible with current testing infrastructure).

This adds the infrastructure for WebCore to track whether or not a CachedFrame had insecure content at the time
it was cached, and then to report that back to the client when a CachedPage is restored.

Since "has insecure content" is currently only tracked in the WK2 UI process, that is the only client of this code.

* history/CachedFrame.cpp:
(WebCore::CachedFrame::setHasInsecureContent):
* history/CachedFrame.h:
(WebCore::CachedFrame::hasInsecureContent):

* loader/EmptyClients.h:

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::receivedFirstData):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::dispatchDidCommitLoad):
* loader/FrameLoader.h:

* loader/FrameLoaderClient.h:

* loader/FrameLoaderTypes.h:

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidCommitLoad):

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDidCommitLoad):
* WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKit2:

* Scripts/webkit/messages.py:
(headers_for_type): Add a custom header, and alphabetize existing ones.

* Shared/WebCoreArgumentCoders.h: Add EnumTraits for HasInsecureContent.

* UIProcess/PageLoadState.h:
(WebKit::PageLoadState::committedHasInsecureContent):

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::hasInsecureContent):
(WebKit::WebPageProxy::didCommitLoadForFrame): If the WebProcess included an existing "HasInsecureContent" value, use it.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
(WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame): Save the "HasInsecureContent" value to the CachedFrame in
  case we restore it in the future.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/history/CachedFrame.cpp
Source/WebCore/history/CachedFrame.h
Source/WebCore/loader/EmptyClients.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/FrameLoaderClient.h
Source/WebCore/loader/FrameLoaderTypes.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit2/ChangeLog
Source/WebKit2/Scripts/webkit/messages.py
Source/WebKit2/Shared/WebCoreArgumentCoders.h
Source/WebKit2/UIProcess/PageLoadState.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h