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

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

Issue 1645313002: Don't apply the SandboxPlugins flag until we know a plugin will be used (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Testharness-based test Created 4 years, 10 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
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 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // HTMLElement function: 122 // HTMLElement function:
123 bool hasCustomFocusLogic() const override; 123 bool hasCustomFocusLogic() const override;
124 bool isPluginElement() const final; 124 bool isPluginElement() const final;
125 125
126 // Return any existing LayoutPart without triggering relayout, or 0 if it 126 // Return any existing LayoutPart without triggering relayout, or 0 if it
127 // doesn't yet exist. 127 // doesn't yet exist.
128 virtual LayoutPart* existingLayoutPart() const = 0; 128 virtual LayoutPart* existingLayoutPart() const = 0;
129 virtual void updateWidgetInternal() = 0; 129 virtual void updateWidgetInternal() = 0;
130 130
131 bool loadPlugin(const KURL&, const String& mimeType, const Vector<String>& p aramNames, const Vector<String>& paramValues, bool useFallback, bool requireLayo utObject); 131 bool loadPlugin(const KURL&, const String& mimeType, const Vector<String>& p aramNames, const Vector<String>& paramValues, bool useFallback, bool requireLayo utObject);
132 bool pluginIsLoadable(const KURL&, const String& mimeType); 132 // Perform checks after we have determined that a plugin will be used to
133 // show the object (i.e after allowedToLoadObject).
134 bool allowedToLoadPlugin(const KURL&, const String& mimeType);
135 // Perform checks based on the URL and MIME-type of the object to load.
136 bool allowedToLoadObject(const KURL&, const String& mimeType);
133 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType) ; 137 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType) ;
134 138
135 void setPersistedPluginWidget(Widget*); 139 void setPersistedPluginWidget(Widget*);
136 140
137 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; 141 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper;
138 NPObject* m_NPObject; 142 NPObject* m_NPObject;
139 bool m_needsWidgetUpdate; 143 bool m_needsWidgetUpdate;
140 bool m_shouldPreferPlugInsForImages; 144 bool m_shouldPreferPlugInsForImages;
141 145
142 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. 146 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget.
143 // However, plugins can persist even when not rendered. In order to 147 // However, plugins can persist even when not rendered. In order to
144 // prevent confusing code which may assume that widget() != null 148 // prevent confusing code which may assume that widget() != null
145 // means the frame is active, we save off m_widget here while 149 // means the frame is active, we save off m_widget here while
146 // the plugin is persisting but not being displayed. 150 // the plugin is persisting but not being displayed.
147 RefPtrWillBeMember<Widget> m_persistedPluginWidget; 151 RefPtrWillBeMember<Widget> m_persistedPluginWidget;
148 }; 152 };
149 153
150 inline bool isHTMLPlugInElement(const HTMLElement& element) 154 inline bool isHTMLPlugInElement(const HTMLElement& element)
151 { 155 {
152 return element.isPluginElement(); 156 return element.isPluginElement();
153 } 157 }
154 158
155 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); 159 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement);
156 160
157 } // namespace blink 161 } // namespace blink
158 162
159 #endif // HTMLPlugInElement_h 163 #endif // HTMLPlugInElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698