<rdar://problem/
4943985>
REGRESSION: Dragging standalone images to Finder fails to download the image file
Set the data and response on the image resource. Also, since this is platform-independent we don't need to do it in
ImageDocumentMac.mm
* loader/ImageDocument.cpp:
(WebCore::ImageTokenizer::finish):
* loader/mac/ImageDocumentMac.h:
* loader/mac/ImageDocumentMac.mm:
(WebCore::finishImageLoad):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19667
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-02-16 Anders Carlsson <acarlsson@apple.com>
+
+ Reviewed by Adam.
+
+ <rdar://problem/4943985>
+ REGRESSION: Dragging standalone images to Finder fails to download the image file
+
+ Set the data and response on the image resource. Also, since this is platform-independent we don't need to do it in
+ ImageDocumentMac.mm
+
+ * loader/ImageDocument.cpp:
+ (WebCore::ImageTokenizer::finish):
+ * loader/mac/ImageDocumentMac.h:
+ * loader/mac/ImageDocumentMac.mm:
+ (WebCore::finishImageLoad):
+
2007-02-16 David Harrison <harrison@apple.com>
Reviewed by Adam.
#include "ImageDocument.h"
#include "CachedImage.h"
+#include "DocumentLoader.h"
#include "Element.h"
+#include "Frame.h"
+#include "FrameLoader.h"
#include "HTMLImageElement.h"
#include "HTMLNames.h"
#include "SegmentedString.h"
cachedImage->data(buffer, true);
cachedImage->finish();
+ cachedImage->setAllData(m_doc->frame()->loader()->mainResourceData());
+ cachedImage->setResponse(m_doc->frame()->loader()->documentLoader()->response());
+
// FIXME: Need code to set the title for platforms other than Mac OS X.
#if PLATFORM(MAC)
- finishImageLoad(m_doc, cachedImage, buffer.data(), buffer.size());
+ finishImageLoad(m_doc, cachedImage);
#endif
}
class CachedImage;
class Document;
- void finishImageLoad(Document*, CachedImage*, const void* imageData, size_t imageDataSize);
+ void finishImageLoad(Document*, CachedImage*);
}
namespace WebCore {
-void finishImageLoad(Document* document, CachedImage* image, const void* imageData, size_t imageDataSize)
+void finishImageLoad(Document* document, CachedImage* image)
{
- // FIXME: This is terrible! Makes an extra copy of the image data!
- // Can't we get the NSData from NSURLConnection?
- // Why is this different from image subresources?
- RefPtr<SharedBuffer> buffer = new SharedBuffer(reinterpret_cast<const char*>(imageData), imageDataSize);
-
Frame* frame = document->frame();
const ResourceResponse& response = frame->loader()->documentLoader()->response();