<https://webkit.org/b/119893> FrameView::frame() should return a reference.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2013 15:47:09 +0000 (15:47 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2013 15:47:09 +0000 (15:47 +0000)
commitd0b5a8c2e767d59435de8b73b057e1eff4eced4d
treed771c1c4c036d3737cd20fb1699736ef222a166f
parentd2834562c78d287d7fca6140ec191f70a604d109
<https://webkit.org/b/119893> FrameView::frame() should return a reference.

Reviewed by Antti Koivisto.

FrameView::m_frame was only ever null for a brief moment during CachedFrame teardown.
Leave it alone instead, and update the assertion that depended on this behavior.
This enables us to make FrameView::frame() return a Frame&, exposing a ton of
unnecessary null checks.

* history/CachedFrame.cpp:
(WebCore::CachedFrame::destroy):

    Remove call to FrameView::clearFrame() that was the only way to get a null
    FrameView::m_frame. Immediately followed by a call to CachedFrame::clear() where
    the FrameView would get destroyed anyway.

(WebCore::CachedFrame::clear):

    Update an assertion to support the case where the Document's Frame pointer has
    been cleared out and CachedFrame is still clinging to the FrameView.

* history/CachedPage.h:

    Made CachedPage::destroy() private as it was only called by ~CachedPage().

* /:

    Frame* FrameView::frame() => Frame& FrameView::frame()

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
42 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityScrollView.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/history/CachedFrame.cpp
Source/WebCore/history/CachedPage.cpp
Source/WebCore/history/CachedPage.h
Source/WebCore/history/PageCache.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/efl/EventHandlerEfl.cpp
Source/WebCore/page/gtk/EventHandlerGtk.cpp
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/page/qt/EventHandlerQt.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
Source/WebCore/page/win/EventHandlerWin.cpp
Source/WebCore/platform/blackberry/PlatformScreenBlackBerry.cpp
Source/WebCore/platform/efl/ScrollbarEfl.cpp
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
Source/WebCore/plugins/IFrameShimSupport.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderFrameBase.cpp
Source/WebCore/rendering/RenderIFrame.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderTreeAsText.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderWidget.cpp
Source/WebKit/efl/WebCoreSupport/PopupMenuEfl.cpp
Source/WebKit/efl/ewk/ewk_paint_context.cpp
Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm
Source/WebKit/mac/WebView/WebRenderNode.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/Shared/WebRenderObject.cpp
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp