Changeset 93923 in webkit
- Timestamp:
- Aug 26, 2011 4:31:55 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r93921 r93923 1 2011-08-26 Nate Chapin <japhet@chromium.org> 2 3 Move allowCredentials from ThreadableLoaderOptions down 4 to ResourceLoaderOptions. This allows us to remove 5 getShouldUseCredentialStorage() from SubresourceLoaderClient 6 and check allowCredentials in ResourceLoader. 7 https://bugs.webkit.org/show_bug.cgi?id=65330 8 9 Reviewed by Alexey Proskuryakov. 10 11 No new tests, refractor only. 12 13 * loader/DocumentThreadableLoader.cpp: 14 * loader/DocumentThreadableLoader.h: 15 * loader/MainResourceLoader.cpp: 16 * loader/NetscapePlugInStreamLoader.cpp: 17 * loader/ResourceLoadScheduler.h: 18 * loader/ResourceLoader.cpp: 19 (WebCore::ResourceLoader::shouldUseCredentialStorage): Check 20 m_options.allowCredentials instead of calling a client. 21 * loader/ResourceLoaderOptions.h: 22 * loader/SubresourceLoader.cpp: 23 * loader/SubresourceLoader.h: 24 * loader/SubresourceLoaderClient.h: 25 * loader/ThreadableLoader.h: 26 * loader/cache/CachedResourceRequest.cpp: 27 1 28 2011-08-26 Ojan Vafai <ojan@chromium.org> 2 29 -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r93886 r93923 289 289 } 290 290 291 bool DocumentThreadableLoader::getShouldUseCredentialStorage(SubresourceLoader* loader, bool& shouldUseCredentialStorage)292 {293 ASSERT_UNUSED(loader, loader == m_loader || !m_loader);294 295 if (m_options.allowCredentials == DoNotAllowStoredCredentials) {296 shouldUseCredentialStorage = false;297 return true;298 }299 300 return false; // Only FrameLoaderClient can ultimately permit credential use.301 }302 303 291 void DocumentThreadableLoader::didReceiveAuthenticationChallenge(SubresourceLoader* loader, const AuthenticationChallenge& challenge) 304 292 { -
trunk/Source/WebCore/loader/DocumentThreadableLoader.h
r92691 r93923 83 83 virtual void didFail(SubresourceLoader*, const ResourceError&); 84 84 85 virtual bool getShouldUseCredentialStorage(SubresourceLoader*, bool& shouldUseCredentialStorage);86 85 virtual void didReceiveAuthenticationChallenge(SubresourceLoader*, const AuthenticationChallenge&); 87 86 -
trunk/Source/WebCore/loader/MainResourceLoader.cpp
r93886 r93923 61 61 62 62 MainResourceLoader::MainResourceLoader(Frame* frame) 63 : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData ))63 : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials)) 64 64 , m_dataLoadTimer(this, &MainResourceLoader::handleDataLoadNow) 65 65 , m_loadingMultipartContent(false) -
trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp
r93886 r93923 37 37 38 38 NetscapePlugInStreamLoader::NetscapePlugInStreamLoader(Frame* frame, NetscapePlugInStreamLoaderClient* client) 39 : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, DoNotBufferData ))39 : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials)) 40 40 , m_client(client) 41 41 { -
trunk/Source/WebCore/loader/ResourceLoadScheduler.h
r93886 r93923 52 52 friend ResourceLoadScheduler* resourceLoadScheduler(); 53 53 54 PassRefPtr<SubresourceLoader> scheduleSubresourceLoad(Frame*, SubresourceLoaderClient*, const ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityLow, SecurityCheckPolicy = DoSecurityCheck, const ResourceLoaderOptions& = ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData ));54 PassRefPtr<SubresourceLoader> scheduleSubresourceLoad(Frame*, SubresourceLoaderClient*, const ResourceRequest&, ResourceLoadPriority = ResourceLoadPriorityLow, SecurityCheckPolicy = DoSecurityCheck, const ResourceLoaderOptions& = ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials)); 55 55 PassRefPtr<NetscapePlugInStreamLoader> schedulePluginStreamLoad(Frame*, NetscapePlugInStreamLoaderClient*, const ResourceRequest&); 56 56 void addMainResourceLoad(ResourceLoader*); -
trunk/Source/WebCore/loader/ResourceLoader.cpp
r93886 r93923 518 518 if (!fastMallocSize(documentLoader()->frame())) 519 519 CRASH(); 520 521 if (m_options.allowCredentials == DoNotAllowStoredCredentials) 522 return false; 523 520 524 RefPtr<ResourceLoader> protector(this); 521 525 return frameLoader()->client()->shouldUseCredentialStorage(documentLoader(), identifier()); -
trunk/Source/WebCore/loader/ResourceLoaderOptions.h
r93886 r93923 32 32 #define ResourceLoaderOptions_h 33 33 34 #include "ResourceHandle.h" 35 34 36 namespace WebCore { 35 37 … … 50 52 51 53 struct ResourceLoaderOptions { 52 ResourceLoaderOptions() : sendLoadCallbacks(DoNotSendCallbacks), sniffContent(DoNotSniffContent), shouldBufferData(BufferData) { }53 ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacksArg, ContentSniffingPolicy sniffContentArg, DataBufferingPolicy shouldBufferDataArg ) : sendLoadCallbacks(sendLoadCallbacksArg), sniffContent(sniffContentArg), shouldBufferData(shouldBufferDataArg) { }54 ResourceLoaderOptions() : sendLoadCallbacks(DoNotSendCallbacks), sniffContent(DoNotSniffContent), shouldBufferData(BufferData), allowCredentials(DoNotAllowStoredCredentials) { } 55 ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacksArg, ContentSniffingPolicy sniffContentArg, DataBufferingPolicy shouldBufferDataArg, StoredCredentials allowCredentialsArg) : sendLoadCallbacks(sendLoadCallbacksArg), sniffContent(sniffContentArg), shouldBufferData(shouldBufferDataArg), allowCredentials(allowCredentialsArg) { } 54 56 SendCallbackPolicy sendLoadCallbacks; 55 57 ContentSniffingPolicy sniffContent; 56 58 DataBufferingPolicy shouldBufferData; 59 StoredCredentials allowCredentials; // Whether HTTP credentials and cookies are sent with the request. 57 60 }; 58 61 -
trunk/Source/WebCore/loader/SubresourceLoader.cpp
r93811 r93923 235 235 } 236 236 237 bool SubresourceLoader::shouldUseCredentialStorage()238 {239 RefPtr<SubresourceLoader> protect(this);240 241 bool shouldUse;242 if (m_client && m_client->getShouldUseCredentialStorage(this, shouldUse))243 return shouldUse;244 245 return ResourceLoader::shouldUseCredentialStorage();246 }247 248 237 void SubresourceLoader::didReceiveAuthenticationChallenge(const AuthenticationChallenge& challenge) 249 238 { -
trunk/Source/WebCore/loader/SubresourceLoader.h
r93811 r93923 57 57 virtual void didFinishLoading(double finishTime); 58 58 virtual void didFail(const ResourceError&); 59 virtual bool shouldUseCredentialStorage();60 59 virtual void didReceiveAuthenticationChallenge(const AuthenticationChallenge&); 61 60 virtual void willCancel(const ResourceError&); -
trunk/Source/WebCore/loader/SubresourceLoaderClient.h
r92691 r93923 52 52 virtual void didFail(SubresourceLoader*, const ResourceError&) { } 53 53 54 virtual bool getShouldUseCredentialStorage(SubresourceLoader*, bool& /*shouldUseCredentialStorage*/) { return false; }55 54 virtual void didReceiveAuthenticationChallenge(SubresourceLoader*, const AuthenticationChallenge&) { } 56 55 }; -
trunk/Source/WebCore/loader/ThreadableLoader.h
r93886 r93923 61 61 62 62 struct ThreadableLoaderOptions : public ResourceLoaderOptions { 63 ThreadableLoaderOptions() : allowCredentials(DoNotAllowStoredCredentials), preflightPolicy(ConsiderPreflight), crossOriginRequestPolicy(DenyCrossOriginRequests) { } 64 StoredCredentials allowCredentials; // Whether HTTP credentials and cookies are sent with the request. 63 ThreadableLoaderOptions() : preflightPolicy(ConsiderPreflight), crossOriginRequestPolicy(DenyCrossOriginRequests) { } 65 64 PreflightPolicy preflightPolicy; // If AccessControl is used, how to determine if a preflight is needed. 66 65 CrossOriginRequestPolicy crossOriginRequestPolicy; -
trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp
r93886 r93923 126 126 127 127 RefPtr<SubresourceLoader> loader = resourceLoadScheduler()->scheduleSubresourceLoad(cachedResourceLoader->document()->frame(), request.get(), resourceRequest, priority, securityCheck, 128 ResourceLoaderOptions(sendResourceLoadCallbacks ? SendCallbacks : DoNotSendCallbacks, SniffContent, BufferData ));128 ResourceLoaderOptions(sendResourceLoadCallbacks ? SendCallbacks : DoNotSendCallbacks, SniffContent, BufferData, AllowStoredCredentials)); 129 129 if (!loader || loader->reachedTerminalState()) { 130 130 // FIXME: What if resources in other frames were waiting for this revalidation?
Note: See TracChangeset
for help on using the changeset viewer.