Title: [227546] trunk/Source
Revision
227546
Author
[email protected]
Date
2018-01-24 12:48:19 -0800 (Wed, 24 Jan 2018)

Log Message

Remove WebProcess authentication code
https://bugs.webkit.org/show_bug.cgi?id=182020

Reviewed by Brady Eidson.

Source/WebCore:

We were keeping it around for pre-NetworkSession media loading, which is gone now.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
* html/HTMLMediaElement.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
* loader/ResourceLoader.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForResponseToAuthenticationChallenge:]):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge): Deleted.

Source/WebKit:

* Shared/Authentication/AuthenticationManager.cpp:
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
* WebProcess/WebProcess.cpp:
(WebKit::m_webSQLiteDatabaseTracker):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (227545 => 227546)


--- trunk/Source/WebCore/ChangeLog	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebCore/ChangeLog	2018-01-24 20:48:19 UTC (rev 227546)
@@ -1,3 +1,27 @@
+2018-01-24  Alex Christensen  <[email protected]>
+
+        Remove WebProcess authentication code
+        https://bugs.webkit.org/show_bug.cgi?id=182020
+
+        Reviewed by Brady Eidson.
+
+        We were keeping it around for pre-NetworkSession media loading, which is gone now.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
+        * html/HTMLMediaElement.h:
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
+        * loader/ResourceLoader.h:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge): Deleted.
+        * platform/graphics/MediaPlayer.h:
+        (WebCore::MediaPlayerClient::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForResponseToAuthenticationChallenge:]):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge): Deleted.
+
 2018-01-24  Joanmarie Diggs  <[email protected]>
 
         AX: SVG AAM mapping trumps ARIA role attribute in the case of SVG root

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (227545 => 227546)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2018-01-24 20:48:19 UTC (rev 227546)
@@ -6877,27 +6877,6 @@
     return mediaCacheDirectory();
 }
 
-bool HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge& challenge)
-{
-    RefPtr<Frame> frame = document().frame();
-    if (!frame)
-        return false;
-
-    Page* page = frame->page();
-    if (!page)
-        return false;
-
-    ResourceRequest request(m_currentSrc);
-    ResourceLoadNotifier& notifier = frame->loader().notifier();
-    RefPtr<DocumentLoader> documentLoader = document().loader();
-    unsigned long identifier = page->progress().createUniqueIdentifier();
-
-    notifier.assignIdentifierToInitialRequest(identifier, documentLoader.get(), request);
-    notifier.didReceiveAuthenticationChallenge(identifier, documentLoader.get(), challenge);
-
-    return true;
-}
-
 String HTMLMediaElement::sourceApplicationIdentifier() const
 {
     if (RefPtr<Frame> frame = document().frame()) {

Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (227545 => 227546)


--- trunk/Source/WebCore/html/HTMLMediaElement.h	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h	2018-01-24 20:48:19 UTC (rev 227546)
@@ -702,7 +702,6 @@
 
     void mediaPlayerActiveSourceBuffersChanged(const MediaPlayer*) override;
 
-    bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) override;
     void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command, nullptr); }
     String sourceApplicationIdentifier() const override;
     String mediaPlayerSourceApplicationIdentifier() const override { return sourceApplicationIdentifier(); }

Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (227545 => 227546)


--- trunk/Source/WebCore/loader/ResourceLoader.cpp	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp	2018-01-24 20:48:19 UTC (rev 227546)
@@ -716,8 +716,9 @@
     return m_options.credentials == FetchOptions::Credentials::Include || (m_options.credentials == FetchOptions::Credentials::SameOrigin && m_frame->document()->securityOrigin().canRequest(originalRequest().url()));
 }
 
-void ResourceLoader::didReceiveAuthenticationChallenge(const AuthenticationChallenge& challenge)
+void ResourceLoader::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)
 {
+    ASSERT_UNUSED(handle, handle == m_handle);
     ASSERT(m_handle->hasAuthenticationChallenge());
 
     // Protect this in this delegate method since the additional processing can do

Modified: trunk/Source/WebCore/loader/ResourceLoader.h (227545 => 227546)


--- trunk/Source/WebCore/loader/ResourceLoader.h	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebCore/loader/ResourceLoader.h	2018-01-24 20:48:19 UTC (rev 227546)
@@ -107,7 +107,6 @@
     virtual void didRetrieveDerivedDataFromCache(const String& type, SharedBuffer&);
 
     virtual bool shouldUseCredentialStorage();
-    virtual void didReceiveAuthenticationChallenge(const AuthenticationChallenge&);
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
     virtual bool canAuthenticateAgainstProtectionSpace(const ProtectionSpace&);
 #endif
@@ -191,7 +190,7 @@
     void wasBlocked(ResourceHandle*) override;
     void cannotShowURL(ResourceHandle*) override;
     bool shouldUseCredentialStorage(ResourceHandle*) override { return shouldUseCredentialStorage(); }
-    void didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge& challenge) override { didReceiveAuthenticationChallenge(challenge); } 
+    void didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge&) override;
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
     void canAuthenticateAgainstProtectionSpaceAsync(ResourceHandle*, const ProtectionSpace&) override;
 #endif

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (227545 => 227546)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2018-01-24 20:48:19 UTC (rev 227546)
@@ -1417,11 +1417,6 @@
 }
 #endif
 
