Changeset 57208 in webkit
- Timestamp:
- Apr 7, 2010 7:14:27 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57207 r57208 1 2010-04-07 Dawit Alemayehu <adawit@kde.org> 2 3 Reviewed by Simon Hausmann. 4 5 https://bugs.webkit.org/show_bug.cgi?id=36827 6 7 Replaced the 'shouldTreatAsAttachment' function with a more generic 8 function that returns the content disposition type. 9 10 See comments 39-42 in https://bugs.webkit.org/show_bug.cgi?id=36395 11 12 * platform/network/HTTPParsers.cpp: 13 (WebCore::contentDispositionType): 14 * platform/network/HTTPParsers.h: 15 (WebCore::): 16 1 17 2010-04-07 Vitaly Repeshko <vitalyr@chromium.org> 2 18 -
trunk/WebCore/platform/network/HTTPParsers.cpp
r56825 r57208 73 73 } 74 74 75 bool shouldTreatAsAttachment(const ResourceResponseBase& response) 76 { 77 const String& contentDisposition = response.httpHeaderField("Content-Disposition"); 78 75 ContentDispositionType contentDispositionType(const String& contentDisposition) 76 { 79 77 if (contentDisposition.isEmpty()) 80 return false;78 return ContentDispositionNone; 81 79 82 80 // Some broken sites just send … … 84 82 // screen those out here. 85 83 if (contentDisposition.startsWith(";")) 86 return false;84 return ContentDispositionNone; 87 85 88 86 if (contentDisposition.startsWith("inline", false)) 89 return false;87 return ContentDispositionInline; 90 88 91 89 // Some broken sites just send … … 93 91 // without a disposition token... screen those out. 94 92 if (contentDisposition.startsWith("filename", false)) 95 return false;93 return ContentDispositionNone; 96 94 97 95 // Also in use is Content-Disposition: name="file" 98 96 if (contentDisposition.startsWith("name", false)) 99 return false;97 return ContentDispositionNone; 100 98 101 99 // We have a content-disposition of "attachment" or unknown. 102 100 // RFC 2183, section 2.8 says that an unknown disposition 103 101 // value should be treated as "attachment" 104 return true;102 return ContentDispositionAttachment; 105 103 } 106 104 -
trunk/WebCore/platform/network/HTTPParsers.h
r56750 r57208 42 42 }; 43 43 44 typedef enum { 45 ContentDispositionNone, 46 ContentDispositionInline, 47 ContentDispositionAttachment, 48 ContentDispositionOther 49 } ContentDispositionType; 44 50 45 bool shouldTreatAsAttachment(const ResourceResponseBase& response);51 ContentDispositionType contentDispositionType(const String&); 46 52 bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& delay, String& url); 47 53 double parseDate(const String&); -
trunk/WebKit/chromium/ChangeLog
r57197 r57208 1 2010-04-07 Dawit Alemayehu <adawit@kde.org> 2 3 Reviewed by Simon Hausmann. 4 5 https://bugs.webkit.org/show_bug.cgi?id=36827 6 7 Updated the WebCore::shouldTreatAsAttachement function call with the 8 new more generic replacement WebCore::contentDispositionType. 9 10 See comments 39-42 in https://bugs.webkit.org/show_bug.cgi?id=36395 11 12 * src/FrameLoaderClientImpl.cpp: 13 (WebKit::FrameLoaderClientImpl::dispatchDecidePolicyForMIMEType): 14 1 15 2010-04-07 Jochen Eisinger <jochen@chromium.org> 2 16 -
trunk/WebKit/chromium/src/FrameLoaderClientImpl.cpp
r56849 r57208 844 844 // The server does not want us to replace the page contents. 845 845 action = PolicyIgnore; 846 } else if (WebCore:: shouldTreatAsAttachment(response)) {846 } else if (WebCore::contentDispositionType(response.httpHeaderField("Content-Disposition")) == WebCore::ContentDispositionAttachment) { 847 847 // The server wants us to download instead of replacing the page contents. 848 848 // Downloading is handled by the embedder, but we still get the initial -
trunk/WebKit/qt/ChangeLog
r57202 r57208 1 2010-04-07 Dawit Alemayehu <adawit@kde.org> 2 3 Reviewed by Simon Hausmann. 4 5 https://bugs.webkit.org/show_bug.cgi?id=36827 6 7 Updated the WebCore::shouldTreatAsAttachement function call with the 8 new more generic replacement WebCore::contentDispositionType. 9 10 See comments 39-42 in https://bugs.webkit.org/show_bug.cgi?id=36395 11 12 * WebCoreSupport/FrameLoaderClientQt.cpp: 13 (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForMIMEType): 14 1 15 2010-04-07 Andreas Kling <andreas.kling@nokia.com> 2 16 -
trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r57202 r57208 970 970 { 971 971 // we need to call directly here 972 if (WebCore::shouldTreatAsAttachment(m_frame->loader()->activeDocumentLoader()->response())) 973 callPolicyFunction(function, PolicyDownload); 972 const ResourceResponse& response = m_frame->loader()->activeDocumentLoader()->response(); 973 if (WebCore::contentDispositionType(response.httpHeaderField("Content-Disposition")) == WebCore::ContentDispositionAttachment) 974 callPolicyFunction(function, PolicyDownload); 974 975 else if (canShowMIMEType(MIMEType)) 975 976 callPolicyFunction(function, PolicyUse);
Note: See TracChangeset
for help on using the changeset viewer.