Changeset 79110 in webkit
- Timestamp:
- Feb 19, 2011 12:39:38 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r79107 r79110 1 2011-02-19 Bill Budge <bbudge@chromium.org> 2 3 Reviewed by David Levin. 4 5 ThreadableLoaderClient needs willSendRequest method 6 https://bugs.webkit.org/show_bug.cgi?id=54688 7 8 No new tests. Exposes no new functionality 9 10 * WebCore.gypi: 11 * loader/DocumentThreadableLoader.cpp: 12 (WebCore::DocumentThreadableLoader::willSendRequest): 13 (WebCore::DocumentThreadableLoader::didReceiveData): 14 (WebCore::DocumentThreadableLoader::didReceiveCachedMetadata): 15 * loader/DocumentThreadableLoaderClient.h: Added. 16 (WebCore::DocumentThreadableLoaderClient::isDocumentThreadableLoaderClient): 17 (WebCore::DocumentThreadableLoaderClient::willSendRequest): 18 * loader/ThreadableLoaderClient.h: 19 (WebCore::ThreadableLoaderClient::isDocumentThreadableLoaderClient): 20 1 21 2011-02-19 Charlie Reis <creis@chromium.org> 2 22 -
trunk/Source/WebCore/WebCore.gypi
r79043 r79110 2161 2161 'loader/DocumentThreadableLoader.cpp', 2162 2162 'loader/DocumentThreadableLoader.h', 2163 'loader/DocumentThreadableLoaderClient.h', 2163 2164 'loader/DocumentWriter.cpp', 2164 2165 'loader/DocumentWriter.h', -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r78782 r79110 1 1 /* 2 * Copyright (C) 20 09Google Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 36 36 #include "CrossOriginPreflightResultCache.h" 37 37 #include "Document.h" 38 #include "DocumentThreadableLoaderClient.h" 38 39 #include "Frame.h" 39 40 #include "FrameLoader.h" … … 173 174 } 174 175 175 void DocumentThreadableLoader::willSendRequest(SubresourceLoader* loader, ResourceRequest& request, const ResourceResponse& )176 void DocumentThreadableLoader::willSendRequest(SubresourceLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse) 176 177 { 177 178 ASSERT(m_client); … … 182 183 m_client->didFailRedirectCheck(); 183 184 request = ResourceRequest(); 185 } else { 186 if (m_client->isDocumentThreadableLoaderClient()) 187 static_cast<DocumentThreadableLoaderClient*>(m_client)->willSendRequest(request, redirectResponse); 184 188 } 185 189 } … … 231 235 ASSERT_UNUSED(loader, loader == m_loader); 232 236 233 // Ignore response body of preflight requests.237 // Preflight data should be invisible to clients. 234 238 if (m_actualRequest) 235 239 return; … … 243 247 ASSERT_UNUSED(loader, loader == m_loader); 244 248 245 // Ignore response body of preflight requests. 246 if (!m_actualRequest) 247 m_client->didReceiveCachedMetadata(data, lengthReceived); 249 // Preflight data should be invisible to clients. 250 if (m_actualRequest) 251 return; 252 253 m_client->didReceiveCachedMetadata(data, lengthReceived); 248 254 } 249 255 -
trunk/Source/WebCore/loader/DocumentThreadableLoaderClient.h
r79108 r79110 1 1 /* 2 * Copyright (C) 20 09Google Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 */ 30 30 31 #ifndef ThreadableLoaderClient_h32 #define ThreadableLoaderClient_h31 #ifndef DocumentThreadableLoaderClient_h 32 #define DocumentThreadableLoaderClient_h 33 33 34 #include "ThreadableLoaderClient.h" 34 35 35 36 namespace WebCore { 36 37 37 class ResourceError;38 38 class ResourceRequest; 39 class ResourceResponse; 39 40 40 class ThreadableLoaderClient { 41 WTF_MAKE_NONCOPYABLE(ThreadableLoaderClient); WTF_MAKE_FAST_ALLOCATED; 42 public: 43 virtual void didSendData(unsigned long long /*bytesSent*/, unsigned long long /*totalBytesToBeSent*/) { } 41 class DocumentThreadableLoaderClient : public ThreadableLoaderClient { 42 WTF_MAKE_NONCOPYABLE(DocumentThreadableLoaderClient); 43 WTF_MAKE_FAST_ALLOCATED; 44 public: 45 virtual bool isDocumentThreadableLoaderClient() { return true; } 44 46 45 virtual void didReceiveResponse(const ResourceResponse&) { } 46 virtual void didReceiveData(const char*, int /*dataLength*/) { } 47 virtual void didReceiveCachedMetadata(const char*, int /*dataLength*/) { } 48 virtual void didFinishLoading(unsigned long /*identifier*/, double /*finishTime*/) { } 49 virtual void didFail(const ResourceError&) { } 50 virtual void didFailRedirectCheck() { } 51 52 virtual void didReceiveAuthenticationCancellation(const ResourceResponse&) { } 53 54 protected: 55 ThreadableLoaderClient() { } 56 virtual ~ThreadableLoaderClient() { } 57 }; 47 virtual void willSendRequest(ResourceRequest& /*newRequest*/, const ResourceResponse& /*redirectResponse*/) { } 48 }; 58 49 59 50 } // namespace WebCore 60 51 61 #endif // ThreadableLoaderClient_h52 #endif // DocumentThreadableLoaderClient_h -
trunk/Source/WebCore/loader/ThreadableLoaderClient.h
r78782 r79110 1 1 /* 2 * Copyright (C) 20 09Google Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 52 52 virtual void didReceiveAuthenticationCancellation(const ResourceResponse&) { } 53 53 54 virtual bool isDocumentThreadableLoaderClient() { return false; } 55 54 56 protected: 55 57 ThreadableLoaderClient() { }
Note: See TracChangeset
for help on using the changeset viewer.