Changeset 206006 in webkit
- Timestamp:
- Sep 15, 2016 5:27:11 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206001 r206006 1 2016-09-15 Brady Eidson <beidson@apple.com> 2 3 WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage (even if it has http resources). 4 <rdar://problem/27681261> and https://bugs.webkit.org/show_bug.cgi?id=162043 5 6 Reviewed by Brent Fulgham. 7 8 No new tests (Not possible with current testing infrastructure). 9 10 This adds the infrastructure for WebCore to track whether or not a CachedFrame had insecure content at the time 11 it was cached, and then to report that back to the client when a CachedPage is restored. 12 13 Since "has insecure content" is currently only tracked in the WK2 UI process, that is the only client of this code. 14 15 * history/CachedFrame.cpp: 16 (WebCore::CachedFrame::setHasInsecureContent): 17 * history/CachedFrame.h: 18 (WebCore::CachedFrame::hasInsecureContent): 19 20 * loader/EmptyClients.h: 21 22 * loader/FrameLoader.cpp: 23 (WebCore::FrameLoader::receivedFirstData): 24 (WebCore::FrameLoader::commitProvisionalLoad): 25 (WebCore::FrameLoader::dispatchDidCommitLoad): 26 * loader/FrameLoader.h: 27 28 * loader/FrameLoaderClient.h: 29 30 * loader/FrameLoaderTypes.h: 31 1 32 2016-09-13 Jer Noble <jer.noble@apple.com> 2 33 -
trunk/Source/WebCore/history/CachedFrame.cpp
r205818 r206006 281 281 } 282 282 283 void CachedFrame::setHasInsecureContent(HasInsecureContent hasInsecureContent) 284 { 285 m_hasInsecureContent = hasInsecureContent; 286 } 287 283 288 int CachedFrame::descendantFrameCount() const 284 289 { -
trunk/Source/WebCore/history/CachedFrame.h
r187587 r206006 40 40 class FrameView; 41 41 class Node; 42 enum class HasInsecureContent; 42 43 43 44 class CachedFrameBase { … … 62 63 bool m_isMainFrame; 63 64 bool m_isComposited; 64 65 Optional<HasInsecureContent> m_hasInsecureContent; 66 65 67 Vector<std::unique_ptr<CachedFrame>> m_childFrames; 66 68 }; … … 78 80 WEBCORE_EXPORT CachedFramePlatformData* cachedFramePlatformData(); 79 81 82 WEBCORE_EXPORT void setHasInsecureContent(HasInsecureContent); 83 Optional<HasInsecureContent> hasInsecureContent() const { return m_hasInsecureContent; } 84 80 85 using CachedFrameBase::document; 81 86 using CachedFrameBase::view; -
trunk/Source/WebCore/loader/EmptyClients.h
r205487 r206006 297 297 void dispatchDidStartProvisionalLoad() override { } 298 298 void dispatchDidReceiveTitle(const StringWithDirection&) override { } 299 void dispatchDidCommitLoad( ) override { }299 void dispatchDidCommitLoad(Optional<HasInsecureContent>) override { } 300 300 void dispatchDidFailProvisionalLoad(const ResourceError&) override { } 301 301 void dispatchDidFailLoad(const ResourceError&) override { } -
trunk/Source/WebCore/loader/FrameLoader.cpp
r205817 r206006 639 639 void FrameLoader::receivedFirstData() 640 640 { 641 dispatchDidCommitLoad( );641 dispatchDidCommitLoad(Nullopt); 642 642 dispatchDidClearWindowObjectsInAllWorlds(); 643 643 dispatchGlobalObjectAvailableInAllWorlds(); … … 1827 1827 notifier().dispatchDidReceiveResponse(cachedPage->documentLoader(), mainResourceIdentifier, cachedPage->documentLoader()->response()); 1828 1828 1829 Optional<HasInsecureContent> hasInsecureContent = cachedPage->cachedMainFrame()->hasInsecureContent(); 1830 1829 1831 // FIXME: This API should be turned around so that we ground CachedPage into the Page. 1830 1832 cachedPage->restore(*m_frame.page()); 1831 1833 1832 dispatchDidCommitLoad( );1834 dispatchDidCommitLoad(hasInsecureContent); 1833 1835 #if PLATFORM(IOS) 1834 1836 m_frame.page()->chrome().setDispatchViewportDataDidChangeSuppressed(false); … … 3533 3535 } 3534 3536 3535 void FrameLoader::dispatchDidCommitLoad( )3537 void FrameLoader::dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent) 3536 3538 { 3537 3539 if (m_stateMachine.creatingInitialEmptyDocument()) 3538 3540 return; 3539 3541 3540 m_client.dispatchDidCommitLoad( );3542 m_client.dispatchDidCommitLoad(initialHasInsecureContent); 3541 3543 3542 3544 if (m_frame.isMainFrame()) { -
trunk/Source/WebCore/loader/FrameLoader.h
r204637 r206006 51 51 52 52 class Archive; 53 class CachedFrame; 53 54 class CachedFrameBase; 54 55 class CachedPage; … … 351 352 bool shouldReloadToHandleUnreachableURL(DocumentLoader*); 352 353 353 void dispatchDidCommitLoad( );354 void dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent); 354 355 355 356 void urlSelected(const FrameLoadRequest&, Event*); -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r205487 r206006 165 165 virtual void dispatchDidStartProvisionalLoad() = 0; 166 166 virtual void dispatchDidReceiveTitle(const StringWithDirection&) = 0; 167 virtual void dispatchDidCommitLoad( ) = 0;167 virtual void dispatchDidCommitLoad(Optional<HasInsecureContent>) = 0; 168 168 virtual void dispatchDidFailProvisionalLoad(const ResourceError&) = 0; 169 169 virtual void dispatchDidFailLoad(const ResourceError&) = 0; -
trunk/Source/WebCore/loader/FrameLoaderTypes.h
r204320 r206006 130 130 }; 131 131 132 enum class HasInsecureContent { 133 Yes, 134 No, 135 }; 136 132 137 } // namespace WebCore -
trunk/Source/WebKit/mac/ChangeLog
r206004 r206006 1 2016-09-15 Brady Eidson <beidson@apple.com> 2 3 WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage (even if it has http resources). 4 <rdar://problem/27681261> and https://bugs.webkit.org/show_bug.cgi?id=162043 5 6 Reviewed by Brent Fulgham. 7 8 * WebCoreSupport/WebFrameLoaderClient.h: 9 * WebCoreSupport/WebFrameLoaderClient.mm: 10 (WebFrameLoaderClient::dispatchDidCommitLoad): 11 1 12 2016-09-15 Anders Carlsson <andersca@apple.com> 2 13 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
r205487 r206006 112 112 void dispatchDidStartProvisionalLoad() override; 113 113 void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) override; 114 void dispatchDidCommitLoad( ) override;114 void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>) override; 115 115 void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&) override; 116 116 void dispatchDidFailLoad(const WebCore::ResourceError&) override; -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r204637 r206006 691 691 } 692 692 693 void WebFrameLoaderClient::dispatchDidCommitLoad( )693 void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent>) 694 694 { 695 695 // Tell the client we've committed this URL. -
trunk/Source/WebKit/win/ChangeLog
r205569 r206006 1 2016-09-15 Brady Eidson <beidson@apple.com> 2 3 WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage (even if it has http resources). 4 <rdar://problem/27681261> and https://bugs.webkit.org/show_bug.cgi?id=162043 5 6 Reviewed by Brent Fulgham. 7 8 * WebCoreSupport/WebFrameLoaderClient.cpp: 9 (WebFrameLoaderClient::dispatchDidCommitLoad): 10 * WebCoreSupport/WebFrameLoaderClient.h: 11 1 12 2016-09-07 Mark Lam <mark.lam@apple.com> 2 13 -
trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
r204637 r206006 424 424 } 425 425 426 void WebFrameLoaderClient::dispatchDidCommitLoad( )426 void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent>) 427 427 { 428 428 WebView* webView = m_webFrame->webView(); -
trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
r204637 r206006 87 87 void dispatchDidStartProvisionalLoad() override; 88 88 void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) override; 89 void dispatchDidCommitLoad( ) override;89 void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>) override; 90 90 void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&) override; 91 91 void dispatchDidFailLoad(const WebCore::ResourceError&) override; -
trunk/Source/WebKit2/ChangeLog
r206003 r206006 1 2016-09-15 Brady Eidson <beidson@apple.com> 2 3 WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage (even if it has http resources). 4 <rdar://problem/27681261> and https://bugs.webkit.org/show_bug.cgi?id=162043 5 6 Reviewed by Brent Fulgham. 7 8 * Scripts/webkit/messages.py: 9 (headers_for_type): Add a custom header, and alphabetize existing ones. 10 11 * Shared/WebCoreArgumentCoders.h: Add EnumTraits for HasInsecureContent. 12 13 * UIProcess/PageLoadState.h: 14 (WebKit::PageLoadState::committedHasInsecureContent): 15 16 * UIProcess/WebPageProxy.cpp: 17 (WebKit::WebPageProxy::hasInsecureContent): 18 (WebKit::WebPageProxy::didCommitLoadForFrame): If the WebProcess included an existing "HasInsecureContent" value, use it. 19 * UIProcess/WebPageProxy.h: 20 * UIProcess/WebPageProxy.messages.in: 21 22 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 23 (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): 24 (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame): Save the "HasInsecureContent" value to the CachedFrame in 25 case we restore it in the future. 26 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 27 1 28 2016-09-15 Anders Carlsson <andersca@apple.com> 2 29 -
trunk/Source/WebKit2/Scripts/webkit/messages.py
r206000 r206006 350 350 'WebCore::CompositionUnderline': ['<WebCore/Editor.h>'], 351 351 'WebCore::ExceptionDetails': ['<WebCore/JSDOMBinding.h>'], 352 'WebCore::FileChooserSettings': ['<WebCore/FileChooser.h>'], 352 353 'WebCore::GrammarDetail': ['<WebCore/TextCheckerClient.h>'], 353 'WebCore::TextureMapperAnimations': ['<WebCore/TextureMapperAnimation.h>'], 354 'WebCore::HasInsecureContent': ['<WebCore/FrameLoaderTypes.h>'], 355 'WebCore::Highlight': ['<WebCore/InspectorOverlay.h>'], 354 356 'WebCore::KeyframeValueList': ['<WebCore/GraphicsLayer.h>'], 355 357 'WebCore::KeypressCommand': ['<WebCore/KeyboardEvent.h>'], 356 'WebCore::FileChooserSettings': ['<WebCore/FileChooser.h>'],357 'WebCore::Highlight': ['<WebCore/InspectorOverlay.h>'],358 'WebCore::PluginInfo': ['<WebCore/PluginData.h>'],359 358 'WebCore::PasteboardImage': ['<WebCore/Pasteboard.h>'], 360 359 'WebCore::PasteboardWebContent': ['<WebCore/Pasteboard.h>'], 360 'WebCore::PluginInfo': ['<WebCore/PluginData.h>'], 361 361 'WebCore::RecentSearch': ['<WebCore/SearchPopupMenu.h>'], 362 362 'WebCore::TextCheckingRequestData': ['<WebCore/TextChecking.h>'], 363 363 'WebCore::TextCheckingResult': ['<WebCore/TextCheckerClient.h>'], 364 364 'WebCore::TextIndicatorData': ['<WebCore/TextIndicator.h>'], 365 'WebCore::TextureMapperAnimations': ['<WebCore/TextureMapperAnimation.h>'], 365 366 'WebCore::ViewportAttributes': ['<WebCore/ViewportArguments.h>'], 366 367 'WebKit::BackForwardListItemState': ['"SessionState.h"'], 368 'WebKit::LayerHostingMode': ['"LayerTreeContext.h"'], 367 369 'WebKit::PageState': ['"SessionState.h"'], 368 370 'WebKit::WebGestureEvent': ['"WebEvent.h"'], -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h
r204668 r206006 24 24 */ 25 25 26 #ifndef WebCoreArgumentCoders_h 27 #define WebCoreArgumentCoders_h 26 #pragma once 28 27 29 28 #include "ArgumentCoders.h" 29 #include <WebCore/FrameLoaderTypes.h> 30 30 #include <WebCore/PaymentHeaders.h> 31 31 … … 531 531 } // namespace IPC 532 532 533 #endif // WebCoreArgumentCoders_h 533 namespace WTF { 534 535 template<> struct EnumTraits<WebCore::HasInsecureContent> { 536 using values = EnumValues< 537 WebCore::HasInsecureContent, 538 WebCore::HasInsecureContent::No, 539 WebCore::HasInsecureContent::Yes 540 >; 541 }; 542 543 } // namespace WTF -
trunk/Source/WebKit2/UIProcess/PageLoadState.h
r191924 r206006 166 166 void setNetworkRequestsInProgress(const Transaction::Token&, bool); 167 167 168 bool committedHasInsecureContent() const { return m_committedState.hasInsecureContent; } 169 168 170 // FIXME: We piggy-back off PageLoadState::Observer so that both WKWebView and WKObservablePageState 169 171 // can listen for changes. Once we get rid of WKObservablePageState these could just be part of API::NavigationClient. -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r206000 r206006 3107 3107 } 3108 3108 3109 void WebPageProxy::hasInsecureContent(HasInsecureContent& hasInsecureContent) 3110 { 3111 hasInsecureContent = m_pageLoadState.committedHasInsecureContent() ? HasInsecureContent::Yes : HasInsecureContent::No; 3112 } 3113 3109 3114 void WebPageProxy::didDestroyNavigation(uint64_t navigationID) 3110 3115 { … … 3243 3248 } 3244 3249 3245 void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t opaqueFrameLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPluginDocument, const UserData& userData)3250 void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t opaqueFrameLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPluginDocument, Optional<HasInsecureContent> hasInsecureContent, const UserData& userData) 3246 3251 { 3247 3252 PageClientProtector protector(m_pageClient); … … 3263 3268 3264 3269 auto transaction = m_pageLoadState.transaction(); 3265 bool markPageInsecure = m_treatsSHA1CertificatesAsInsecure && certificateInfo.containsNonRootSHA1SignedCertificate();3266 3270 Ref<WebCertificateInfo> webCertificateInfo = WebCertificateInfo::create(certificateInfo); 3271 bool markPageInsecure = hasInsecureContent ? hasInsecureContent.value() == HasInsecureContent::Yes : m_treatsSHA1CertificatesAsInsecure && certificateInfo.containsNonRootSHA1SignedCertificate(); 3272 3267 3273 if (frame->isMainFrame()) { 3268 3274 m_pageLoadState.didCommitLoad(transaction, webCertificateInfo, markPageInsecure); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r205934 r206006 154 154 class SharedBuffer; 155 155 class TextIndicator; 156 enum class HasInsecureContent; 156 157 struct DictionaryPopupInfo; 157 158 struct ExceptionDetails; … … 1173 1174 void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, const String& url); 1174 1175 void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&); 1175 void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, const UserData&);1176 void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&); 1176 1177 void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&); 1177 1178 void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&); … … 1190 1191 void didFinishProgress(); 1191 1192 void setNetworkRequestsInProgress(bool); 1193 1194 void hasInsecureContent(WebCore::HasInsecureContent&); 1192 1195 1193 1196 void didDestroyNavigation(uint64_t navigationID); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r205934 r206006 127 127 DidChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, String url) 128 128 DidFailProvisionalLoadForFrame(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, String provisionalURL, WebCore::ResourceError error, WebKit::UserData userData) 129 DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, uint32_t loadType, WebCore::CertificateInfo certificateInfo, bool containsPluginDocument, WebKit::UserData userData)129 DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, uint32_t loadType, WebCore::CertificateInfo certificateInfo, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, WebKit::UserData userData) 130 130 DidFailLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceError error, WebKit::UserData userData) 131 131 DidFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, WebKit::UserData userData) … … 140 140 DidSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t type, String url, WebKit::UserData userData) 141 141 DidDestroyNavigation(uint64_t navigationID) 142 143 HasInsecureContent() -> (enum WebCore::HasInsecureContent hasInsecureContent) 142 144 143 145 MainFramePluginHandlesPageScaleGestureDidChange(bool mainFramePluginHandlesPageScaleGesture) -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r205487 r206006 56 56 #include <JavaScriptCore/APICast.h> 57 57 #include <JavaScriptCore/JSObject.h> 58 #include <WebCore/CachedFrame.h> 58 59 #include <WebCore/CertificateInfo.h> 59 60 #include <WebCore/Chrome.h> … … 439 440 } 440 441 441 void WebFrameLoaderClient::dispatchDidCommitLoad( )442 void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent> hasInsecureContent) 442 443 { 443 444 WebPage* webPage = m_frame->page(); … … 454 455 455 456 // Notify the UIProcess. 456 457 webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.response().mimeType(), m_frameHasCustomContentProvider, static_cast<uint32_t>(m_frame->coreFrame()->loader().loadType()), documentLoader.response().certificateInfo().valueOrCompute([] { return CertificateInfo(); }), m_frame->coreFrame()->document()->isPluginDocument(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()))); 457 webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.response().mimeType(), m_frameHasCustomContentProvider, static_cast<uint32_t>(m_frame->coreFrame()->loader().loadType()), documentLoader.response().certificateInfo().valueOrCompute([] { return CertificateInfo(); }), m_frame->coreFrame()->document()->isPluginDocument(), hasInsecureContent, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()))); 458 458 webPage->didCommitLoad(m_frame); 459 459 } … … 1282 1282 } 1283 1283 1284 void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame*) 1285 { 1284 void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame) 1285 { 1286 WebPage* webPage = m_frame->page(); 1287 if (!webPage) 1288 return; 1289 1290 HasInsecureContent hasInsecureContent; 1291 if (webPage->sendSync(Messages::WebPageProxy::HasInsecureContent(), Messages::WebPageProxy::HasInsecureContent::Reply(hasInsecureContent))) 1292 cachedFrame->setHasInsecureContent(hasInsecureContent); 1286 1293 } 1287 1294 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r205487 r206006 97 97 void dispatchDidStartProvisionalLoad() override; 98 98 void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) override; 99 void dispatchDidCommitLoad( ) override;99 void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>) override; 100 100 void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&) override; 101 101 void dispatchDidFailLoad(const WebCore::ResourceError&) override;
Note: See TracChangeset
for help on using the changeset viewer.