OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 if (image->cachedImage() && !image->cachedImage()->errorOccurred()) | 274 if (image->cachedImage() && !image->cachedImage()->errorOccurred()) |
275 return image->cachedImage(); | 275 return image->cachedImage(); |
276 | 276 |
277 return 0; | 277 return 0; |
278 } | 278 } |
279 | 279 |
280 static void writeImageToDataObject(DataObject* dataObject, Element* element, con
st KURL& url) | 280 static void writeImageToDataObject(DataObject* dataObject, Element* element, con
st KURL& url) |
281 { | 281 { |
282 // Shove image data into a DataObject for use as a file | 282 // Shove image data into a DataObject for use as a file |
283 ImageResource* cachedImage = getImageResource(element); | 283 ImageResource* cachedImage = getImageResource(element); |
284 if (!cachedImage || !cachedImage->imageForLayoutObject(element->layoutObject
()) || !cachedImage->isLoaded()) | 284 if (!cachedImage || !cachedImage->image() || !cachedImage->isLoaded()) |
285 return; | 285 return; |
286 | 286 |
287 SharedBuffer* imageBuffer = cachedImage->imageForLayoutObject(element->layou
tObject())->data(); | 287 SharedBuffer* imageBuffer = cachedImage->image()->data(); |
288 if (!imageBuffer || !imageBuffer->size()) | 288 if (!imageBuffer || !imageBuffer->size()) |
289 return; | 289 return; |
290 | 290 |
291 String imageExtension = cachedImage->image()->filenameExtension(); | 291 String imageExtension = cachedImage->image()->filenameExtension(); |
292 ASSERT(!imageExtension.isEmpty()); | 292 ASSERT(!imageExtension.isEmpty()); |
293 | 293 |
294 // Determine the filename for the file contents of the image. | 294 // Determine the filename for the file contents of the image. |
295 String filename = cachedImage->response().suggestedFilename(); | 295 String filename = cachedImage->response().suggestedFilename(); |
296 if (filename.isEmpty()) | 296 if (filename.isEmpty()) |
297 filename = url.lastPathComponent(); | 297 filename = url.lastPathComponent(); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 | 515 |
516 DEFINE_TRACE(DataTransfer) | 516 DEFINE_TRACE(DataTransfer) |
517 { | 517 { |
518 visitor->trace(m_dataObject); | 518 visitor->trace(m_dataObject); |
519 #if ENABLE(OILPAN) | 519 #if ENABLE(OILPAN) |
520 visitor->trace(m_dragImageElement); | 520 visitor->trace(m_dragImageElement); |
521 #endif | 521 #endif |
522 } | 522 } |
523 | 523 |
524 } // namespace blink | 524 } // namespace blink |
OLD | NEW |