Changeset 125815 in webkit


Ignore:
Timestamp:
Aug 16, 2012 3:29:48 PM (12 years ago)
Author:
abarth@webkit.org
Message:

Null checks of m_frame->document()->domWindow() aren't needed
https://bugs.webkit.org/show_bug.cgi?id=94052

Reviewed by Eric Seidel.

If a document is attached to a frame, then its DOMWindow is necessarily
non-0. Checking for 0 is needless.

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::checkLoadComplete):

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::stopLoading):
(WebCore::FrameLoader::didOpenURL):
(WebCore::FrameLoader::prepareForCachedPageRestore):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r125811 r125815  
     12012-08-16  Adam Barth  <abarth@webkit.org>
     2
     3        Null checks of m_frame->document()->domWindow() aren't needed
     4        https://bugs.webkit.org/show_bug.cgi?id=94052
     5
     6        Reviewed by Eric Seidel.
     7
     8        If a document is attached to a frame, then its DOMWindow is necessarily
     9        non-0. Checking for 0 is needless.
     10
     11        * loader/DocumentLoader.cpp:
     12        (WebCore::DocumentLoader::checkLoadComplete):
     13        * loader/FrameLoader.cpp:
     14        (WebCore::FrameLoader::stopLoading):
     15        (WebCore::FrameLoader::didOpenURL):
     16        (WebCore::FrameLoader::prepareForCachedPageRestore):
     17
    1182012-08-16  Max Feil  <mfeil@rim.com>
    219
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r125763 r125815  
    429429        return;
    430430    ASSERT(this == frameLoader()->activeDocumentLoader());
    431 
    432     if (DOMWindow* window = m_frame->document()->domWindow())
    433         window->finishedLoading();
     431    m_frame->document()->domWindow()->finishedLoading();
    434432}
    435433
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r125772 r125815  
    360360                if (currentFocusedNode)
    361361                    currentFocusedNode->aboutToUnload();
    362                 if (m_frame->document()->domWindow() && m_pageDismissalEventBeingDispatched == NoDismissal) {
     362                if (m_pageDismissalEventBeingDispatched == NoDismissal) {
    363363                    if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide) {
    364364                        m_pageDismissalEventBeingDispatched = PageHideDismissal;
     
    467467    // since it may cause clients to attempt to render the frame.
    468468    if (!m_stateMachine.creatingInitialEmptyDocument()) {
    469         if (DOMWindow* window = m_frame->document()->domWindow()) {
    470             window->setStatus(String());
    471             window->setDefaultStatus(String());
    472         }
     469        DOMWindow* window = m_frame->document()->domWindow();
     470        window->setStatus(String());
     471        window->setDefaultStatus(String());
    473472    }
    474473
     
    19131912    // Delete old status bar messages (if it _was_ activated on last URL).
    19141913    if (m_frame->script()->canExecuteScripts(NotAboutToExecuteScript)) {
    1915         if (DOMWindow* window = m_frame->document()->domWindow()) {
    1916             window->setStatus(String());
    1917             window->setDefaultStatus(String());
    1918         }
     1914        DOMWindow* window = m_frame->document()->domWindow();
     1915        window->setStatus(String());
     1916        window->setDefaultStatus(String());
    19191917    }
    19201918}
Note: See TracChangeset for help on using the changeset viewer.