Changeset 89727 in webkit


Ignore:
Timestamp:
Jun 24, 2011, 7:12:10 PM (14 years ago)
Author:
Lucas Forschler
Message:

89706.

Location:
branches/safari-534-branch/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-534-branch/Source/WebKit2/ChangeLog

    r89528 r89727  
     12011-06-24  Lucas Forschler  <lforschler@apple.com>
     2
     3    Merged 89706.
     4
     5    2011-06-24  Anders Carlsson  <andersca@apple.com>
     6
     7        Reviewed by Kevin Decker.
     8
     9        Not possible for plug-ins to override the internal PDF viewer
     10        https://bugs.webkit.org/show_bug.cgi?id=63356
     11        <rdar://problem/9673382>
     12
     13        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     14        (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
     15        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
     16        Pass the entire resource response to shouldUseCustomRepresentationForResponse.
     17
     18        * WebProcess/WebProcess.cpp:
     19        (WebKit::canPluginHandleResponse):
     20        Ask for the plug-in path for a plug-in that can handle the given resource response.
     21        If we fail to send the message, or if the path comes back empty, we assume that there's no plug-in
     22        that can handle it.
     23
     24        (WebKit::WebProcess::shouldUseCustomRepresentationForResponse):
     25        If the response MIME type is in the m_mimeTypesWithCustomRepresentations map, check if there's
     26        a plug-in that can handle the given response. If that is the case, it should have precedence over
     27        the custom representation.
     28
     29        * WebProcess/WebProcess.h:
     30        Rename shouldUseCustomRepresentationForMIMEType to shouldUseCustomRepresentationForResponse.
     31
    1322011-06-22  Lucas Forschler  <lforschler@apple.com>
    233
  • branches/safari-534-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r87973 r89727  
    11051105    bool isMainFrame = webPage->mainFrame() == m_frame;
    11061106   
    1107     const String& mimeType = m_frame->coreFrame()->loader()->documentLoader()->response().mimeType();
    1108     m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForMIMEType(mimeType);
     1107    const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
     1108    m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForResponse(response);
    11091109}
    11101110
     
    11281128    m_frame->coreFrame()->view()->setActualVisibleContentRect(IntRect(IntPoint::zero(), currentVisibleContentSize));
    11291129#else
    1130     const String& mimeType = m_frame->coreFrame()->loader()->documentLoader()->response().mimeType();
    1131     m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForMIMEType(mimeType);
     1130    const ResourceResponse& response = m_frame->coreFrame()->loader()->documentLoader()->response();
     1131    m_frameHasCustomRepresentation = isMainFrame && WebProcess::shared().shouldUseCustomRepresentationForResponse(response);
    11321132
    11331133    m_frame->coreFrame()->createView(webPage->size(), backgroundColor, false, IntSize(), false);
  • branches/safari-534-branch/Source/WebKit2/WebProcess/WebProcess.cpp

    r87575 r89727  
    723723}
    724724
     725static bool canPluginHandleResponse(const ResourceResponse& response)
     726{
     727    String pluginPath;
     728
     729    if (!WebProcess::shared().connection()->sendSync(Messages::WebContext::GetPluginPath(response.mimeType(), response.url().string()), Messages::WebContext::GetPluginPath::Reply(pluginPath), 0))
     730        return false;
     731
     732    return !pluginPath.isEmpty();
     733}
     734
     735bool WebProcess::shouldUseCustomRepresentationForResponse(const ResourceResponse& response) const
     736{
     737    if (!m_mimeTypesWithCustomRepresentations.contains(response.mimeType()))
     738        return false;
     739
     740    // If a plug-in exists that claims to support this response, it should take precedence over the custom representation.
     741    return !canPluginHandleResponse(response);
     742}
     743
    725744void WebProcess::clearResourceCaches(ResourceCachesToClear resourceCachesToClear)
    726745{
  • branches/safari-534-branch/Source/WebKit2/WebProcess/WebProcess.h

    r86678 r89727  
    5555    class PageGroup;
    5656    class ResourceRequest;
     57    class ResourceResponse;
    5758}
    5859
     
    112113#endif
    113114
    114     bool shouldUseCustomRepresentationForMIMEType(const String& mimeType) const { return m_mimeTypesWithCustomRepresentations.contains(mimeType); }
     115    bool shouldUseCustomRepresentationForResponse(const WebCore::ResourceResponse&) const;
    115116
    116117    // Text Checking
Note: See TracChangeset for help on using the changeset viewer.