Index: third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp |
diff --git a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp |
index 7f43290a4dd296830ef59a298d841897d73f9a5d..1c1abfeafa230b5cf10b18b28150325d5e269c27 100644 |
--- a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp |
+++ b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp |
@@ -108,6 +108,21 @@ |
namespace blink { |
+namespace { |
+ |
+// Convenience helper for frame tree helpers in FrameClient to reduce the amount |
+// of null-checking boilerplate code. Since the frame tree is maintained in the |
+// web/ layer, the frame tree helpers often have to deal with null WebFrames: |
+// for example, a frame with no parent will return null for WebFrame::parent(). |
+// TODO(dcheng): Remove duplication between FrameLoaderClientImpl and |
+// RemoteFrameClientImpl somehow... |
+Frame* toCoreFrame(WebFrame* frame) |
+{ |
+ return frame ? frame->toImplBase()->frame() : nullptr; |
+} |
+ |
+} // namespace |
+ |
FrameLoaderClientImpl::FrameLoaderClientImpl(WebLocalFrameImpl* frame) |
: m_webFrame(frame) |
{ |