Changeset 120694 in webkit
- Timestamp:
- Jun 19, 2012 1:55:09 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r120693 r120694 1 2012-06-19 Sergio Villar Senin <svillar@igalia.com> 2 3 Calling nativeImageForCurrentFrame() causes assertion failure: m_verifier.isSafeToUse() 4 https://bugs.webkit.org/show_bug.cgi?id=67582 5 6 Reviewed by David Levin. 7 8 Added a new synchronous method to the IconDatabase that returns a 9 native image for the platform instead of a WebCore::Image*. 10 11 * loader/icon/IconDatabase.cpp: 12 (WebCore::IconDatabase::synchronousNativeIconForPageURL): 13 (WebCore): 14 * loader/icon/IconDatabase.h: 15 (IconDatabase): 16 * loader/icon/IconDatabaseBase.h: 17 (WebCore::IconDatabaseBase::synchronousNativeIconForPageURL): 18 (IconDatabaseBase): 19 1 20 2012-06-19 Andy Estes <aestes@apple.com> 2 21 -
trunk/Source/WebCore/loader/icon/IconDatabase.cpp
r120364 r120694 35 35 #include "IconDatabaseClient.h" 36 36 #include "IconRecord.h" 37 #include "Image.h" 37 38 #include "IntSize.h" 38 39 #include "Logging.h" … … 291 292 // delete the image on the secondary thread if the image already exists. 292 293 return iconRecord->image(size); 294 } 295 296 NativeImagePtr IconDatabase::synchronousNativeIconForPageURL(const String& pageURLOriginal, const IntSize& size) 297 { 298 Image* icon = synchronousIconForPageURL(pageURLOriginal, size); 299 if (!icon) 300 return 0; 301 302 MutexLocker locker(m_urlAndIconLock); 303 return icon->nativeImageForCurrentFrame(); 293 304 } 294 305 -
trunk/Source/WebCore/loader/icon/IconDatabase.h
r117744 r120694 98 98 99 99 virtual Image* synchronousIconForPageURL(const String&, const IntSize&); 100 virtual NativeImagePtr synchronousNativeIconForPageURL(const String& pageURLOriginal, const IntSize&); 100 101 virtual String synchronousIconURLForPageURL(const String&); 101 102 virtual bool synchronousIconDataKnownForIconURL(const String&); -
trunk/Source/WebCore/loader/icon/IconDatabaseBase.h
r95901 r120694 27 27 #define IconDatabaseBase_h 28 28 29 #include "ImageSource.h" 29 30 #include "SharedBuffer.h" 30 31 … … 33 34 #include <wtf/PassRefPtr.h> 34 35 35 namespace WebCore { 36 namespace WebCore { 36 37 37 38 class DocumentLoader; … … 179 180 virtual IconLoadDecision synchronousLoadDecisionForIconURL(const String&, DocumentLoader*) { return IconLoadNo; } 180 181 virtual Image* synchronousIconForPageURL(const String&, const IntSize&) { return 0; } 181 182 virtual NativeImagePtr synchronousNativeIconForPageURL(const String&, const IntSize&) { return 0; } 183 182 184 // Asynchronous calls we should use to replace the above when supported. 183 185 virtual bool supportsAsynchronousMode() { return false; } -
trunk/Source/WebKit/blackberry/ChangeLog
r120622 r120694 1 2012-06-19 Sergio Villar Senin <svillar@igalia.com> 2 3 Calling nativeImageForCurrentFrame() causes assertion failure: m_verifier.isSafeToUse() 4 https://bugs.webkit.org/show_bug.cgi?id=67582 5 6 Reviewed by David Levin. 7 8 Use synchronousNativeIconForPageURL() to retrieve favicons. 9 10 * WebCoreSupport/FrameLoaderClientBlackBerry.cpp: 11 (WebCore::FrameLoaderClientBlackBerry::dispatchDidReceiveIcon): 12 1 13 2012-06-18 Antonio Gomes <agomes@rim.com> 2 14 -
trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
r120399 r120694 1150 1150 { 1151 1151 String url = m_frame->document()->url().string(); 1152 Image* img = iconDatabase().synchronousIconForPageURL(url, IntSize(10, 10)); 1153 if (!img || !img->data()) 1154 return; 1155 1156 NativeImageSkia* bitmap = img->nativeImageForCurrentFrame(); 1152 NativeImageSkia* bitmap = iconDatabase().synchronousNativeIconForPageURL(url, IntSize(10, 10)); 1157 1153 if (!bitmap) 1158 1154 return; 1155 1159 1156 bitmap->lockPixels(); 1160 1157 String iconUrl = iconDatabase().synchronousIconURLForPageURL(url); -
trunk/Source/WebKit/cf/ChangeLog
r103314 r120694 1 2012-06-19 Sergio Villar Senin <svillar@igalia.com> 2 3 Calling nativeImageForCurrentFrame() causes assertion failure: m_verifier.isSafeToUse() 4 https://bugs.webkit.org/show_bug.cgi?id=67582 5 6 Reviewed by David Levin. 7 8 Fixes windows build. 9 10 * WebCoreSupport/WebInspectorClientCF.cpp: 11 1 12 2011-12-20 Pavel Feldman <pavel.feldman@gmail.com> 2 13 -
trunk/Source/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp
r103314 r120694 32 32 #ifndef WTF_USE_CF 33 33 #define WTF_USE_CF 1 34 #endif 35 36 #include <wtf/Platform.h> 37 38 #if PLATFORM(WIN) && !OS(WINCE) 39 #ifndef WTF_USE_CG 40 #define WTF_USE_CG 1 41 #endif 34 42 #endif 35 43 -
trunk/Source/WebKit/efl/ChangeLog
r120692 r120694 1 2012-06-19 Sergio Villar Senin <svillar@igalia.com> 2 3 Calling nativeImageForCurrentFrame() causes assertion failure: m_verifier.isSafeToUse() 4 https://bugs.webkit.org/show_bug.cgi?id=67582 5 6 Reviewed by David Levin. 7 8 Use synchronousNativeIconForPageURL() to retrieve favicons. 9 10 * ewk/ewk_history.cpp: 11 (ewk_history_item_icon_surface_get): 12 (ewk_history_item_icon_object_add): 13 * ewk/ewk_settings.cpp: 14 (ewk_settings_icon_database_icon_surface_get): 15 (ewk_settings_icon_database_icon_object_add): 16 1 17 2012-06-19 Christophe Dumez <christophe.dumez@intel.com> 2 18 -
trunk/Source/WebKit/efl/ewk/ewk_history.cpp
r117046 r120694 337 337 EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); 338 338 339 WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(core->url(), WebCore::IntSize(16, 16)); 339 WebCore::NativeImagePtr icon = WebCore::iconDatabase().synchronousNativeIconForPageURL(core->url(), WebCore::IntSize(16, 16)); 340 if (!icon) 341 ERR("icon is NULL."); 342 343 return icon ? icon->surface() : 0; 344 } 345 346 Evas_Object* ewk_history_item_icon_object_add(const Ewk_History_Item* item, Evas* canvas) 347 { 348 EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); 349 EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); 350 351 WebCore::NativeImagePtr icon = WebCore::iconDatabase().synchronousNativeIconForPageURL(core->url(), WebCore::IntSize(16, 16)); 340 352 if (!icon) { 341 353 ERR("icon is NULL."); … … 343 355 } 344 356 345 WebCore::NativeImageCairo* nativeImage = icon->nativeImageForCurrentFrame(); 346 return nativeImage ? nativeImage->surface() : 0; 347 } 348 349 Evas_Object* ewk_history_item_icon_object_add(const Ewk_History_Item* item, Evas* canvas) 350 { 351 EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core, 0); 352 EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); 353 WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(core->url(), WebCore::IntSize(16, 16)); 354 355 if (!icon) { 356 ERR("icon is NULL."); 357 return 0; 358 } 359 360 WebCore::NativeImageCairo* nativeImage = icon->nativeImageForCurrentFrame(); 361 return nativeImage ? ewk_util_image_from_cairo_surface_add(canvas, nativeImage->surface()) : 0; 357 cairo_surface_t* surface = icon->surface(); 358 return surface ? ewk_util_image_from_cairo_surface_add(canvas, surface) : 0; 362 359 } 363 360 -
trunk/Source/WebKit/efl/ewk/ewk_settings.cpp
r120144 r120694 208 208 209 209 WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url)); 210 WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); 210 WebCore::NativeImagePtr icon = WebCore::iconDatabase().synchronousNativeIconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); 211 if (!icon) 212 ERR("no icon for url %s", url); 213 214 return icon ? icon->surface() : 0; 215 } 216 217 Evas_Object* ewk_settings_icon_database_icon_object_get(const char* url, Evas* canvas) 218 { 219 EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0); 220 EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); 221 222 WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url)); 223 WebCore::NativeImagePtr icon = WebCore::iconDatabase().synchronousNativeIconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); 211 224 212 225 if (!icon) { … … 215 228 } 216 229 217 WebCore::NativeImageCairo* nativeImage = icon->nativeImageForCurrentFrame(); 218 return nativeImage ? nativeImage->surface() : 0; 219 } 220 221 Evas_Object* ewk_settings_icon_database_icon_object_get(const char* url, Evas* canvas) 222 { 223 EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0); 224 EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); 225 226 WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url)); 227 WebCore::Image* icon = WebCore::iconDatabase().synchronousIconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); 228 229 if (!icon) { 230 ERR("no icon for url %s", url); 231 return 0; 232 } 233 234 WebCore::NativeImageCairo* nativeImage = icon->nativeImageForCurrentFrame(); 235 return nativeImage ? ewk_util_image_from_cairo_surface_add(canvas, nativeImage->surface()) : 0; 230 cairo_surface_t* surface = icon->surface(); 231 return surface ? ewk_util_image_from_cairo_surface_add(canvas, surface) : 0; 236 232 } 237 233 -
trunk/Source/WebKit/gtk/ChangeLog
r120588 r120694 1 2012-06-19 Sergio Villar Senin <svillar@igalia.com> 2 3 Calling nativeImageForCurrentFrame() causes assertion failure: m_verifier.isSafeToUse() 4 https://bugs.webkit.org/show_bug.cgi?id=67582 5 6 Reviewed by David Levin. 7 8 Use synchronousNativeIconForPageURL() to retrieve favicons. 9 10 * webkit/webkitfavicondatabase.cpp: 11 (getIconPixbufSynchronously): 12 1 13 2012-06-18 Mario Sanchez Prada <msanchez@igalia.com> 2 14 -
trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp
r111698 r120694 25 25 #include "DatabaseTracker.h" 26 26 #include "FileSystem.h" 27 #include "GdkCairoUtilities.h" 27 28 #include "IconDatabase.h" 28 29 #include "IconDatabaseClient.h" … … 395 396 // The exact size we pass is irrelevant to the iconDatabase code. 396 397 // We must pass something greater than 0x0 to get a pixbuf. 397 Image* icon = iconDatabase().synchronousIconForPageURL(pageURL, !iconSize.isZero() ? iconSize : IntSize(1, 1));398 NativeImagePtr icon = iconDatabase().synchronousNativeIconForPageURL(pageURL, !iconSize.isZero() ? iconSize : IntSize(1, 1)); 398 399 if (!icon) 399 400 return 0; 400 401 401 GRefPtr<GdkPixbuf> pixbuf = adoptGRef( icon->getGdkPixbuf());402 GRefPtr<GdkPixbuf> pixbuf = adoptGRef(cairoImageSurfaceToGdkPixbuf(icon->surface())); 402 403 if (!pixbuf) 403 404 return 0; 404 405 405 406 // A size of (0, 0) means the maximum available size. 406 if (!iconSize.isZero() && (icon->width() != iconSize.width() || icon->height() != iconSize.height())) 407 int pixbufWidth = gdk_pixbuf_get_width(pixbuf.get()); 408 int pixbufHeight = gdk_pixbuf_get_height(pixbuf.get()); 409 if (!iconSize.isZero() && (pixbufWidth != iconSize.width() || pixbufHeight != iconSize.height())) 407 410 pixbuf = gdk_pixbuf_scale_simple(pixbuf.get(), iconSize.width(), iconSize.height(), GDK_INTERP_BILINEAR); 408 411 return pixbuf.leakRef(); -
trunk/Source/WebKit/qt/Api/qwebhistory.cpp
r109572 r120694 159 159 { 160 160 if (d->item) 161 return *WebCore::iconDatabase().synchronous IconForPageURL(d->item->url(), WebCore::IntSize(16, 16))->nativeImageForCurrentFrame();161 return *WebCore::iconDatabase().synchronousNativeIconForPageURL(d->item->url(), WebCore::IntSize(16, 16)); 162 162 163 163 return QIcon(); -
trunk/Source/WebKit/qt/Api/qwebsettings.cpp
r119098 r120694 716 716 { 717 717 WebCore::initializeWebCoreQt(); 718 WebCore::Image* image = WebCore::iconDatabase().synchronousIconForPageURL(WebCore::KURL(url).string(),718 QPixmap* icon = WebCore::iconDatabase().synchronousNativeIconForPageURL(WebCore::KURL(url).string(), 719 719 WebCore::IntSize(16, 16)); 720 if (!image)721 return QPixmap();722 723 QPixmap* icon = image->nativeImageForCurrentFrame();724 720 if (!icon) 725 721 return QPixmap(); -
trunk/Source/WebKit/qt/ChangeLog
r120594 r120694 1 2012-06-19 Sergio Villar Senin <svillar@igalia.com> 2 3 Calling nativeImageForCurrentFrame() causes assertion failure: m_verifier.isSafeToUse() 4 https://bugs.webkit.org/show_bug.cgi?id=67582 5 6 Reviewed by David Levin. 7 8 Use synchronousNativeIconForPageURL() to retrieve favicons. 9 10 * Api/qwebhistory.cpp: 11 (QWebHistoryItem::icon): 12 * Api/qwebsettings.cpp: 13 (QWebSettings::iconForUrl): 14 1 15 2012-06-18 Andras Becsi <andras.becsi@nokia.com> 2 16 -
trunk/Source/WebKit2/UIProcess/WebIconDatabase.cpp
r117141 r120694 191 191 } 192 192 193 WebCore::NativeImagePtr WebIconDatabase::nativeImageForPageURL(const String& pageURL, const WebCore::IntSize& iconSize) 194 { 195 if (!m_webContext || !m_iconDatabaseImpl || !m_iconDatabaseImpl->isOpen() || pageURL.isEmpty()) 196 return 0; 197 198 return m_iconDatabaseImpl->synchronousNativeIconForPageURL(pageURL, iconSize); 199 } 200 193 201 bool WebIconDatabase::isOpen() 194 202 { -
trunk/Source/WebKit2/UIProcess/WebIconDatabase.h
r117141 r120694 32 32 #include "WebIconDatabaseClient.h" 33 33 #include <WebCore/IconDatabaseClient.h> 34 #include <WebCore/ImageSource.h> 34 35 #include <WebCore/IntSize.h> 35 36 #include <wtf/Forward.h> … … 79 80 80 81 WebCore::Image* imageForPageURL(const String&, const WebCore::IntSize& iconSize = WebCore::IntSize(32, 32)); 82 WebCore::NativeImagePtr nativeImageForPageURL(const String&, const WebCore::IntSize& iconSize = WebCore::IntSize(32, 32)); 81 83 bool isOpen(); 82 84 -
trunk/Source/WebKit2/UIProcess/qt/QtWebIconDatabaseClient.cpp
r118762 r120694 90 90 91 91 WebCore::IntSize size(iconSize.width(), iconSize.height()); 92 RefPtr<WebCore::Image> image = m_iconDatabase->imageForPageURL(pageURL, size);93 if (!image)94 return QImage();95 92 96 QPixmap* nativeImage = image->nativeImageForCurrentFrame();93 QPixmap* nativeImage = m_iconDatabase->nativeImageForPageURL(pageURL, size); 97 94 if (!nativeImage) 98 95 return QImage();
Note: See TracChangeset
for help on using the changeset viewer.