| 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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 if (!document().getSecurityOrigin()->canDisplay(url)) { | 548 if (!document().getSecurityOrigin()->canDisplay(url)) { |
| 549 FrameLoader::reportLocalLoadFailed(frame, url.getString()); | 549 FrameLoader::reportLocalLoadFailed(frame, url.getString()); |
| 550 return false; | 550 return false; |
| 551 } | 551 } |
| 552 | 552 |
| 553 AtomicString declaredMimeType = document().isPluginDocument() && document().
localOwner() ? | 553 AtomicString declaredMimeType = document().isPluginDocument() && document().
localOwner() ? |
| 554 document().localOwner()->fastGetAttribute(HTMLNames::typeAttr) : | 554 document().localOwner()->fastGetAttribute(HTMLNames::typeAttr) : |
| 555 fastGetAttribute(HTMLNames::typeAttr); | 555 fastGetAttribute(HTMLNames::typeAttr); |
| 556 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) | 556 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) |
| 557 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum
ent(), mimeType, declaredMimeType, url)) { | 557 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum
ent(), mimeType, declaredMimeType, url)) { |
| 558 layoutEmbeddedItem().setPluginUnavailabilityReason(LayoutEmbeddedObject:
:PluginBlockedByContentSecurityPolicy); | 558 if (LayoutEmbeddedItem layoutItem = layoutEmbeddedItem()) |
| 559 layoutItem.setPluginUnavailabilityReason(LayoutEmbeddedObject::Plugi
nBlockedByContentSecurityPolicy); |
| 559 return false; | 560 return false; |
| 560 } | 561 } |
| 561 // If the URL is empty, a plugin could still be instantiated if a MIME-type | 562 // If the URL is empty, a plugin could still be instantiated if a MIME-type |
| 562 // is specified. | 563 // is specified. |
| 563 return (!mimeType.isEmpty() && url.isEmpty()) || !MixedContentChecker::shoul
dBlockFetch(frame, WebURLRequest::RequestContextObject, WebURLRequest::FrameType
None, ResourceRequest::RedirectStatus::NoRedirect, url); | 564 return (!mimeType.isEmpty() && url.isEmpty()) || !MixedContentChecker::shoul
dBlockFetch(frame, WebURLRequest::RequestContextObject, WebURLRequest::FrameType
None, ResourceRequest::RedirectStatus::NoRedirect, url); |
| 564 } | 565 } |
| 565 | 566 |
| 566 bool HTMLPlugInElement::allowedToLoadPlugin(const KURL& url, const String& mimeT
ype) | 567 bool HTMLPlugInElement::allowedToLoadPlugin(const KURL& url, const String& mimeT
ype) |
| 567 { | 568 { |
| 568 if (document().isSandboxed(SandboxPlugins)) { | 569 if (document().isSandboxed(SandboxPlugins)) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 590 | 591 |
| 591 void HTMLPlugInElement::lazyReattachIfNeeded() | 592 void HTMLPlugInElement::lazyReattachIfNeeded() |
| 592 { | 593 { |
| 593 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma
geType()) { | 594 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma
geType()) { |
| 594 lazyReattachIfAttached(); | 595 lazyReattachIfAttached(); |
| 595 setPersistedPluginWidget(nullptr); | 596 setPersistedPluginWidget(nullptr); |
| 596 } | 597 } |
| 597 } | 598 } |
| 598 | 599 |
| 599 } // namespace blink | 600 } // namespace blink |
| OLD | NEW |