| 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 if (!document().getSecurityOrigin()->canDisplay(url)) { | 561 if (!document().getSecurityOrigin()->canDisplay(url)) { |
| 562 FrameLoader::reportLocalLoadFailed(frame, url.getString()); | 562 FrameLoader::reportLocalLoadFailed(frame, url.getString()); |
| 563 return false; | 563 return false; |
| 564 } | 564 } |
| 565 | 565 |
| 566 AtomicString declaredMimeType = document().isPluginDocument() && document().
localOwner() ? | 566 AtomicString declaredMimeType = document().isPluginDocument() && document().
localOwner() ? |
| 567 document().localOwner()->fastGetAttribute(HTMLNames::typeAttr) : | 567 document().localOwner()->fastGetAttribute(HTMLNames::typeAttr) : |
| 568 fastGetAttribute(HTMLNames::typeAttr); | 568 fastGetAttribute(HTMLNames::typeAttr); |
| 569 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) | 569 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) |
| 570 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum
ent(), mimeType, declaredMimeType, url)) { | 570 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum
ent(), mimeType, declaredMimeType, url)) { |
| 571 layoutEmbeddedItem().setPluginUnavailabilityReason(LayoutEmbeddedObject:
:PluginBlockedByContentSecurityPolicy); | 571 if (LayoutEmbeddedItem layoutItem = layoutEmbeddedItem()) |
| 572 layoutItem.setPluginUnavailabilityReason(LayoutEmbeddedObject::Plugi
nBlockedByContentSecurityPolicy); |
| 572 return false; | 573 return false; |
| 573 } | 574 } |
| 574 // If the URL is empty, a plugin could still be instantiated if a MIME-type | 575 // If the URL is empty, a plugin could still be instantiated if a MIME-type |
| 575 // is specified. | 576 // is specified. |
| 576 return (!mimeType.isEmpty() && url.isEmpty()) || !MixedContentChecker::shoul
dBlockFetch(frame, WebURLRequest::RequestContextObject, WebURLRequest::FrameType
None, ResourceRequest::RedirectStatus::NoRedirect, url); | 577 return (!mimeType.isEmpty() && url.isEmpty()) || !MixedContentChecker::shoul
dBlockFetch(frame, WebURLRequest::RequestContextObject, WebURLRequest::FrameType
None, ResourceRequest::RedirectStatus::NoRedirect, url); |
| 577 } | 578 } |
| 578 | 579 |
| 579 bool HTMLPlugInElement::allowedToLoadPlugin(const KURL& url, const String& mimeT
ype) | 580 bool HTMLPlugInElement::allowedToLoadPlugin(const KURL& url, const String& mimeT
ype) |
| 580 { | 581 { |
| 581 if (document().isSandboxed(SandboxPlugins)) { | 582 if (document().isSandboxed(SandboxPlugins)) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 603 | 604 |
| 604 void HTMLPlugInElement::lazyReattachIfNeeded() | 605 void HTMLPlugInElement::lazyReattachIfNeeded() |
| 605 { | 606 { |
| 606 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma
geType()) { | 607 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma
geType()) { |
| 607 lazyReattachIfAttached(); | 608 lazyReattachIfAttached(); |
| 608 setPersistedPluginWidget(nullptr); | 609 setPersistedPluginWidget(nullptr); |
| 609 } | 610 } |
| 610 } | 611 } |
| 611 | 612 |
| 612 } // namespace blink | 613 } // namespace blink |
| OLD | NEW |