Changeset 206684 in webkit
- Timestamp:
- Sep 30, 2016, 3:38:58 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 8 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/APILoaderClient.h (modified) (1 diff)
-
UIProcess/API/C/WKContext.h (modified) (2 diffs)
-
UIProcess/API/C/WKPage.cpp (modified) (3 diffs)
-
UIProcess/Cocoa/NavigationState.mm (modified) (2 diffs)
-
UIProcess/WebContextClient.cpp (modified) (2 diffs)
-
UIProcess/WebContextClient.h (modified) (2 diffs)
-
UIProcess/WebPageProxy.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r206683 r206684 1 2016-09-30 Brady Eidson <beidson@apple.com> 2 3 REGRESSION (Safari 10 combined with WK changes): Unable to store WebCrypto keys in IndexedDB database. 4 <rdar://problem/28334440> and https://bugs.webkit.org/show_bug.cgi?id=162554 5 6 Reviewed by Alexey Proskuryakov. 7 8 Safari 10 has a WKPageNavigation client but does not implement the "copyWebCryptoMasterKey" callback. 9 10 WebKit just fails in this case, instead of falling back to "getDefaultWebCryptoMasterKey". 11 It should fall back. 12 13 Additionally there's a WKContextClient callback to get the crypto key, also, but it is completely unused. 14 So it should be pulled. 15 16 * UIProcess/API/APILoaderClient.h: 17 (API::LoaderClient::webCryptoMasterKey): Deleted. 18 * UIProcess/API/C/WKContext.h: 19 20 * UIProcess/API/C/WKPage.cpp: 21 (WKPageSetPageLoaderClient): 22 (WKPageSetPageNavigationClient): If the client doesn't implement this method, fallback to getDefaultWebCryptoMasterKey. 23 24 * UIProcess/Cocoa/NavigationState.mm: 25 (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): If the client doesn't implement this method, 26 fallback to getDefaultWebCryptoMasterKey. 27 28 * UIProcess/WebContextClient.cpp: 29 (WebKit::WebContextClient::copyWebCryptoMasterKey): Deleted. 30 * UIProcess/WebContextClient.h: 31 32 * UIProcess/WebPageProxy.cpp: 33 (WebKit::WebPageProxy::wrapCryptoKey): Only ask the NavigationClient before falling back. Don't ask the loader client. 34 (WebKit::WebPageProxy::unwrapCryptoKey): Ditto. 35 1 36 2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com> 2 37 -
trunk/Source/WebKit2/UIProcess/API/APILoaderClient.h
r204637 r206684 94 94 virtual void willGoToBackForwardListItem(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem*, API::Object*) { } 95 95 96 virtual RefPtr<Data> webCryptoMasterKey(WebKit::WebPageProxy&) { return nullptr; }97 98 96 virtual void didNavigateWithNavigationData(WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore&, WebKit::WebFrameProxy&) { } 99 97 virtual void didPerformClientRedirect(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { } -
trunk/Source/WebKit2/UIProcess/API/C/WKContext.h
r196942 r206684 76 76 77 77 // Version 1. 78 WKContextCopyWebCryptoMasterKeyCallback copyWebCryptoMasterKey;78 void (*copyWebCryptoMasterKey_unavailable)(void); 79 79 } WKContextClientV1; 80 80 … … 88 88 89 89 // Version 1. 90 WKContextCopyWebCryptoMasterKeyCallback copyWebCryptoMasterKey;90 void (*copyWebCryptoMasterKey_unavailable)(void); 91 91 92 92 // Version 2. -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r205822 r206684 73 73 #include <WebCore/Page.h> 74 74 #include <WebCore/SecurityOriginData.h> 75 #include <WebCore/SerializedCryptoKeyWrap.h> 75 76 #include <WebCore/WindowFeatures.h> 76 77 … … 1214 1215 if (m_client.willGoToBackForwardListItem) 1215 1216 m_client.willGoToBackForwardListItem(toAPI(&page), toAPI(item), toAPI(userData), m_client.base.clientInfo); 1216 }1217 1218 RefPtr<API::Data> webCryptoMasterKey(WebPageProxy& page) override1219 {1220 return page.process().processPool().client().copyWebCryptoMasterKey(&page.process().processPool());1221 1217 } 1222 1218 … … 2328 2324 RefPtr<API::Data> webCryptoMasterKey(WebPageProxy& page) override 2329 2325 { 2330 if (!m_client.copyWebCryptoMasterKey) 2326 if (m_client.copyWebCryptoMasterKey) 2327 return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(&page), m_client.base.clientInfo))); 2328 2329 Vector<uint8_t> masterKey; 2330 if (!getDefaultWebCryptoMasterKey(masterKey)) 2331 2331 return nullptr; 2332 return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(&page), m_client.base.clientInfo))); 2332 2333 return API::Data::create(masterKey.data(), masterKey.size()); 2333 2334 } 2334 2335 -
trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm
r205275 r206684 65 65 #import <WebCore/Credential.h> 66 66 #import <WebCore/SecurityOriginData.h> 67 #import <WebCore/SerializedCryptoKeyWrap.h> 67 68 #import <WebCore/URL.h> 68 69 #import <wtf/NeverDestroyed.h> … … 720 721 RefPtr<API::Data> NavigationState::NavigationClient::webCryptoMasterKey(WebKit::WebPageProxy&) 721 722 { 722 if (!m_navigationState.m_navigationDelegateMethods.webCryptoMasterKeyForWebView) 723 return nullptr; 723 if (!m_navigationState.m_navigationDelegateMethods.webCryptoMasterKeyForWebView) { 724 Vector<uint8_t> masterKey; 725 if (!getDefaultWebCryptoMasterKey(masterKey)) 726 return nullptr; 727 728 return API::Data::create(masterKey.data(), masterKey.size()); 729 } 724 730 725 731 auto navigationDelegate = m_navigationState.m_navigationDelegate.get(); -
trunk/Source/WebKit2/UIProcess/WebContextClient.cpp
r204317 r206684 27 27 #include "WebContextClient.h" 28 28 29 #include "APIArray.h"30 29 #include "WebProcessPool.h" 31 30 … … 56 55 } 57 56 58 PassRefPtr<API::Data> WebContextClient::copyWebCryptoMasterKey(WebProcessPool* processPool)59 {60 if (!m_client.copyWebCryptoMasterKey)61 return nullptr;62 63 return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(processPool), m_client.base.clientInfo)));64 }65 66 57 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/WebContextClient.h
r204317 r206684 32 32 33 33 namespace API { 34 class Array;35 36 34 template<> struct ClientTraits<WKContextClientBase> { 37 35 typedef std::tuple<WKContextClientV0, WKContextClientV1, WKContextClientV2> Versions; … … 49 47 void networkProcessDidCrash(WebProcessPool*); 50 48 void databaseProcessDidCrash(WebProcessPool*); 51 PassRefPtr<API::Data> copyWebCryptoMasterKey(WebProcessPool*);52 49 }; 53 50 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r206527 r206684 6146 6146 if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*this)) 6147 6147 masterKey = keyData->dataReference().vector(); 6148 } else if (RefPtr<API::Data> keyData = m_loaderClient->webCryptoMasterKey(*this)) 6149 masterKey = keyData->dataReference().vector(); 6150 else if (!getDefaultWebCryptoMasterKey(masterKey)) { 6148 } else if (!getDefaultWebCryptoMasterKey(masterKey)) { 6151 6149 succeeded = false; 6152 6150 return; … … 6165 6163 if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*this)) 6166 6164 masterKey = keyData->dataReference().vector(); 6167 } else if (RefPtr<API::Data> keyData = m_loaderClient->webCryptoMasterKey(*this)) 6168 masterKey = keyData->dataReference().vector(); 6169 else if (!getDefaultWebCryptoMasterKey(masterKey)) { 6165 } else if (!getDefaultWebCryptoMasterKey(masterKey)) { 6170 6166 succeeded = false; 6171 6167 return;
Note:
See TracChangeset
for help on using the changeset viewer.