Changeset 150731 in webkit


Ignore:
Timestamp:
May 26, 2013 6:44:32 PM (11 years ago)
Author:
dino@apple.com
Message:

Plugins with no src but valid type should not snapshot
https://bugs.webkit.org/show_bug.cgi?id=116799
<rdar://problem/13695911>

Reviewed by Simon Fraser.

There are a few plug-ins around that don't take any source content
via the src attribute, but rather just load the binary based on the
mime-type. In those cases we shouldn't snapshot until we have a
mechanism to do so.

  • html/HTMLPlugInImageElement.cpp:

(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):

Add MIMEType logging, and detect the case of no src but valid type.

  • html/HTMLPlugInImageElement.h: Add another SnapshotReason enum for

this special case.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r150730 r150731  
     12013-05-26  Dean Jackson  <dino@apple.com>
     2
     3        Plugins with no src but valid type should not snapshot
     4        https://bugs.webkit.org/show_bug.cgi?id=116799
     5        <rdar://problem/13695911>
     6
     7        Reviewed by Simon Fraser.
     8
     9        There are a few plug-ins around that don't take any source content
     10        via the src attribute, but rather just load the binary based on the
     11        mime-type. In those cases we shouldn't snapshot until we have a
     12        mechanism to do so.
     13
     14        * html/HTMLPlugInImageElement.cpp:
     15        (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
     16            Add MIMEType logging, and detect the case of no src but valid type.
     17        * html/HTMLPlugInImageElement.h: Add another SnapshotReason enum for
     18            this special case.
     19
    1202013-05-26  Antti Koivisto  <antti@apple.com>
    221
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp

    r150556 r150731  
    578578{
    579579    LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data());
    580     LOG(Plugins, "   Loaded URL: %s", url.string().utf8().data());
     580    LOG(Plugins, "   Actual URL: %s", url.string().utf8().data());
     581    LOG(Plugins, "   MIME type: %s", loadedMimeType().utf8().data());
    581582
    582583    m_loadedUrl = url;
     
    643644        LOG(Plugins, "%p Plug-in from (%s, %s) is marked to auto-start, set to play", this, document()->page()->mainFrame()->document()->baseURL().host().utf8().data(), url.host().utf8().data());
    644645        m_snapshotDecision = NeverSnapshot;
     646        return;
     647    }
     648
     649    if (m_loadedUrl.isEmpty() && !loadedMimeType().isEmpty()) {
     650        LOG(Plugins, "%p Plug-in has no src URL but does have a valid mime type %s, set to play", this, loadedMimeType().utf8().data());
     651        m_snapshotDecision = MaySnapshotWhenContentIsSet;
    645652        return;
    646653    }
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.h

    r150556 r150731  
    9595        NeverSnapshot,
    9696        Snapshotted,
    97         MaySnapshotWhenResized
     97        MaySnapshotWhenResized,
     98        MaySnapshotWhenContentIsSet
    9899    };
    99100    SnapshotDecision snapshotDecision() const { return m_snapshotDecision; }
Note: See TracChangeset for help on using the changeset viewer.