Commit 5d000c09 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Switch blink::FrameView to use downcast helpers

R=haraken@chromium.org
CC=blink-reviews-onion-soup@chromium.org

BUG=891908

Change-Id: I2783d2caf8b915a06bb5277d35ca650f079a58c7
Reviewed-on: https://chromium-review.googlesource.com/c/1483173
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634709}
parent aaf7aa4e
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_FRAME_VIEW_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_FRAME_VIEW_H_
#include "third_party/blink/renderer/core/frame/embedded_content_view.h" #include "third_party/blink/renderer/core/frame/embedded_content_view.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
namespace blink { namespace blink {
...@@ -22,11 +23,12 @@ class CORE_EXPORT FrameView : public EmbeddedContentView { ...@@ -22,11 +23,12 @@ class CORE_EXPORT FrameView : public EmbeddedContentView {
bool IsFrameView() const override { return true; } bool IsFrameView() const override { return true; }
}; };
DEFINE_TYPE_CASTS(FrameView, template <>
EmbeddedContentView, struct DowncastTraits<FrameView> {
embedded_content_view, static bool AllowFrom(const EmbeddedContentView& embedded_content_view) {
embedded_content_view->IsFrameView(), return embedded_content_view.IsFrameView();
embedded_content_view.IsFrameView()); }
};
} // namespace blink } // namespace blink
......
...@@ -88,12 +88,7 @@ LayoutEmbeddedContent::~LayoutEmbeddedContent() { ...@@ -88,12 +88,7 @@ LayoutEmbeddedContent::~LayoutEmbeddedContent() {
} }
FrameView* LayoutEmbeddedContent::ChildFrameView() const { FrameView* LayoutEmbeddedContent::ChildFrameView() const {
EmbeddedContentView* embedded_content_view = GetEmbeddedContentView(); return DynamicTo<FrameView>(GetEmbeddedContentView());
if (embedded_content_view && embedded_content_view->IsFrameView())
return ToFrameView(embedded_content_view);
return nullptr;
} }
WebPluginContainerImpl* LayoutEmbeddedContent::Plugin() const { WebPluginContainerImpl* LayoutEmbeddedContent::Plugin() const {
......
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