summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/chromium/PasteboardChromium.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/chromium/PasteboardChromium.cpp')
-rw-r--r--WebCore/platform/chromium/PasteboardChromium.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/WebCore/platform/chromium/PasteboardChromium.cpp b/WebCore/platform/chromium/PasteboardChromium.cpp
index e7b2203..9b32bae 100644
--- a/WebCore/platform/chromium/PasteboardChromium.cpp
+++ b/WebCore/platform/chromium/PasteboardChromium.cpp
@@ -98,6 +98,15 @@ void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame)
void Pasteboard::writeImage(Node* node, const KURL&, const String& title)
{
+ ASSERT(node);
+ ASSERT(node->renderer());
+ ASSERT(node->renderer()->isImage());
+ RenderImage* renderer = static_cast<RenderImage*>(node->renderer());
+ CachedImage* cachedImage = static_cast<CachedImage*>(renderer->cachedImage());
+ ASSERT(cachedImage);
+ Image* image = cachedImage->image();
+ ASSERT(image);
+
// If the image is wrapped in a link, |url| points to the target of the
// link. This isn't useful to us, so get the actual image URL.
AtomicString urlString;
@@ -113,16 +122,6 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String& title)
}
KURL url = urlString.isEmpty() ? KURL() : node->document()->completeURL(parseURL(urlString));
- ASSERT(node);
- ASSERT(node->renderer());
- ASSERT(node->renderer()->isImage());
-
- RenderImage* renderer = static_cast<RenderImage*>(node->renderer());
- CachedImage* cachedImage = static_cast<CachedImage*>(renderer->cachedImage());
- ASSERT(cachedImage);
- Image* image = cachedImage->image();
- ASSERT(image);
-
NativeImageSkia* bitmap = 0;
#if !PLATFORM(CG)
bitmap = image->nativeImageForCurrentFrame();