+2013-01-26 Alexey Proskuryakov <ap@apple.com>
+
+ Remove code for handling NetworkProcess authentication challenges in WebProcess
+ https://bugs.webkit.org/show_bug.cgi?id=108003
+
+ Reviewed by Sam Weinig.
+
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
+ Once again, there can be no authentication without an in-process network request.
+
+ * WebCore.exp.in:
+ * platform/network/AuthenticationChallengeBase.cpp:
+ (WebCore::AuthenticationChallengeBase::AuthenticationChallengeBase):
+ * platform/network/AuthenticationChallengeBase.h:
+ (AuthenticationChallengeBase):
+ * platform/network/cf/AuthenticationCF.cpp:
+ (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+ * platform/network/cf/AuthenticationChallenge.h:
+ (AuthenticationChallenge):
+ * platform/network/curl/AuthenticationChallenge.h:
+ (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+ * platform/network/mac/AuthenticationMac.mm:
+ (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+ * platform/network/qt/AuthenticationChallenge.h:
+ (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+ * platform/network/soup/AuthenticationChallenge.h:
+ (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+ * platform/network/win/AuthenticationChallenge.h:
+ (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+ Removed everything related to AuthenticationChallengeBase::m_identifier.
+ The identifier is now tracked for IPC only, which is the right thing, because
+ nothing can guarantee identifier uniqueness across processes.
+
2013-01-26 Laszlo Gombos <l.gombos@samsung.com>
Fix the test for CHANNEL_MESSAGING in idl files
__ZN7WebCore23ApplicationCacheStorage26storeUpdatedQuotaForOriginEPKNS_14SecurityOriginEx
__ZN7WebCore23ApplicationCacheStorage5emptyEv
__ZN7WebCore23AuthenticationChallenge23setAuthenticationClientEPNS_20AuthenticationClientE
-__ZN7WebCore23AuthenticationChallengeC1ERKNS_15ProtectionSpaceERKNS_10CredentialEjRKNS_16ResourceResponseERKNS_13ResourceErrorEy
+__ZN7WebCore23AuthenticationChallengeC1ERKNS_15ProtectionSpaceERKNS_10CredentialEjRKNS_16ResourceResponseERKNS_13ResourceErrorE
__ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE
__ZN7WebCore23dataForURLComponentTypeEP5NSURLl
__ZN7WebCore23decodeHostNameWithRangeEP8NSString8_NSRange
void ResourceLoader::didReceiveAuthenticationChallenge(const AuthenticationChallenge& challenge)
{
- ASSERT(!handle() || handle()->hasAuthenticationChallenge());
+ ASSERT(handle()->hasAuthenticationChallenge());
// Protect this in this delegate method since the additional processing can do
// anything including possibly derefing this; one example of this is Radar 3266216.
AuthenticationChallengeBase::AuthenticationChallengeBase()
: m_isNull(true)
, m_previousFailureCount(0)
- , m_identifier(0)
{
}
, m_previousFailureCount(previousFailureCount)
, m_failureResponse(response)
, m_error(error)
- , m_identifier(0)
{
}
bool isNull() const;
void nullify();
- uint64_t identifier() const { return m_identifier; }
-
static bool compare(const AuthenticationChallenge& a, const AuthenticationChallenge& b);
protected:
unsigned m_previousFailureCount;
ResourceResponse m_failureResponse;
ResourceError m_error;
- uint64_t m_identifier;
};
inline bool operator==(const AuthenticationChallenge& a, const AuthenticationChallenge& b) { return AuthenticationChallengeBase::compare(a, b); }
namespace WebCore {
-static uint64_t generateUniqueIdentifier()
-{
- static uint64_t uniqueIdentifier;
- return ++uniqueIdentifier;
-}
-
AuthenticationChallenge::AuthenticationChallenge(const ProtectionSpace& protectionSpace,
const Credential& proposedCredential,
unsigned previousFailureCount,
const ResourceResponse& response,
- const ResourceError& error,
- uint64_t identifier)
+ const ResourceError& error)
: AuthenticationChallengeBase(protectionSpace,
proposedCredential,
previousFailureCount,
response,
error)
{
- m_identifier = identifier;
}
AuthenticationChallenge::AuthenticationChallenge(CFURLAuthChallengeRef cfChallenge,
, m_authenticationClient(authenticationClient)
, m_cfChallenge(cfChallenge)
{
- m_identifier = generateUniqueIdentifier();
}
AuthenticationClient* AuthenticationChallenge::authenticationClient() const
class AuthenticationChallenge : public AuthenticationChallengeBase {
public:
AuthenticationChallenge() {}
- AuthenticationChallenge(const ProtectionSpace&, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse&, const ResourceError&, uint64_t identifier);
+ AuthenticationChallenge(const ProtectionSpace&, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse&, const ResourceError&);
#if USE(CFNETWORK)
AuthenticationChallenge(CFURLAuthChallengeRef, AuthenticationClient*);
{
}
- AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error, uint64_t identifier)
+ AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error)
: AuthenticationChallengeBase(protectionSpace, proposedCredential, previousFailureCount, response, error)
{
- m_identifier = identifier;
}
AuthenticationClient* authenticationClient() const { return m_authenticationClient.get(); }
NSString * const NSURLAuthenticationMethodNTLM = @"NSURLAuthenticationMethodNTLM";
#endif
-static uint64_t generateUniqueIdentifier()
-{
- static uint64_t uniqueIdentifier;
- return ++uniqueIdentifier;
-}
-
AuthenticationChallenge::AuthenticationChallenge(const ProtectionSpace& protectionSpace,
const Credential& proposedCredential,
unsigned previousFailureCount,
const ResourceResponse& response,
- const ResourceError& error,
- uint64_t identifier)
+ const ResourceError& error)
: AuthenticationChallengeBase(protectionSpace,
proposedCredential,
previousFailureCount,
response,
error)
{
- m_identifier = identifier;
}
AuthenticationChallenge::AuthenticationChallenge(NSURLAuthenticationChallenge *challenge)
, m_sender([challenge sender])
, m_nsChallenge(challenge)
{
- m_identifier = generateUniqueIdentifier();
}
void AuthenticationChallenge::setAuthenticationClient(AuthenticationClient* client)
{
}
- AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error, uint64_t identifier)
+ AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error)
: AuthenticationChallengeBase(protectionSpace, proposedCredential, previousFailureCount, response, error)
{
- m_identifier = identifier;
}
AuthenticationClient* authenticationClient() const { return 0; } // FIXME: Implement!
{
}
- AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error, uint64_t identifier)
+ AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error)
: AuthenticationChallengeBase(protectionSpace, proposedCredential, previousFailureCount, response, error)
{
- m_identifier = identifier;
}
AuthenticationChallenge(SoupSession*, SoupMessage*, SoupAuth*, bool retrying, AuthenticationClient*);
{
}
- AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error, uint64_t identifier)
+ AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error)
: AuthenticationChallengeBase(protectionSpace, proposedCredential, previousFailureCount, response, error)
{
- m_identifier = identifier;
}
};
+2013-01-26 Alexey Proskuryakov <ap@apple.com>
+
+ Remove code for handling NetworkProcess authentication challenges in WebProcess
+ https://bugs.webkit.org/show_bug.cgi?id=108003
+
+ Reviewed by Sam Weinig.
+
+ * WebURLAuthenticationChallenge.cpp:
+ (WebURLAuthenticationChallenge::initWithProtectionSpace):
+ Adapted for new AuthenticationChallenge constructor signature.
+
2013-01-24 Mark Hahnenberg <mhahnenberg@apple.com>
Objective-C API: Rename JSValue.h/APIJSValue.h to JSCJSValue.h/JSValue.h
// construct the AuthenticationChallenge with that as obtained from the webSender
#if USE(CFNETWORK)
m_authenticationChallenge = AuthenticationChallenge(webSpace->protectionSpace(), webCredential->credential(),
- previousFailureCount, webResponse->resourceResponse(), webError->resourceError(), 0);
+ previousFailureCount, webResponse->resourceResponse(), webError->resourceError());
#endif
return S_OK;
}
+2013-01-26 Alexey Proskuryakov <ap@apple.com>
+
+ Remove code for handling NetworkProcess authentication challenges in WebProcess
+ https://bugs.webkit.org/show_bug.cgi?id=108003
+
+ Reviewed by Sam Weinig.
+
+ * DerivedSources.make:
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
+ * WebKit2.xcodeproj/project.pbxproj:
+ * NetworkProcess/NetworkResourceLoader.messages.in: Removed. We no longer have
+ an messages to NetworkResourceLoader.
+
+ * Shared/WebCoreArgumentCoders.cpp:
+ (CoreIPC::::encode):
+ (CoreIPC::::decode):
+ There is no longer an identifier inside AuthenticationChallenge.
+
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::didReceiveAuthenticationChallenge):
+ (WebKit::NetworkResourceLoader::didCancelAuthenticationChallenge):
+ * NetworkProcess/NetworkResourceLoader.h:
+ Removed code for receiving authentication responses from WebProcess. Removed
+ m_currentAuthenticationChallenge - AuthenticationMAnager now keeps track of that.
+
+ * WebProcess/Network/WebResourceLoader.cpp:
+ * WebProcess/Network/WebResourceLoader.h:
+ * WebProcess/Network/WebResourceLoader.messages.in:
+ Removed code for handling authentication challenges. They are now sent directly to
+ UI Process. The only thing WebProcess still does is decide whether is can authenticate
+ against a particular authentication space.
+
2013-01-26 Sam Weinig <sam@webkit.org>
Fix the development build.
WebCookieManagerProxy \
WebConnection \
NetworkConnectionToWebProcess \
- NetworkResourceLoader \
RemoteLayerTreeHost \
SecItemShim \
SecItemShimProxy \
return;
}
- if (messageID.is<CoreIPC::MessageClassNetworkResourceLoader>()) {
- NetworkResourceLoader* loader = m_networkResourceLoaders.get(decoder.destinationID()).get();
- if (loader)
- loader->didReceiveNetworkResourceLoaderMessage(connection, messageID, decoder);
- return;
- }
ASSERT_NOT_REACHED();
}
void NetworkResourceLoader::didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge& challenge)
{
- ASSERT(!m_currentAuthenticationChallenge);
- m_currentAuthenticationChallenge = adoptPtr(new AuthenticationChallenge(challenge));
-
- NetworkProcess::shared().authenticationManager().didReceiveAuthenticationChallenge(webPageID(), webFrameID(), *m_currentAuthenticationChallenge);
+ NetworkProcess::shared().authenticationManager().didReceiveAuthenticationChallenge(webPageID(), webFrameID(), challenge);
}
void NetworkResourceLoader::didCancelAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge& challenge)
{
- ASSERT(m_currentAuthenticationChallenge);
- ASSERT(m_currentAuthenticationChallenge->identifier() == challenge.identifier());
-
- send(Messages::WebResourceLoader::DidCancelAuthenticationChallenge(*m_currentAuthenticationChallenge));
-
- m_currentAuthenticationChallenge.clear();
-}
-
-void NetworkResourceLoader::receivedCancellation(ResourceHandle*, const AuthenticationChallenge& challenge)
-{
- receivedAuthenticationCancellation(challenge);
-}
-
-void NetworkResourceLoader::receivedAuthenticationCredential(const AuthenticationChallenge& challenge, const Credential& credential)
-{
- ASSERT(m_currentAuthenticationChallenge);
- ASSERT(m_currentAuthenticationChallenge->authenticationClient());
-
- if (m_currentAuthenticationChallenge->identifier() != challenge.identifier())
- return;
-
- m_currentAuthenticationChallenge->authenticationClient()->receivedCredential(*m_currentAuthenticationChallenge, credential);
- m_currentAuthenticationChallenge.clear();
-}
-
-void NetworkResourceLoader::receivedRequestToContinueWithoutAuthenticationCredential(const AuthenticationChallenge& challenge)
-{
- ASSERT(m_currentAuthenticationChallenge);
- ASSERT(m_currentAuthenticationChallenge->authenticationClient());
-
- if (m_currentAuthenticationChallenge->identifier() != challenge.identifier())
- return;
-
- m_currentAuthenticationChallenge->authenticationClient()->receivedRequestToContinueWithoutCredential(*m_currentAuthenticationChallenge);
- m_currentAuthenticationChallenge.clear();
-}
-
-void NetworkResourceLoader::receivedAuthenticationCancellation(const AuthenticationChallenge& challenge)
-{
- ASSERT(m_currentAuthenticationChallenge);
- ASSERT(m_currentAuthenticationChallenge->authenticationClient());
-
- if (m_currentAuthenticationChallenge->identifier() != challenge.identifier())
- return;
-
- m_handle->cancel();
- m_currentAuthenticationChallenge.clear();
-
- send(Messages::WebResourceLoader::CancelResourceLoader());
- scheduleStopOnMainThread();
+ // FIXME (NetworkProcess): Tell AuthenticationManager.
}
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
#include "MessageSender.h"
#include "NetworkConnectionToWebProcess.h"
#include "SchedulableLoader.h"
-#include <WebCore/AuthenticationChallenge.h>
#include <WebCore/ResourceHandleClient.h>
#include <WebCore/ResourceLoaderOptions.h>
#include <WebCore/ResourceRequest.h>
CoreIPC::Connection* connection() const;
uint64_t destinationID() const;
- void didReceiveNetworkResourceLoaderMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
-
virtual void start();
// ResourceHandleClient methods
virtual bool shouldUseCredentialStorage(WebCore::ResourceHandle*) OVERRIDE;
virtual void didReceiveAuthenticationChallenge(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&) OVERRIDE;
virtual void didCancelAuthenticationChallenge(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&) OVERRIDE;
- virtual void receivedCancellation(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&) OVERRIDE;
#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
virtual bool canAuthenticateAgainstProtectionSpace(WebCore::ResourceHandle*, const WebCore::ProtectionSpace&) OVERRIDE;
private:
NetworkResourceLoader(const NetworkResourceLoadParameters&, NetworkConnectionToWebProcess*);
- void receivedAuthenticationCredential(const WebCore::AuthenticationChallenge&, const WebCore::Credential&);
- void receivedRequestToContinueWithoutAuthenticationCredential(const WebCore::AuthenticationChallenge&);
- void receivedAuthenticationCancellation(const WebCore::AuthenticationChallenge&);
-
void scheduleStopOnMainThread();
static void performStops(void*);
RefPtr<RemoteNetworkingContext> m_networkingContext;
RefPtr<WebCore::ResourceHandle> m_handle;
-
- OwnPtr<WebCore::AuthenticationChallenge> m_currentAuthenticationChallenge;
};
} // namespace WebKit
+++ /dev/null
-# Copyright (C) 2012 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#if ENABLE(NETWORK_PROCESS)
-
-messages -> NetworkResourceLoader LegacyReceiver {
- ReceivedAuthenticationCredential(WebCore::AuthenticationChallenge challenge, WebCore::Credential credential)
- ReceivedRequestToContinueWithoutAuthenticationCredential(WebCore::AuthenticationChallenge challenge)
- ReceivedAuthenticationCancellation(WebCore::AuthenticationChallenge challenge)
-}
-
-#endif // ENABLE(NETWORK_PROCESS)
void ArgumentCoder<AuthenticationChallenge>::encode(ArgumentEncoder& encoder, const AuthenticationChallenge& challenge)
{
- encoder << challenge.protectionSpace() << challenge.proposedCredential() << challenge.previousFailureCount() << challenge.failureResponse() << challenge.error() << challenge.identifier();
+ encoder << challenge.protectionSpace() << challenge.proposedCredential() << challenge.previousFailureCount() << challenge.failureResponse() << challenge.error();
}
bool ArgumentCoder<AuthenticationChallenge>::decode(ArgumentDecoder* decoder, AuthenticationChallenge& challenge)
if (!decoder->decode(error))
return false;
- uint64_t identifier;
- if (!decoder->decode(identifier))
- return false;
-
- challenge = AuthenticationChallenge(protectionSpace, proposedCredential, previousFailureCount, failureResponse, error, identifier);
+ challenge = AuthenticationChallenge(protectionSpace, proposedCredential, previousFailureCount, failureResponse, error);
return true;
}
5163199416289A6000E22F00 /* NetworkProcessMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ACC9341628064800342550 /* NetworkProcessMessageReceiver.cpp */; };
5163199516289A6300E22F00 /* NetworkProcessMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ACC9351628064800342550 /* NetworkProcessMessages.h */; };
516A4A5D120A2CCD00C05B7F /* WebError.h in Headers */ = {isa = PBXBuildFile; fileRef = 516A4A5B120A2CCD00C05B7F /* WebError.h */; };
- 5175944A1657080400DD771D /* NetworkResourceLoaderMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517594481657080400DD771D /* NetworkResourceLoaderMessageReceiver.cpp */; };
- 5175944B1657080400DD771D /* NetworkResourceLoaderMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 517594491657080400DD771D /* NetworkResourceLoaderMessages.h */; };
51795567162876CB00FA43B6 /* NetworkProcessMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51A8A6151627F3F9000D90E9 /* NetworkProcessMac.mm */; };
51795568162876CF00FA43B6 /* NetworkProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510CC7DF16138E2900D03ED3 /* NetworkProcess.cpp */; };
5179556A162876F300FA43B6 /* NetworkProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 510CC7E016138E2900D03ED3 /* NetworkProcess.h */; };
513A164B1630A9BF005D7D22 /* NetworkConnectionToWebProcess.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NetworkConnectionToWebProcess.messages.in; path = NetworkProcess/NetworkConnectionToWebProcess.messages.in; sourceTree = "<group>"; };
5153569A1291B1D2000749DC /* WebPageContextMenuClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageContextMenuClient.cpp; sourceTree = "<group>"; };
5153569B1291B1D2000749DC /* WebPageContextMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageContextMenuClient.h; sourceTree = "<group>"; };
- 515705521657018C00101A90 /* NetworkResourceLoader.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = NetworkResourceLoader.messages.in; path = NetworkProcess/NetworkResourceLoader.messages.in; sourceTree = "<group>"; };
51578B821209ECEF00A37C4A /* WebData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebData.h; sourceTree = "<group>"; };
5160BFE013381DF900918999 /* Logging.mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Logging.mac.mm; sourceTree = "<group>"; };
516319911628980A00E22F00 /* NetworkProcessProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NetworkProcessProxyMac.mm; path = mac/NetworkProcessProxyMac.mm; sourceTree = "<group>"; };
516A4A5B120A2CCD00C05B7F /* WebError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebError.h; sourceTree = "<group>"; };
- 517594481657080400DD771D /* NetworkResourceLoaderMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkResourceLoaderMessageReceiver.cpp; sourceTree = "<group>"; };
- 517594491657080400DD771D /* NetworkResourceLoaderMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkResourceLoaderMessages.h; sourceTree = "<group>"; };
517A33B3130B308C00F80CB5 /* WKApplicationCacheManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKApplicationCacheManager.cpp; sourceTree = "<group>"; };
517A33B4130B308C00F80CB5 /* WKApplicationCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKApplicationCacheManager.h; sourceTree = "<group>"; };
517CF0E1163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkProcessConnectionMessageReceiver.cpp; sourceTree = "<group>"; };
51A8A6171627F5BB000D90E9 /* NetworkProcess.messages.in */,
51FD18B31651FBAD00DBE1CE /* NetworkResourceLoader.cpp */,
51FD18B41651FBAD00DBE1CE /* NetworkResourceLoader.h */,
- 515705521657018C00101A90 /* NetworkResourceLoader.messages.in */,
51829DA31637C70C000953D6 /* NetworkResourceLoadScheduler.cpp */,
51829DA41637C70C000953D6 /* NetworkResourceLoadScheduler.h */,
519B4FF216A9EA970066874D /* SchedulableLoader.cpp */,
51ACC9351628064800342550 /* NetworkProcessMessages.h */,
513A163A163088F6005D7D22 /* NetworkProcessProxyMessageReceiver.cpp */,
513A163B163088F6005D7D22 /* NetworkProcessProxyMessages.h */,
- 517594481657080400DD771D /* NetworkResourceLoaderMessageReceiver.cpp */,
- 517594491657080400DD771D /* NetworkResourceLoaderMessages.h */,
1A2D8437127F65D5001EB962 /* NPObjectMessageReceiverMessageReceiver.cpp */,
1A2D8438127F65D5001EB962 /* NPObjectMessageReceiverMessages.h */,
1A8EF96C1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp */,
513A163D163088F6005D7D22 /* NetworkProcessProxyMessages.h in Headers */,
BCF4DE23168E4BD500C94AFC /* NetworkProcessSupplement.h in Headers */,
51FD18B61651FBAD00DBE1CE /* NetworkResourceLoader.h in Headers */,
- 5175944B1657080400DD771D /* NetworkResourceLoaderMessages.h in Headers */,
51CBBA10165219B6005BE8FD /* NetworkResourceLoadParameters.h in Headers */,
51829DA61637C70C000953D6 /* NetworkResourceLoadScheduler.h in Headers */,
31A2EC5614899C0900810D71 /* NotificationPermissionRequest.h in Headers */,
516319921628980A00E22F00 /* NetworkProcessProxyMac.mm in Sources */,
513A163C163088F6005D7D22 /* NetworkProcessProxyMessageReceiver.cpp in Sources */,
51FD18B51651FBAD00DBE1CE /* NetworkResourceLoader.cpp in Sources */,
- 5175944A1657080400DD771D /* NetworkResourceLoaderMessageReceiver.cpp in Sources */,
51CBBA0F165219B6005BE8FD /* NetworkResourceLoadParameters.cpp in Sources */,
51829DA51637C70C000953D6 /* NetworkResourceLoadScheduler.cpp in Sources */,
512C069016390E6900ABB911 /* NetworkResourceLoadSchedulerMac.mm in Sources */,
#include "DataReference.h"
#include "Logging.h"
-#include "NetworkConnectionToWebProcessMessages.h"
#include "NetworkProcessConnection.h"
-#include "NetworkResourceLoaderMessages.h"
#include "PlatformCertificateInfo.h"
#include "WebCoreArgumentCoders.h"
#include "WebErrors.h"
#include "WebProcess.h"
-#include <WebCore/AuthenticationChallenge.h>
+#include <WebCore/ResourceError.h>
#include <WebCore/ResourceLoader.h>
using namespace WebCore;
result = m_coreLoader->canAuthenticateAgainstProtectionSpace(protectionSpace);
}
-void WebResourceLoader::didReceiveAuthenticationChallenge(const AuthenticationChallenge& challenge)
-{
- LOG(Network, "(WebProcess) WebResourceLoader::didReceiveAuthenticationChallenge for '%s'", m_coreLoader->url().string().utf8().data());
-
- m_currentAuthenticationChallenge = adoptPtr(new AuthenticationChallenge(challenge));
- m_currentAuthenticationChallenge->setAuthenticationClient(this);
-
- m_coreLoader->didReceiveAuthenticationChallenge(*m_currentAuthenticationChallenge);
-}
-
-void WebResourceLoader::didCancelAuthenticationChallenge(const AuthenticationChallenge& challenge)
-{
- if (m_currentAuthenticationChallenge->identifier() != challenge.identifier())
- return;
-
- LOG(Network, "(WebProcess) WebResourceLoader::didCancelAuthenticationChallenge for '%s'", m_coreLoader->url().string().utf8().data());
-
- m_coreLoader->didCancelAuthenticationChallenge(*m_currentAuthenticationChallenge);
- m_currentAuthenticationChallenge.clear();
-}
-
-// WebCore::AuthenticationClient
-void WebResourceLoader::receivedCredential(const AuthenticationChallenge& challenge, const Credential& credential)
-{
- ASSERT(m_currentAuthenticationChallenge && challenge == *m_currentAuthenticationChallenge);
- send(Messages::NetworkResourceLoader::ReceivedAuthenticationCredential(challenge, credential));
-
- m_currentAuthenticationChallenge.clear();
-}
-
-void WebResourceLoader::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& challenge)
-{
- ASSERT(m_currentAuthenticationChallenge && challenge == *m_currentAuthenticationChallenge);
- send(Messages::NetworkResourceLoader::ReceivedRequestToContinueWithoutAuthenticationCredential(challenge));
-
- m_currentAuthenticationChallenge.clear();
-}
-
-void WebResourceLoader::receivedCancellation(const AuthenticationChallenge& challenge)
-{
- ASSERT(m_currentAuthenticationChallenge && challenge == *m_currentAuthenticationChallenge);
- send(Messages::NetworkResourceLoader::ReceivedAuthenticationCancellation(challenge));
-
- m_currentAuthenticationChallenge.clear();
-}
-
void WebResourceLoader::networkProcessCrashed()
{
ASSERT(m_coreLoader);
#include "Connection.h"
#include "MessageSender.h"
#include "ShareableResource.h"
-#include <WebCore/AuthenticationClient.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
}
namespace WebCore {
-class AuthenticationChallenge;
class ProtectionSpace;
class ResourceBuffer;
class ResourceError;
class PlatformCertificateInfo;
typedef uint64_t ResourceLoadIdentifier;
-class WebResourceLoader : public RefCounted<WebResourceLoader>, public CoreIPC::MessageSender<WebResourceLoader>, public WebCore::AuthenticationClient {
+class WebResourceLoader : public RefCounted<WebResourceLoader>, public CoreIPC::MessageSender<WebResourceLoader> {
public:
static PassRefPtr<WebResourceLoader> create(PassRefPtr<WebCore::ResourceLoader>);
void didReceiveWebResourceLoaderMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void didReceiveSyncWebResourceLoaderMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
- using RefCounted<WebResourceLoader>::ref;
- using RefCounted<WebResourceLoader>::deref;
-
- virtual void receivedCredential(const WebCore::AuthenticationChallenge&, const WebCore::Credential&);
- virtual void receivedRequestToContinueWithoutCredential(const WebCore::AuthenticationChallenge&);
- virtual void receivedCancellation(const WebCore::AuthenticationChallenge&);
-
void networkProcessCrashed();
private:
void didReceiveResource(const ShareableResource::Handle&, double finishTime);
void canAuthenticateAgainstProtectionSpace(const WebCore::ProtectionSpace&, bool& result);
- void didReceiveAuthenticationChallenge(const WebCore::AuthenticationChallenge&);
- void didCancelAuthenticationChallenge(const WebCore::AuthenticationChallenge&);
-
- virtual void refAuthenticationClient() { ref(); }
- virtual void derefAuthenticationClient() { deref(); }
RefPtr<WebCore::ResourceLoader> m_coreLoader;
- OwnPtr<WebCore::AuthenticationChallenge> m_currentAuthenticationChallenge;
};
} // namespace WebKit
DidFailResourceLoad(WebCore::ResourceError error)
CanAuthenticateAgainstProtectionSpace(WebCore::ProtectionSpace protectionSpace) -> (bool response)
- DidReceiveAuthenticationChallenge(WebCore::AuthenticationChallenge challenge)
- DidCancelAuthenticationChallenge(WebCore::AuthenticationChallenge challenge)
// DidReceiveResource is for when we have the entire resource data available at once, such as when the resource is cached in memory
DidReceiveResource(WebKit::ShareableResource::Handle resource, double finishTime)