Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: Source/WebCore/platform/mac/HTMLConverter.mm

Issue 7147018: Merge 87756 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/html/PluginDocument.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 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 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 return nil; 1746 return nil;
1747 } 1747 }
1748 1748
1749 static NSFileWrapper *fileWrapperForElement(Element* element) 1749 static NSFileWrapper *fileWrapperForElement(Element* element)
1750 { 1750 {
1751 NSFileWrapper *wrapper = nil; 1751 NSFileWrapper *wrapper = nil;
1752 1752
1753 const AtomicString& attr = element->getAttribute(srcAttr); 1753 const AtomicString& attr = element->getAttribute(srcAttr);
1754 if (!attr.isEmpty()) { 1754 if (!attr.isEmpty()) {
1755 NSURL *URL = element->document()->completeURL(attr); 1755 NSURL *URL = element->document()->completeURL(attr);
1756 wrapper = fileWrapperForURL(element->document()->loader(), URL); 1756 if (DocumentLoader* loader = element->document()->loader())
1757 wrapper = fileWrapperForURL(loader, URL);
1757 } 1758 }
1758 if (!wrapper) { 1759 if (!wrapper) {
1759 RenderImage* renderer = toRenderImage(element->renderer()); 1760 RenderImage* renderer = toRenderImage(element->renderer());
1760 if (renderer->cachedImage() && !renderer->cachedImage()->errorOccurred() ) { 1761 if (renderer->cachedImage() && !renderer->cachedImage()->errorOccurred() ) {
1761 wrapper = [[NSFileWrapper alloc] initRegularFileWithContents:(NSData *)(renderer->cachedImage()->image()->getTIFFRepresentation())]; 1762 wrapper = [[NSFileWrapper alloc] initRegularFileWithContents:(NSData *)(renderer->cachedImage()->image()->getTIFFRepresentation())];
1762 [wrapper setPreferredFilename:@"image.tiff"]; 1763 [wrapper setPreferredFilename:@"image.tiff"];
1763 [wrapper autorelease]; 1764 [wrapper autorelease];
1764 } 1765 }
1765 } 1766 }
1766 1767
1767 return wrapper; 1768 return wrapper;
1768 } 1769 }
OLDNEW
« no previous file with comments | « Source/WebCore/html/PluginDocument.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698