-bool MediaPlayer::shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge& challenge)
-{
-    return client().mediaPlayerShouldWaitForResponseToAuthenticationChallenge(challenge);
-}
-
 void MediaPlayer::handlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command)
 {
     client().mediaPlayerHandlePlaybackCommand(command);

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (227545 => 227546)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2018-01-24 20:48:19 UTC (rev 227546)
@@ -280,8 +280,6 @@
     virtual String mediaPlayerNetworkInterfaceName() const { return String(); }
     virtual bool mediaPlayerGetRawCookies(const URL&, Vector<Cookie>&) const { return false; }
 #endif
-    
-    virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) { return false; }
     virtual void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType) { }
 
     virtual String mediaPlayerSourceApplicationIdentifier() const { return emptyString(); }
@@ -607,7 +605,6 @@
     std::optional<PlatformVideoPlaybackQualityMetrics> videoPlaybackQualityMetrics();
 #endif
 
-    bool shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&);
     void handlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType);
     String sourceApplicationIdentifier() const;
     Vector<String> preferredAudioCharacteristics() const;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (227545 => 227546)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2018-01-24 20:48:19 UTC (rev 227546)
@@ -101,7 +101,6 @@
     
 #if HAVE(AVFOUNDATION_LOADER_DELEGATE)
     bool shouldWaitForLoadingOfResource(AVAssetResourceLoadingRequest*);
-    bool shouldWaitForResponseToAuthenticationChallenge(NSURLAuthenticationChallenge*);
     void didCancelLoadingRequest(AVAssetResourceLoadingRequest*);
     void didStopLoadingRequest(AVAssetResourceLoadingRequest *);
 #endif

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (227545 => 227546)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2018-01-24 20:48:19 UTC (rev 227546)
@@ -1825,11 +1825,6 @@
     return true;
 }
 
-bool MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge(NSURLAuthenticationChallenge* challenge)
-{
-    return player()->shouldWaitForResponseToAuthenticationChallenge(challenge);
-}
-
 void MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest(AVAssetResourceLoadingRequest* avRequest)
 {
     String scheme = [[[avRequest request] URL] scheme];
@@ -3525,26 +3520,9 @@
 - (BOOL)resourceLoader:(AVAssetResourceLoader *)resourceLoader shouldWaitForResponseToAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
 {
     UNUSED_PARAM(resourceLoader);
-    if (!m_callback)
-        return NO;
-
-    if ([[[challenge protectionSpace] authenticationMethod] isEqualToString:NSURLAuthenticationMethodServerTrust])
-        return NO;
-
-    RetainPtr<WebCoreAVFLoaderDelegate> protectedSelf = self;
-    RetainPtr<NSURLAuthenticationChallenge> protectedChallenge = challenge;
-    callOnMainThread([protectedSelf = WTFMove(protectedSelf), protectedChallenge = WTFMove(protectedChallenge)] {
-        MediaPlayerPrivateAVFoundationObjC* callback = protectedSelf->m_callback;
-        if (!callback) {
-            [[protectedChallenge sender] cancelAuthenticationChallenge:protectedChallenge.get()];
-            return;
-        }
-
-        if (!callback->shouldWaitForResponseToAuthenticationChallenge(protectedChallenge.get()))
-            [[protectedChallenge sender] cancelAuthenticationChallenge:protectedChallenge.get()];
-    });
-
-    return YES;
+    UNUSED_PARAM(challenge);
+    ASSERT_NOT_REACHED();
+    return NO;
 }
 
 - (void)resourceLoader:(AVAssetResourceLoader *)resourceLoader didCancelLoadingRequest:(AVAssetResourceLoadingRequest *)loadingRequest

Modified: trunk/Source/WebKit/ChangeLog (227545 => 227546)


--- trunk/Source/WebKit/ChangeLog	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebKit/ChangeLog	2018-01-24 20:48:19 UTC (rev 227546)
@@ -1,3 +1,21 @@
+2018-01-24  Alex Christensen  <[email protected]>
+
+        Remove WebProcess authentication code
+        https://bugs.webkit.org/show_bug.cgi?id=182020
+
+        Reviewed by Brady Eidson.
+
+        * Shared/Authentication/AuthenticationManager.cpp:
+        * Shared/Authentication/AuthenticationManager.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Deleted.
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::m_webSQLiteDatabaseTracker):
+
 2018-01-24  Jan-Michael Brummer  <[email protected]>
         [GTK] Page crash after swipe gesture running GNOME3 under wayland
 

Modified: trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp (227545 => 227546)


--- trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp	2018-01-24 20:48:19 UTC (rev 227546)
@@ -110,21 +110,6 @@
     return challengesToCoalesce;
 }
 
-void AuthenticationManager::didReceiveAuthenticationChallenge(WebFrame* frame, const AuthenticationChallenge& authenticationChallenge)
-{
-    ASSERT(frame);
-    ASSERT(frame->page());
-
-    auto pageID = frame->page()->pageID();
-    uint64_t challengeID = addChallengeToChallengeMap({ pageID, authenticationChallenge, { } });
-
-    // Coalesce challenges in the same protection space and in the same page.
-    if (shouldCoalesceChallenge(pageID, challengeID, authenticationChallenge))
-        return;
-    
-    m_process.send(Messages::WebPageProxy::DidReceiveAuthenticationChallenge(frame->frameID(), authenticationChallenge, challengeID), frame->page()->pageID());
-}
-
 void AuthenticationManager::didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const AuthenticationChallenge& authenticationChallenge, ChallengeCompletionHandler&& completionHandler)
 {
     ASSERT(pageID);

Modified: trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.h (227545 => 227546)


--- trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.h	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.h	2018-01-24 20:48:19 UTC (rev 227546)
@@ -59,7 +59,7 @@
 };
 using ChallengeCompletionHandler = CompletionHandler<void(AuthenticationChallengeDisposition, const WebCore::Credential&)>;
 
-class AuthenticationManager : public WebProcessSupplement, public NetworkProcessSupplement, public IPC::MessageReceiver {
+class AuthenticationManager : public NetworkProcessSupplement, public IPC::MessageReceiver {
     WTF_MAKE_NONCOPYABLE(AuthenticationManager);
 public:
     explicit AuthenticationManager(ChildProcess&);
@@ -71,8 +71,6 @@
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
     void continueCanAuthenticateAgainstProtectionSpace(DownloadID, bool canAuthenticate);
 #endif
-    // Called for resources in the WebProcess (NetworkProcess disabled)
-    void didReceiveAuthenticationChallenge(WebFrame*, const WebCore::AuthenticationChallenge&);
 
     void useCredentialForChallenge(uint64_t challengeID, const WebCore::Credential&, const WebCore::CertificateInfo&);
     void continueWithoutCredentialForChallenge(uint64_t challengeID);

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (227545 => 227546)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-01-24 20:48:19 UTC (rev 227546)
@@ -5903,11 +5903,6 @@
 #endif
 }
 
-void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const AuthenticationChallenge& coreChallenge, uint64_t challengeID)
-{
-    didReceiveAuthenticationChallengeProxy(frameID, AuthenticationChallengeProxy::create(coreChallenge, challengeID, m_process->connection()));
-}
-
 void WebPageProxy::didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&& authenticationChallenge)
 {
     WebFrameProxy* frame = m_process->webFrame(frameID);

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (227545 => 227546)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-01-24 20:48:19 UTC (rev 227546)
@@ -1562,8 +1562,6 @@
     void focusedFrameChanged(uint64_t frameID);
     void frameSetLargestFrameChanged(uint64_t frameID);
 
-    void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
-
     void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&);
 
 #if PLATFORM(COCOA)

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (227545 => 227546)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2018-01-24 20:48:19 UTC (rev 227546)
@@ -267,9 +267,6 @@
     ShowContextMenu(WebKit::ContextMenuContextData contextMenuContextData, WebKit::UserData userData)
 #endif
 
-    # Authentication messages
-    DidReceiveAuthenticationChallenge(uint64_t frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
-
     # Database messages
     ExceededDatabaseQuota(uint64_t frameID, String originIdentifier, String databaseName, String databaseDisplayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage) -> (uint64_t newQuota) Delayed
 

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (227545 => 227546)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-01-24 20:48:19 UTC (rev 227546)
@@ -218,16 +218,9 @@
     return webPage->injectedBundleResourceLoadClient().shouldUseCredentialStorage(*webPage, *m_frame, identifier);
 }
 
-void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge& challenge)
+void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&)
 {
-    // FIXME: Authentication is a per-resource concept, but we don't do per-resource handling in the UIProcess at the API level quite yet.
-    // Once we do, we might need to make sure authentication fits with our solution.
-
-    WebPage* webPage = m_frame->page();
-    if (!webPage)
-        return;
-
-    WebProcess::singleton().supplement<AuthenticationManager>()->didReceiveAuthenticationChallenge(m_frame, challenge);
+    ASSERT_NOT_REACHED();
 }
 
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (227545 => 227546)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-01-24 20:33:45 UTC (rev 227545)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-01-24 20:48:19 UTC (rev 227546)
@@ -186,7 +186,6 @@
     // limited.
     addSupplement<WebGeolocationManager>();
     addSupplement<WebCookieManager>();
-    addSupplement<AuthenticationManager>();
 
 #if ENABLE(NOTIFICATIONS)
     addSupplement<WebNotificationManager>();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to