Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp

Issue 2213593002: OOPIF support for 'plugin-types' Content Security Policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@csp-reporting-ipcs
Patch Set: Accounting for lack of https://crrev.com/2190183002 (i.e. no CSP reports from remote frames). Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698