Improve logging in ResourceHandleMac.mm
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Mar 2013 21:10:45 +0000 (21:10 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Mar 2013 21:10:45 +0000 (21:10 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=112185

        Reviewed by Brady Eidson.

        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Removed an obsolete #if.
        (WebCore::ResourceHandle::receivedCredential):
        (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
        (WebCore::ResourceHandle::receivedCancellation):
        (-[WebCoreResourceHandleAsDelegate connection:didCancelAuthenticationChallenge:]): Added a FIXME.
        (-[WebCoreResourceHandleAsDelegate connection:canAuthenticateAgainstProtectionSpace:]):

        * platform/network/mac/ResourceResponseMac.mm: Removed an unneeded include.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145581 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebCore/platform/network/mac/ResourceResponseMac.mm

index cd8ea28..e8ab2d2 100644 (file)
@@ -1,3 +1,20 @@
+2013-03-12  Alexey Proskuryakov  <ap@apple.com>
+
+        Improve logging in ResourceHandleMac.mm
+        https://bugs.webkit.org/show_bug.cgi?id=112185
+
+        Reviewed by Brady Eidson.
+
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Removed an obsolete #if.
+        (WebCore::ResourceHandle::receivedCredential):
+        (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
+        (WebCore::ResourceHandle::receivedCancellation):
+        (-[WebCoreResourceHandleAsDelegate connection:didCancelAuthenticationChallenge:]): Added a FIXME.
+        (-[WebCoreResourceHandleAsDelegate connection:canAuthenticateAgainstProtectionSpace:]):
+
+        * platform/network/mac/ResourceResponseMac.mm: Removed an unneeded include.
+
 2013-03-12  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r145554.
index 1a1ab81..273ab97 100644 (file)
@@ -454,7 +454,6 @@ void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChall
     // we make sure that is actually present
     ASSERT(challenge.nsURLAuthenticationChallenge());
 
-#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
     // Proxy authentication is handled by CFNetwork internally. We can get here if the user cancels
     // CFNetwork authentication dialog, and we shouldn't ask the client to display another one in that case.
     if (challenge.protectionSpace().isProxy()) {
@@ -462,7 +461,6 @@ void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChall
         [challenge.sender() continueWithoutCredentialForAuthenticationChallenge:challenge.nsURLAuthenticationChallenge()];
         return;
     }
-#endif
 
     if (!d->m_user.isNull() && !d->m_pass.isNull()) {
         NSURLCredential *credential = [[NSURLCredential alloc] initWithUser:d->m_user
@@ -533,6 +531,8 @@ bool ResourceHandle::canAuthenticateAgainstProtectionSpace(const ProtectionSpace
 
 void ResourceHandle::receivedCredential(const AuthenticationChallenge& challenge, const Credential& credential)
 {
+    LOG(Network, "Handle %p receivedCredential", this);
+
     ASSERT(!challenge.isNull());
     if (challenge != d->m_currentWebChallenge)
         return;
@@ -561,6 +561,8 @@ void ResourceHandle::receivedCredential(const AuthenticationChallenge& challenge
 
 void ResourceHandle::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& challenge)
 {
+    LOG(Network, "Handle %p receivedRequestToContinueWithoutCredential", this);
+
     ASSERT(!challenge.isNull());
     if (challenge != d->m_currentWebChallenge)
         return;
@@ -572,6 +574,8 @@ void ResourceHandle::receivedRequestToContinueWithoutCredential(const Authentica
 
 void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challenge)
 {
+    LOG(Network, "Handle %p receivedCancellation", this);
+
     if (challenge != d->m_currentWebChallenge)
         return;
 
@@ -674,6 +678,8 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
 
 - (void)connection:(NSURLConnection *)connection didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
 {
+    // FIXME: We probably don't need to implement this (see <rdar://problem/8960124>).
+
     UNUSED_PARAM(connection);
 
     LOG(Network, "Handle %p delegate connection:%p didCancelAuthenticationChallenge:%p", m_handle, connection, challenge);
@@ -686,11 +692,9 @@ void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challen
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
 - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
 {
-#if LOG_DISABLED
     UNUSED_PARAM(connection);
-#endif
 
-    LOG(Network, "Handle %p delegate connection:%p canAuthenticateAgainstProtectionSpace:%p", m_handle, connection, protectionSpace);
+    LOG(Network, "Handle %p delegate connection:%p canAuthenticateAgainstProtectionSpace:%@://%@:%u realm:%@ method:%@ %@%@", m_handle, connection, [protectionSpace protocol], [protectionSpace host], [protectionSpace port], [protectionSpace realm], [protectionSpace authenticationMethod], [protectionSpace isProxy] ? @"proxy:" : @"", [protectionSpace isProxy] ? [protectionSpace proxyType] : @"");
 
     if (!m_handle)
         return NO;
index 4fb51ba..0b456de 100644 (file)
@@ -30,9 +30,8 @@
 #import "WebCoreURLResponse.h"
 #import "WebCoreSystemInterface.h"
 #import <Foundation/Foundation.h>
-#import <wtf/StdLibExtras.h>
 #import <limits>
-#include <wtf/text/CString.h>
+#import <wtf/StdLibExtras.h>
 
 using namespace std;