OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. | 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 return false; | 568 return false; |
569 | 569 |
570 if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) | 570 if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) |
571 return false; | 571 return false; |
572 | 572 |
573 if (!document().getSecurityOrigin()->canDisplay(url)) { | 573 if (!document().getSecurityOrigin()->canDisplay(url)) { |
574 FrameLoader::reportLocalLoadFailed(frame, url.getString()); | 574 FrameLoader::reportLocalLoadFailed(frame, url.getString()); |
575 return false; | 575 return false; |
576 } | 576 } |
577 | 577 |
578 AtomicString declaredMimeType = document().isPluginDocument() && document().
localOwner() ? | 578 AtomicString declaredMimeType = fastGetAttribute(HTMLNames::typeAttr); |
579 document().localOwner()->fastGetAttribute(HTMLNames::typeAttr) : | |
580 fastGetAttribute(HTMLNames::typeAttr); | |
581 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) | 579 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) |
582 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum
ent(), mimeType, declaredMimeType, url)) { | 580 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum
ent(), mimeType, declaredMimeType, url)) { |
583 if (LayoutEmbeddedItem layoutItem = layoutEmbeddedItem()) { | 581 if (LayoutEmbeddedItem layoutItem = layoutEmbeddedItem()) { |
584 m_pluginIsAvailable = false; | 582 m_pluginIsAvailable = false; |
585 layoutItem.setPluginAvailability(LayoutEmbeddedObject::PluginBlocked
ByContentSecurityPolicy); | 583 layoutItem.setPluginAvailability(LayoutEmbeddedObject::PluginBlocked
ByContentSecurityPolicy); |
586 } | 584 } |
587 return false; | 585 return false; |
588 } | 586 } |
589 // If the URL is empty, a plugin could still be instantiated if a MIME-type | 587 // If the URL is empty, a plugin could still be instantiated if a MIME-type |
590 // is specified. | 588 // is specified. |
(...skipping 27 matching lines...) Expand all Loading... |
618 | 616 |
619 void HTMLPlugInElement::lazyReattachIfNeeded() | 617 void HTMLPlugInElement::lazyReattachIfNeeded() |
620 { | 618 { |
621 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma
geType()) { | 619 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma
geType()) { |
622 lazyReattachIfAttached(); | 620 lazyReattachIfAttached(); |
623 setPersistedPluginWidget(nullptr); | 621 setPersistedPluginWidget(nullptr); |
624 } | 622 } |
625 } | 623 } |
626 | 624 |
627 } // namespace blink | 625 } // namespace blink |
OLD | NEW |