Diff
Modified: trunk/Source/WebCore/ChangeLog (87300 => 87301)
--- trunk/Source/WebCore/ChangeLog 2011-05-25 16:48:03 UTC (rev 87300)
+++ trunk/Source/WebCore/ChangeLog 2011-05-25 16:50:53 UTC (rev 87301)
@@ -1,3 +1,42 @@
+2011-05-25 Sheriff Bot <webkit.review....@gmail.com>
+
+ Unreviewed, rolling out r87229.
+ http://trac.webkit.org/changeset/87229
+ https://bugs.webkit.org/show_bug.cgi?id=61445
+
+ Lots of tests crashing in
+ CFNetwork!URLResponse::createFilenameFromResponseHeaders on
+ Windows XP (Requested by aroben on #webkit).
+
+ * platform/network/ResourceResponseBase.cpp:
+ (WebCore::ResourceResponseBase::adopt):
+ (WebCore::ResourceResponseBase::suggestedFilename):
+ (WebCore::ResourceResponseBase::setSuggestedFilename):
+ (WebCore::ResourceResponseBase::httpStatusText):
+ (WebCore::ResourceResponseBase::setHTTPStatusText):
+ (WebCore::ResourceResponseBase::httpHeaderField):
+ (WebCore::ResourceResponseBase::setHTTPHeaderField):
+ (WebCore::ResourceResponseBase::httpHeaderFields):
+ (WebCore::ResourceResponseBase::isAttachment):
+ (WebCore::ResourceResponseBase::setLastModifiedDate):
+ (WebCore::ResourceResponseBase::lastModifiedDate):
+ (WebCore::ResourceResponseBase::wasCached):
+ (WebCore::ResourceResponseBase::connectionReused):
+ (WebCore::ResourceResponseBase::setConnectionReused):
+ (WebCore::ResourceResponseBase::connectionID):
+ (WebCore::ResourceResponseBase::setConnectionID):
+ (WebCore::ResourceResponseBase::resourceLoadTiming):
+ (WebCore::ResourceResponseBase::setResourceLoadTiming):
+ (WebCore::ResourceResponseBase::resourceLoadInfo):
+ (WebCore::ResourceResponseBase::setResourceLoadInfo):
+ * platform/network/ResourceResponseBase.h:
+ * platform/network/cf/ResourceResponse.h:
+ (WebCore::ResourceResponse::ResourceResponse):
+ * platform/network/cf/ResourceResponseCFNet.cpp:
+ (WebCore::ResourceResponse::platformLazyInit):
+ * platform/network/mac/ResourceResponseMac.mm:
+ (WebCore::ResourceResponse::platformLazyInit):
+
2011-05-25 Igor Oliveira <igor.olive...@openbossa.org>
Reviewed by Antonio Gomes.
Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp (87300 => 87301)
--- trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp 2011-05-25 16:48:03 UTC (rev 87300)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp 2011-05-25 16:50:53 UTC (rev 87301)
@@ -108,7 +108,7 @@
response->setHTTPStatusCode(data->m_httpStatusCode);
response->setHTTPStatusText(data->m_httpStatusText);
- response->lazyInit(CommonAndUncommonFields);
+ response->lazyInit(AllFields);
response->m_httpHeaderFields.adopt(data->m_httpHeaders.release());
response->setLastModifiedDate(data->m_lastModifiedDate);
response->setResourceLoadTiming(data->m_resourceLoadTiming.release());
@@ -205,14 +205,14 @@
// FIXME should compute this on the fly
const String& ResourceResponseBase::suggestedFilename() const
{
- lazyInit(AllFields);
+ lazyInit(CommonFieldsOnly);
return m_suggestedFilename;
}
void ResourceResponseBase::setSuggestedFilename(const String& suggestedName)
{
- lazyInit(AllFields);
+ lazyInit(CommonFieldsOnly);
m_isNull = false;
m_suggestedFilename = suggestedName;
@@ -234,14 +234,14 @@
const String& ResourceResponseBase::httpStatusText() const
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
return m_httpStatusText;
}
void ResourceResponseBase::setHTTPStatusText(const String& statusText)
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
m_httpStatusText = statusText;
}
@@ -255,7 +255,7 @@
if (!value.isEmpty())
return value;
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
return m_httpHeaderFields.get(name);
}
@@ -269,14 +269,14 @@
if (!value.isEmpty())
return value;
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
return m_httpHeaderFields.get(name);
}
void ResourceResponseBase::setHTTPHeaderField(const AtomicString& name, const String& value)
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
DEFINE_STATIC_LOCAL(const AtomicString, ageHeader, ("age"));
DEFINE_STATIC_LOCAL(const AtomicString, cacheControlHeader, ("cache-control"));
@@ -300,7 +300,7 @@
const HTTPHeaderMap& ResourceResponseBase::httpHeaderFields() const
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
return m_httpHeaderFields;
}
@@ -464,7 +464,7 @@
bool ResourceResponseBase::isAttachment() const
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
DEFINE_STATIC_LOCAL(const AtomicString, headerName, ("content-disposition"));
String value = m_httpHeaderFields.get(headerName);
@@ -478,21 +478,21 @@
void ResourceResponseBase::setLastModifiedDate(time_t lastModifiedDate)
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
m_lastModifiedDate = lastModifiedDate;
}
time_t ResourceResponseBase::lastModifiedDate() const
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
return m_lastModifiedDate;
}
bool ResourceResponseBase::wasCached() const
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
return m_wasCached;
}
@@ -504,56 +504,56 @@
bool ResourceResponseBase::connectionReused() const
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
return m_connectionReused;
}
void ResourceResponseBase::setConnectionReused(bool connectionReused)
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
m_connectionReused = connectionReused;
}
unsigned ResourceResponseBase::connectionID() const
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
return m_connectionID;
}
void ResourceResponseBase::setConnectionID(unsigned connectionID)
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
m_connectionID = connectionID;
}
ResourceLoadTiming* ResourceResponseBase::resourceLoadTiming() const
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
return m_resourceLoadTiming.get();
}
void ResourceResponseBase::setResourceLoadTiming(PassRefPtr<ResourceLoadTiming> resourceLoadTiming)
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
m_resourceLoadTiming = resourceLoadTiming;
}
PassRefPtr<ResourceLoadInfo> ResourceResponseBase::resourceLoadInfo() const
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
return m_resourceLoadInfo.get();
}
void ResourceResponseBase::setResourceLoadInfo(PassRefPtr<ResourceLoadInfo> loadInfo)
{
- lazyInit(CommonAndUncommonFields);
+ lazyInit(AllFields);
m_resourceLoadInfo = loadInfo;
}
Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.h (87300 => 87301)
--- trunk/Source/WebCore/platform/network/ResourceResponseBase.h 2011-05-25 16:48:03 UTC (rev 87300)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.h 2011-05-25 16:50:53 UTC (rev 87301)
@@ -132,7 +132,6 @@
enum InitLevel {
Uninitialized,
CommonFieldsOnly,
- CommonAndUncommonFields,
AllFields
};
Modified: trunk/Source/WebCore/platform/network/cf/ResourceResponse.h (87300 => 87301)
--- trunk/Source/WebCore/platform/network/cf/ResourceResponse.h 2011-05-25 16:48:03 UTC (rev 87300)
+++ trunk/Source/WebCore/platform/network/cf/ResourceResponse.h 2011-05-25 16:50:53 UTC (rev 87301)
@@ -44,7 +44,7 @@
class ResourceResponse : public ResourceResponseBase {
public:
ResourceResponse()
- : m_initLevel(CommonAndUncommonFields)
+ : m_initLevel(AllFields)
{
}
@@ -66,7 +66,7 @@
ResourceResponse(const KURL& url, const String& mimeType, long long expectedLength, const String& textEncodingName, const String& filename)
: ResourceResponseBase(url, mimeType, expectedLength, textEncodingName, filename)
- , m_initLevel(CommonAndUncommonFields)
+ , m_initLevel(AllFields)
{
}
Modified: trunk/Source/WebCore/platform/network/cf/ResourceResponseCFNet.cpp (87300 => 87301)
--- trunk/Source/WebCore/platform/network/cf/ResourceResponseCFNet.cpp 2011-05-25 16:48:03 UTC (rev 87300)
+++ trunk/Source/WebCore/platform/network/cf/ResourceResponseCFNet.cpp 2011-05-25 16:50:53 UTC (rev 87301)
@@ -43,7 +43,7 @@
namespace WebCore {
static CFStringRef const commonHeaderFields[] = {
- CFSTR("Age"), CFSTR("Cache-Control"), CFSTR("Content-Type"), CFSTR("Date"), CFSTR("Etag"), CFSTR("Expires"), CFSTR("Last-Modified"), CFSTR("Pragma")
+ CFSTR("Age"), CFSTR("Cache-Control"), CFSTR("Date"), CFSTR("Etag"), CFSTR("Expires"), CFSTR("Last-Modified"), CFSTR("Pragma")
};
static const int numCommonHeaderFields = sizeof(commonHeaderFields) / sizeof(CFStringRef);
@@ -98,6 +98,9 @@
m_lastModifiedDate = toTimeT(CFURLResponseGetLastModifiedDate(m_cfResponse.get()));
+ RetainPtr<CFStringRef> suggestedFilename(AdoptCF, CFURLResponseCopySuggestedFilename(m_cfResponse.get()));
+ m_suggestedFilename = suggestedFilename.get();
+
CFHTTPMessageRef httpResponse = CFURLResponseGetHTTPResponse(m_cfResponse.get());
if (httpResponse) {
m_httpStatusCode = CFHTTPMessageGetResponseStatusCode(httpResponse);
@@ -113,7 +116,7 @@
m_httpStatusCode = 0;
}
- if (m_initLevel < CommonAndUncommonFields && initLevel >= CommonAndUncommonFields) {
+ if (m_initLevel < AllFields && initLevel >= AllFields) {
CFHTTPMessageRef httpResponse = CFURLResponseGetHTTPResponse(m_cfResponse.get());
if (httpResponse) {
RetainPtr<CFStringRef> statusLine(AdoptCF, CFHTTPMessageCopyResponseStatusLine(httpResponse));
@@ -128,11 +131,6 @@
m_httpHeaderFields.set((CFStringRef)keys[i], (CFStringRef)values[i]);
}
}
-
- if (m_initLevel < AllFields && initLevel >= AllFields) {
- RetainPtr<CFStringRef> suggestedFilename(AdoptCF, CFURLResponseCopySuggestedFilename(m_cfResponse.get()));
- m_suggestedFilename = suggestedFilename.get();
- }
m_initLevel = initLevel;
}
Modified: trunk/Source/WebCore/platform/network/mac/ResourceResponseMac.mm (87300 => 87301)
--- trunk/Source/WebCore/platform/network/mac/ResourceResponseMac.mm 2011-05-25 16:48:03 UTC (rev 87300)
+++ trunk/Source/WebCore/platform/network/mac/ResourceResponseMac.mm 2011-05-25 16:50:53 UTC (rev 87301)
@@ -44,7 +44,7 @@
namespace WebCore {
static NSString* const commonHeaderFields[] = {
- @"Age", @"Cache-Control", @"Content-Type", @"Date", @"Etag", @"Expires", @"Last-Modified", @"Pragma"
+ @"Age", @"Cache-Control", @"Date", @"Etag", @"Expires", @"Last-Modified", @"Pragma"
};
static const int numCommonHeaderFields = sizeof(commonHeaderFields) / sizeof(AtomicString*);
@@ -88,6 +88,8 @@
if (textEncodingNameLength >= 2 && m_textEncodingName[0U] == '"' && m_textEncodingName[textEncodingNameLength - 1] == '"')
m_textEncodingName = m_textEncodingName.substring(1, textEncodingNameLength - 2);
+ m_suggestedFilename = [m_nsResponse.get() suggestedFilename];
+
if ([m_nsResponse.get() isKindOfClass:[NSHTTPURLResponse class]]) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)m_nsResponse.get();
@@ -105,29 +107,24 @@
[pool drain];
}
- if (m_initLevel < CommonAndUncommonFields && initLevel >= CommonAndUncommonFields) {
- if ([m_nsResponse.get() isKindOfClass:[NSHTTPURLResponse class]]) {
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ if (m_initLevel < AllFields && initLevel >= AllFields && [m_nsResponse.get() isKindOfClass:[NSHTTPURLResponse class]]) {
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)m_nsResponse.get();
+ NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)m_nsResponse.get();
- RetainPtr<NSString> httpStatusLine(AdoptNS, wkCopyNSURLResponseStatusLine(m_nsResponse.get()));
- if (httpStatusLine)
- m_httpStatusText = extractReasonPhraseFromHTTPStatusLine(httpStatusLine.get());
- else
- m_httpStatusText = "OK";
+ RetainPtr<NSString> httpStatusLine(AdoptNS, wkCopyNSURLResponseStatusLine(m_nsResponse.get()));
+ if (httpStatusLine)
+ m_httpStatusText = extractReasonPhraseFromHTTPStatusLine(httpStatusLine.get());
+ else
+ m_httpStatusText = "OK";
- NSDictionary *headers = [httpResponse allHeaderFields];
- NSEnumerator *e = [headers keyEnumerator];
- while (NSString *name = [e nextObject])
- m_httpHeaderFields.set(name, [headers objectForKey:name]);
-
- [pool drain];
- }
+ NSDictionary *headers = [httpResponse allHeaderFields];
+ NSEnumerator *e = [headers keyEnumerator];
+ while (NSString *name = [e nextObject])
+ m_httpHeaderFields.set(name, [headers objectForKey:name]);
+
+ [pool drain];
}
-
- if (m_initLevel < AllFields && initLevel >= AllFields)
- m_suggestedFilename = [m_nsResponse.get() suggestedFilename];
m_initLevel = initLevel;
}