Skip to content
  • timothy_horton@apple.com's avatar
    [wk2] IconDatabase images should be decoded in the WebProcess · f827b9bd
    timothy_horton@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=112524
    <rdar://problem/10133914>
    
    Reviewed by Oliver Hunt.
    
    In the interests of keeping decoding of data coming in from the greater Internet
    in the WebProcess, move decoding of favicons from the UIProcess to the WebProcess.
    
    * UIProcess/WebIconDatabase.cpp:
    (WebKit::WebIconDatabase::setIconBitmapForIconURL):
    Receive a ShareableBitmap handle from the WebProcess instead of a DataReference.
    Use the new setIconBitmapForIconURL IconDatabase method.
    
    * UIProcess/WebIconDatabase.h:
    (WebIconDatabase):
    Rename setIconDataForIconURL to setIconBitmapForIconURL.
    
    * UIProcess/WebIconDatabase.messages.in: Ditto.
    
    * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
    (WebKit::WebIconDatabaseProxy::setIconDataForIconURL):
    In the WebProcess, decode the incoming icon and draw it into a ShareableBitmap.
    
    No testable behavior change.
    
    * loader/icon/IconDatabase.cpp:
    (WebCore::IconDatabase::updateIconRecord):
    Added updateIconRecord, which factors most of setIconDataForIconURL out so it can
    be shared with setIconBitmapForIconURL. This function will set either a bitmap or
    raw image data for the given icon URL.
    
    (WebCore::IconDatabase::setIconBitmapForIconURL):
    Added; make a copy of the bitmap for thread-safety purposes, and call updateIconRecord.
    
    (WebCore::IconDatabase::setIconDataForIconURL):
    Factored out of what is now updateIconRecord.
    
    * loader/icon/IconDatabase.h:
    (IconDatabase): Add setIconBitmapForIconURL and updateIconRecord.
    
    * loader/icon/IconDatabaseBase.h:
    (WebCore::IconDatabaseBase::setIconBitmapForIconURL): Added.
    * loader/icon/IconRecord.cpp:
    (WebCore::IconRecord::setImage): Set the image for an icon record directly (as opposed
    to setting the image data, which causes the image to be decoded in the WebProcess).
    * loader/icon/IconRecord.h:
    (IconRecord): Add setImage.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148034 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    f827b9bd