Changeset 207993 in webkit
- Timestamp:
- Oct 27, 2016, 11:16:22 AM (10 years ago)
- Location:
- branches/safari-602-branch/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) (1 diff)
-
UIProcess/WebContextClient.h (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-602-branch/Source/WebKit2/ChangeLog
r207953 r207993 1 2016-10-27 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r206684. rdar://problem/28545011 4 5 2016-09-30 Brady Eidson <beidson@apple.com> 6 7 REGRESSION (Safari 10 combined with WK changes): Unable to store WebCrypto keys in IndexedDB database. 8 <rdar://problem/28334440> and https://bugs.webkit.org/show_bug.cgi?id=162554 9 10 Reviewed by Alexey Proskuryakov. 11 12 Safari 10 has a WKPageNavigation client but does not implement the "copyWebCryptoMasterKey" callback. 13 14 WebKit just fails in this case, instead of falling back to "getDefaultWebCryptoMasterKey". 15 It should fall back. 16 17 Additionally there's a WKContextClient callback to get the crypto key, also, but it is completely unused. 18 So it should be pulled. 19 20 * UIProcess/API/APILoaderClient.h: 21 (API::LoaderClient::webCryptoMasterKey): Deleted. 22 * UIProcess/API/C/WKContext.h: 23 24 * UIProcess/API/C/WKPage.cpp: 25 (WKPageSetPageLoaderClient): 26 (WKPageSetPageNavigationClient): If the client doesn't implement this method, fallback to getDefaultWebCryptoMasterKey. 27 28 * UIProcess/Cocoa/NavigationState.mm: 29 (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): If the client doesn't implement this method, 30 fallback to getDefaultWebCryptoMasterKey. 31 32 * UIProcess/WebContextClient.cpp: 33 (WebKit::WebContextClient::copyWebCryptoMasterKey): Deleted. 34 * UIProcess/WebContextClient.h: 35 36 * UIProcess/WebPageProxy.cpp: 37 (WebKit::WebPageProxy::wrapCryptoKey): Only ask the NavigationClient before falling back. Don't ask the loader client. 38 (WebKit::WebPageProxy::unwrapCryptoKey): Ditto. 39 1 40 2016-10-26 David Kilzer <ddkilzer@apple.com> 2 41 -
branches/safari-602-branch/Source/WebKit2/UIProcess/API/APILoaderClient.h
r207607 r207993 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&) { } -
branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKContext.h
r196942 r207993 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. -
branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r207607 r207993 72 72 #include <WebCore/Page.h> 73 73 #include <WebCore/SecurityOriginData.h> 74 #include <WebCore/SerializedCryptoKeyWrap.h> 74 75 #include <WebCore/WindowFeatures.h> 75 76 … … 1213 1214 if (m_client.willGoToBackForwardListItem) 1214 1215 m_client.willGoToBackForwardListItem(toAPI(&page), toAPI(item), toAPI(userData), m_client.base.clientInfo); 1215 }1216 1217 RefPtr<API::Data> webCryptoMasterKey(WebPageProxy& page) override1218 {1219 return page.process().processPool().client().copyWebCryptoMasterKey(&page.process().processPool());1220 1216 } 1221 1217 … … 2327 2323 RefPtr<API::Data> webCryptoMasterKey(WebPageProxy& page) override 2328 2324 { 2329 if (!m_client.copyWebCryptoMasterKey) 2325 if (m_client.copyWebCryptoMasterKey) 2326 return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(&page), m_client.base.clientInfo))); 2327 2328 Vector<uint8_t> masterKey; 2329 if (!getDefaultWebCryptoMasterKey(masterKey)) 2330 2330 return nullptr; 2331 return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(&page), m_client.base.clientInfo))); 2331 2332 return API::Data::create(masterKey.data(), masterKey.size()); 2332 2333 } 2333 2334 -
branches/safari-602-branch/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm
r207801 r207993 64 64 #import <WebCore/Credential.h> 65 65 #import <WebCore/SecurityOriginData.h> 66 #import <WebCore/SerializedCryptoKeyWrap.h> 66 67 #import <WebCore/URL.h> 67 68 #import <wtf/NeverDestroyed.h> … … 716 717 RefPtr<API::Data> NavigationState::NavigationClient::webCryptoMasterKey(WebKit::WebPageProxy&) 717 718 { 718 if (!m_navigationState.m_navigationDelegateMethods.webCryptoMasterKeyForWebView) 719 return nullptr; 719 if (!m_navigationState.m_navigationDelegateMethods.webCryptoMasterKeyForWebView) { 720 Vector<uint8_t> masterKey; 721 if (!getDefaultWebCryptoMasterKey(masterKey)) 722 return nullptr; 723 724 return API::Data::create(masterKey.data(), masterKey.size()); 725 } 720 726 721 727 auto navigationDelegate = m_navigationState.m_navigationDelegate.get(); -
branches/safari-602-branch/Source/WebKit2/UIProcess/WebContextClient.cpp
r196821 r207993 66 66 m_client.plugInInformationBecameAvailable(toAPI(processPool), toAPI(plugInInfo), m_client.base.clientInfo); 67 67 } 68 69 PassRefPtr<API::Data> WebContextClient::copyWebCryptoMasterKey(WebProcessPool* processPool) 70 { 71 if (!m_client.copyWebCryptoMasterKey) 72 return nullptr; 73 74 return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(processPool), m_client.base.clientInfo))); 75 } 76 68 77 69 } // namespace WebKit -
branches/safari-602-branch/Source/WebKit2/UIProcess/WebContextClient.h
r196821 r207993 50 50 void databaseProcessDidCrash(WebProcessPool*); 51 51 void plugInInformationBecameAvailable(WebProcessPool*, API::Array*); 52 PassRefPtr<API::Data> copyWebCryptoMasterKey(WebProcessPool*);53 52 }; 54 53 -
branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp
r207801 r207993 6065 6065 if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*this)) 6066 6066 masterKey = keyData->dataReference().vector(); 6067 } else if (RefPtr<API::Data> keyData = m_loaderClient->webCryptoMasterKey(*this)) 6068 masterKey = keyData->dataReference().vector(); 6069 else if (!getDefaultWebCryptoMasterKey(masterKey)) { 6067 } else if (!getDefaultWebCryptoMasterKey(masterKey)) { 6070 6068 succeeded = false; 6071 6069 return; … … 6084 6082 if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*this)) 6085 6083 masterKey = keyData->dataReference().vector(); 6086 } else if (RefPtr<API::Data> keyData = m_loaderClient->webCryptoMasterKey(*this)) 6087 masterKey = keyData->dataReference().vector(); 6088 else if (!getDefaultWebCryptoMasterKey(masterKey)) { 6084 } else if (!getDefaultWebCryptoMasterKey(masterKey)) { 6089 6085 succeeded = false; 6090 6086 return;
Note:
See TracChangeset
for help on using the changeset viewer.