Commit 4381e1ba authored by Mason Freed's avatar Mason Freed Committed by Chromium LUCI CQ

Remove unused ReasonForCallingAllowPlugins enum

It appears that this state was used previously, but is no
longer needed.

This should cause no behavior changes.

Change-Id: I7a36dcdb735654d1ce87debeb82c71a4ccd129eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2630286
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843790}
parent fd8c89c1
...@@ -136,8 +136,7 @@ DocumentInit::Type DocumentInit::ComputeDocumentType( ...@@ -136,8 +136,7 @@ DocumentInit::Type DocumentInit::ComputeDocumentType(
if (HTMLMediaElement::GetSupportsType(ContentType(mime_type))) if (HTMLMediaElement::GetSupportsType(ContentType(mime_type)))
return Type::kMedia; return Type::kMedia;
if (frame && frame->GetPage() && if (frame && frame->GetPage() && frame->Loader().AllowPlugins()) {
frame->Loader().AllowPlugins(kNotAboutToInstantiatePlugin)) {
PluginData* plugin_data = GetPluginData(frame, url); PluginData* plugin_data = GetPluginData(frame, url);
// Everything else except text/plain can be overridden by plugins. // Everything else except text/plain can be overridden by plugins.
......
...@@ -1809,7 +1809,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { ...@@ -1809,7 +1809,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() {
} }
PluginData* LocalFrame::GetPluginData() const { PluginData* LocalFrame::GetPluginData() const {
if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin)) if (!Loader().AllowPlugins())
return nullptr; return nullptr;
return GetPage()->GetPluginData( return GetPage()->GetPluginData(
Tree().Top().GetSecurityContext()->GetSecurityOrigin()); Tree().Top().GetSecurityContext()->GetSecurityOrigin());
......
...@@ -42,8 +42,7 @@ HTMLNoEmbedElement::HTMLNoEmbedElement(Document& document) ...@@ -42,8 +42,7 @@ HTMLNoEmbedElement::HTMLNoEmbedElement(Document& document)
bool HTMLNoEmbedElement::LayoutObjectIsNeeded( bool HTMLNoEmbedElement::LayoutObjectIsNeeded(
const ComputedStyle& style) const { const ComputedStyle& style) const {
if (GetDocument().GetFrame()->Loader().AllowPlugins( if (GetDocument().GetFrame()->Loader().AllowPlugins())
kNotAboutToInstantiatePlugin))
return false; return false;
return Element::LayoutObjectIsNeeded(style); return Element::LayoutObjectIsNeeded(style);
} }
......
...@@ -646,7 +646,7 @@ bool HTMLPlugInElement::LoadPlugin(const KURL& url, ...@@ -646,7 +646,7 @@ bool HTMLPlugInElement::LoadPlugin(const KURL& url,
return false; return false;
LocalFrame* frame = GetDocument().GetFrame(); LocalFrame* frame = GetDocument().GetFrame();
if (!frame->Loader().AllowPlugins(kAboutToInstantiatePlugin)) if (!frame->Loader().AllowPlugins())
return false; return false;
auto* layout_object = GetLayoutEmbeddedObject(); auto* layout_object = GetLayoutEmbeddedObject();
......
...@@ -95,8 +95,7 @@ void PluginDocumentParser::CreateDocumentStructure() { ...@@ -95,8 +95,7 @@ void PluginDocumentParser::CreateDocumentStructure() {
return; return;
// FIXME: Why does this check settings? // FIXME: Why does this check settings?
if (!frame->GetSettings() || if (!frame->GetSettings() || !frame->Loader().AllowPlugins())
!frame->Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
return; return;
auto* root_element = MakeGarbageCollected<HTMLHtmlElement>(*GetDocument()); auto* root_element = MakeGarbageCollected<HTMLHtmlElement>(*GetDocument());
......
...@@ -431,7 +431,7 @@ void FrameLoader::SetOpener(LocalFrame* opener) { ...@@ -431,7 +431,7 @@ void FrameLoader::SetOpener(LocalFrame* opener) {
frame_->SetOpener(opener); frame_->SetOpener(opener);
} }
bool FrameLoader::AllowPlugins(ReasonForCallingAllowPlugins reason) { bool FrameLoader::AllowPlugins() {
// With Oilpan, a FrameLoader might be accessed after the Page has been // With Oilpan, a FrameLoader might be accessed after the Page has been
// detached. FrameClient will not be accessible, so bail early. // detached. FrameClient will not be accessible, so bail early.
if (!Client()) if (!Client())
......
...@@ -196,7 +196,7 @@ class CORE_EXPORT FrameLoader final { ...@@ -196,7 +196,7 @@ class CORE_EXPORT FrameLoader final {
void DispatchUnloadEvent(SecurityOrigin* committing_origin, void DispatchUnloadEvent(SecurityOrigin* committing_origin,
base::Optional<Document::UnloadEventTiming>*); base::Optional<Document::UnloadEventTiming>*);
bool AllowPlugins(ReasonForCallingAllowPlugins); bool AllowPlugins();
void SaveScrollAnchor(); void SaveScrollAnchor();
void SaveScrollState(); void SaveScrollState();
......
...@@ -33,11 +33,6 @@ namespace blink { ...@@ -33,11 +33,6 @@ namespace blink {
enum ShouldSendReferrer { kMaybeSendReferrer, kNeverSendReferrer }; enum ShouldSendReferrer { kMaybeSendReferrer, kNeverSendReferrer };
enum ReasonForCallingAllowPlugins {
kAboutToInstantiatePlugin,
kNotAboutToInstantiatePlugin
};
enum LoadStartType { enum LoadStartType {
kNavigationToDifferentDocument, kNavigationToDifferentDocument,
kNavigationWithinSameDocument kNavigationWithinSameDocument
......
...@@ -65,8 +65,7 @@ DOMPlugin* DOMMimeType::enabledPlugin() const { ...@@ -65,8 +65,7 @@ DOMPlugin* DOMMimeType::enabledPlugin() const {
// FIXME: allowPlugins is just a client call. We should not need // FIXME: allowPlugins is just a client call. We should not need
// to bounce through the loader to get there. // to bounce through the loader to get there.
// Something like: frame()->page()->client()->allowPlugins(). // Something like: frame()->page()->client()->allowPlugins().
if (!DomWindow() || !DomWindow()->GetFrame()->Loader().AllowPlugins( if (!DomWindow() || !DomWindow()->GetFrame()->Loader().AllowPlugins()) {
kNotAboutToInstantiatePlugin)) {
return nullptr; return nullptr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment