Changeset 28399 in webkit


Ignore:
Timestamp:
Dec 4, 2007 11:47:13 AM (16 years ago)
Author:
Darin Adler
Message:

WebCore:

Reviewed by Kevin Decker.

  • added an assertion for a situation that leads to a Safari assertion: a commit that is not followed by a load completion
  • removed some unneeded FrameLoader stuff -- maybe some day we'll get this class cut down to size
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::FrameLoader): Added boolean for assertion. (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Added code to assert that we already sent a commit before sending a complete. (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy): Call client directly instead of indirecting through a function. (WebCore::FrameLoader::loadItem): Ditto. (WebCore::FrameLoader::goToItem): Ditto. (WebCore::FrameLoader::addHistoryForCurrentLocation): Get the private browsing state from Settings instead of FrameLoaderClient. Also call client directly instead of indirecting through a function. (WebCore::FrameLoader::updateHistoryForReload): Call client directly instead of indirecting through a function. (WebCore::FrameLoader::dispatchDidCommitLoad): Added code to assert that we did not yet send a commit and set the flag that will be used to check that we don't do this twice in a row without an intervening completion call.
  • loader/FrameLoader.h: Added a boolean for the assertion. Removed six now-unneeded functions.
  • loader/FrameLoaderClient.h: Removed now-unneeded privateBrowsingEnabled function.
  • loader/ResourceLoader.cpp: (WebCore::ResourceLoader::willCacheResponse): Get the private browsing state from Settings instead of FrameLoaderClient.
  • svg/graphics/SVGImageEmptyClients.h: Removed obsolete privateBrowsingEnabled.

WebKit/gtk:

Reviewed by Kevin Decker.

  • WebCoreSupport/FrameLoaderClientGtk.cpp: Removed obsolete privateBrowsingEnabled.
  • WebCoreSupport/FrameLoaderClientGtk.h: Ditto.

WebKit/mac:

Reviewed by Kevin Decker.

  • WebCoreSupport/WebFrameLoaderClient.h: Removed obsolete privateBrowsingEnabled.
  • WebCoreSupport/WebFrameLoaderClient.mm: Ditto.
  • WebKit.order: Ditto.

WebKit/qt:

Reviewed by Kevin Decker.

  • WebCoreSupport/FrameLoaderClientQt.cpp: Removed obsolete privateBrowsingEnabled.
  • WebCoreSupport/FrameLoaderClientQt.h: Ditto.

WebKit/win:

Reviewed by Kevin Decker.

  • WebFrame.cpp: Removed obsolete privateBrowsingEnabled.
  • WebFrame.h: Ditto.

WebKit/wx:

Reviewed by Kevin Decker.

  • WebKitSupport/FrameLoaderClientWx.cpp: Removed obsolete privateBrowsingEnabled.
  • WebKitSupport/FrameLoaderClientWx.h: Ditto.
Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r28397 r28399  
     12007-12-04  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Kevin Decker.
     4
     5        - added an assertion for a situation that leads to a Safari assertion:
     6          a commit that is not followed by a load completion
     7
     8        - removed some unneeded FrameLoader stuff -- maybe some day we'll get this
     9          class cut down to size
     10
     11        * loader/FrameLoader.cpp:
     12        (WebCore::FrameLoader::FrameLoader): Added boolean for assertion.
     13        (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Added code to assert
     14        that we already sent a commit before sending a complete.
     15        (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy): Call
     16        client directly instead of indirecting through a function.
     17        (WebCore::FrameLoader::loadItem): Ditto.
     18        (WebCore::FrameLoader::goToItem): Ditto.
     19        (WebCore::FrameLoader::addHistoryForCurrentLocation): Get the private browsing
     20        state from Settings instead of FrameLoaderClient. Also call client directly
     21        instead of indirecting through a function.
     22        (WebCore::FrameLoader::updateHistoryForReload): Call client directly instead
     23        of indirecting through a function.
     24        (WebCore::FrameLoader::dispatchDidCommitLoad): Added code to assert
     25        that we did not yet send a commit and set the flag that will be used to check
     26        that we don't do this twice in a row without an intervening completion call.
     27
     28        * loader/FrameLoader.h: Added a boolean for the assertion. Removed six
     29        now-unneeded functions.
     30
     31        * loader/FrameLoaderClient.h: Removed now-unneeded privateBrowsingEnabled function.
     32
     33        * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::willCacheResponse): Get
     34        the private browsing state from Settings instead of FrameLoaderClient.
     35
     36        * svg/graphics/SVGImageEmptyClients.h: Removed obsolete privateBrowsingEnabled.
     37
    1382007-12-03  Antti Koivisto  <antti@apple.com>
    239
  • trunk/WebCore/loader/FrameLoader.cpp

    r28349 r28399  
    254254    , m_committedFirstRealDocumentLoad(false)
    255255    , m_didPerformFirstNavigation(false)
     256#ifndef NDEBUG
     257    , m_didDispatchDidCommitLoad(false)
     258#endif
    256259#if USE(LOW_BANDWIDTH_DISPLAY)
    257260    , m_useLowBandwidthDisplay(true)
     
    26512654}
    26522655
    2653 bool FrameLoader::privateBrowsingEnabled() const
    2654 {
    2655     return m_client->privateBrowsingEnabled();
    2656 }
    2657 
    26582656void FrameLoader::clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress)
    26592657{
     
    29692967
    29702968            const ResourceError& error = dl->mainDocumentError();
     2969#ifndef NDEBUG
     2970            ASSERT(m_didDispatchDidCommitLoad);
     2971            m_didDispatchDidCommitLoad = false;
     2972#endif
    29712973            if (!error.isNull())
    29722974                m_client->dispatchDidFailLoad(error);
     
    31953197#endif
    31963198    m_client->detachedFromParent4();
    3197 }
    3198 
    3199 void FrameLoader::dispatchDidChangeLocationWithinPage()
    3200 {
    3201     m_client->dispatchDidChangeLocationWithinPage();
    3202 }
    3203 
    3204 void FrameLoader::dispatchDidFinishLoadToClient()
    3205 {
    3206     m_client->didFinishLoad();
    3207 }
    3208 
    3209 void FrameLoader::updateGlobalHistoryForStandardLoad(const KURL& url)
    3210 {
    3211     m_client->updateGlobalHistoryForStandardLoad(url);
    3212 }
    3213 
    3214 void FrameLoader::updateGlobalHistoryForReload(const KURL& url)
    3215 {
    3216     m_client->updateGlobalHistoryForReload(url);
    3217 }
    3218 
    3219 bool FrameLoader::shouldGoToHistoryItem(HistoryItem* item) const
    3220 {
    3221     return m_client->shouldGoToHistoryItem(item);
    32223199}
    32233200
     
    34493426        checkLoadComplete();
    34503427 
    3451     dispatchDidChangeLocationWithinPage();
     3428    m_client->dispatchDidChangeLocationWithinPage();
    34523429    m_client->didFinishLoad();
    34533430}
     
    40183995        documentLoader()->replaceRequestURLForAnchorScroll(itemURL);
    40193996
    4020         dispatchDidChangeLocationWithinPage();
     3997        m_client->dispatchDidChangeLocationWithinPage();
    40213998       
    40223999        // FrameLoaderClient::didFinishLoad() tells the internal load delegate the load finished with no error
    4023         dispatchDidFinishLoadToClient();
     4000        m_client->didFinishLoad();
    40244001    } else {
    40254002        // Remember this item so we can traverse any child items as child frames load
     
    41344111    // <rdar://problem/3979539> back/forward cache navigations should consult policy delegate
    41354112    if (Page* page = m_frame->page())
    4136         if (shouldGoToHistoryItem(targetItem)) {
     4113        if (m_client->shouldGoToHistoryItem(targetItem)) {
    41374114            BackForwardList* bfList = page->backForwardList();
    41384115            HistoryItem* currentItem = bfList->currentItem();
     
    42234200void FrameLoader::addHistoryForCurrentLocation()
    42244201{
    4225     if (!privateBrowsingEnabled()) {
     4202    if (!m_frame->settings()->privateBrowsingEnabled()) {
    42264203        // FIXME: <rdar://problem/4880065> - This will be a hook into the WebCore global history, and this loader/client call will be removed
    4227         updateGlobalHistoryForStandardLoad(documentLoader()->urlForHistory());
     4204        m_client->updateGlobalHistoryForStandardLoad(documentLoader()->urlForHistory());
    42284205    }
    42294206    addBackForwardItemClippedAtTarget(true);
     
    43034280    // FIXME: <rdar://problem/4880065> - This will be a hook into the WebCore global history, and this loader/client call will be removed
    43044281    // Update the last visited time. Mostly interesting for URL autocompletion statistics.
    4305     updateGlobalHistoryForReload(documentLoader()->originalURL());
     4282    m_client->updateGlobalHistoryForReload(documentLoader()->originalURL());
    43064283}
    43074284
     
    46574634void FrameLoader::dispatchDidCommitLoad()
    46584635{
     4636#ifndef NDEBUG
     4637    ASSERT(!m_didDispatchDidCommitLoad);
     4638    m_didDispatchDidCommitLoad = true;
     4639#endif
     4640
    46594641    m_client->dispatchDidCommitLoad();
    46604642
  • trunk/WebCore/loader/FrameLoader.h

    r28343 r28399  
    202202        void didFinishLoad(ResourceLoader*);
    203203        void didFailToLoad(ResourceLoader*, const ResourceError&);
    204         bool privateBrowsingEnabled() const;
    205204        const ResourceRequest& originalRequest() const;
    206205        const ResourceRequest& initialRequest() const;
     
    394393
    395394        void setTitle(const String&);
    396         void dispatchDidChangeLocationWithinPage();
    397        
    398         void dispatchDidFinishLoadToClient();
    399         void updateGlobalHistoryForStandardLoad(const KURL&);
    400         void updateGlobalHistoryForReload(const KURL&);
    401         bool shouldGoToHistoryItem(HistoryItem*) const;
     395       
    402396        bool shouldTreatURLAsSameAsCurrent(const KURL&) const;
    403397
     
    648642        bool m_didPerformFirstNavigation;
    649643
     644#ifndef NDEBUG
     645        bool m_didDispatchDidCommitLoad;
     646#endif
     647
    650648#if USE(LOW_BANDWIDTH_DISPLAY)
    651649        // whether to use low bandwidth dislay, set by client
     
    661659        String m_pendingSourceInLowBandwidthDisplay;       
    662660        HashSet<CachedResource*> m_externalRequestsInLowBandwidthDisplay;
    663 #endif   
     661#endif
    664662    };
    665663
  • trunk/WebCore/loader/FrameLoaderClient.h

    r27612 r28399  
    7979        virtual bool hasHTMLView() const { return true; }
    8080
    81         virtual bool privateBrowsingEnabled() const = 0;
    82 
    8381        virtual void makeDocumentView() = 0;
    8482        virtual void makeRepresentation(DocumentLoader*) = 0;
  • trunk/WebCore/loader/ResourceLoader.cpp

    r25274 r28399  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 *           (C) 2007 Graham Dennis (graham.dennis@gmail.com)
    44 *
     
    3838#include "ResourceHandle.h"
    3939#include "ResourceError.h"
     40#include "Settings.h"
    4041#include "SharedBuffer.h"
    4142
     
    396397{
    397398    // When in private browsing mode, prevent caching to disk
    398     if (policy == StorageAllowed && frameLoader()->privateBrowsingEnabled())
     399    if (policy == StorageAllowed && m_frame->settings()->privateBrowsingEnabled())
    399400        policy = StorageAllowedInMemoryOnly;   
    400401}
  • trunk/WebCore/svg/graphics/SVGImageEmptyClients.h

    r28319 r28399  
    129129    virtual bool hasFrameView() const { return true; } // ditto
    130130   
    131     virtual bool privateBrowsingEnabled() const { return false; }
    132    
    133131    virtual void makeDocumentView() { }
    134132    virtual void makeRepresentation(DocumentLoader*) { }
  • trunk/WebKit/gtk/ChangeLog

    r28396 r28399  
     12007-12-04  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Kevin Decker.
     4
     5        * WebCoreSupport/FrameLoaderClientGtk.cpp: Removed obsolete privateBrowsingEnabled.
     6        * WebCoreSupport/FrameLoaderClientGtk.h: Ditto.
     7
    182007-12-04  Michael Natterer  <mitch@imendio.com>
    29
  • trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp

    r28336 r28399  
    428428}
    429429
    430 bool FrameLoaderClient::privateBrowsingEnabled() const { notImplemented(); return false; }
    431430void FrameLoaderClient::makeDocumentView() { notImplemented(); }
    432431void FrameLoaderClient::makeRepresentation(DocumentLoader*) { notImplemented(); }
  • trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h

    r28273 r28399  
    4747        virtual bool hasWebView() const;
    4848        virtual bool hasFrameView() const;
    49 
    50         virtual bool privateBrowsingEnabled() const;
    5149
    5250        virtual void makeDocumentView();
  • trunk/WebKit/mac/ChangeLog

    r28383 r28399  
     12007-12-04  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Kevin Decker.
     4
     5        * WebCoreSupport/WebFrameLoaderClient.h: Removed obsolete privateBrowsingEnabled.
     6        * WebCoreSupport/WebFrameLoaderClient.mm: Ditto.
     7        * WebKit.order: Ditto.
     8
    192007-12-03  Dan Bernstein  <mitz@apple.com>
    210
  • trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h

    r27616 r28399  
    6363    virtual bool hasFrameView() const; // ditto
    6464
    65     virtual bool privateBrowsingEnabled() const;
    66 
    6765    virtual void makeDocumentView();
    6866    virtual void makeRepresentation(WebCore::DocumentLoader*);
  • trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r28365 r28399  
    148148}
    149149
    150 bool WebFrameLoaderClient::privateBrowsingEnabled() const
    151 {
    152     return [[getWebView(m_webFrame.get()) preferences] privateBrowsingEnabled];
    153 }
    154 
    155150void WebFrameLoaderClient::makeDocumentView()
    156151{
  • trunk/WebKit/mac/WebKit.order

    r27496 r28399  
    430430__ZN20WebDocumentLoaderMac15detachFromFrameEv
    431431__ZN20WebDocumentLoaderMac17releaseDataSourceEv
    432 __ZNK20WebFrameLoaderClient22privateBrowsingEnabledEv
    433432__ZN20WebFrameLoaderClient34updateGlobalHistoryForStandardLoadERKN7WebCore4KURLE
    434433+[WebHistory optionalSharedHistory]
  • trunk/WebKit/qt/ChangeLog

    r28387 r28399  
     12007-12-04  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Kevin Decker.
     4
     5        * WebCoreSupport/FrameLoaderClientQt.cpp: Removed obsolete privateBrowsingEnabled.
     6        * WebCoreSupport/FrameLoaderClientQt.h: Ditto.
     7
    182007-12-04  Holger Hans Peter Freyther <holger.freyther@trolltech.com>
    29
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r27915 r28399  
    160160
    161161
    162 bool FrameLoaderClientQt::privateBrowsingEnabled() const
    163 {
    164     notImplemented();
    165     return false;
    166 }
    167 
    168 
    169162void FrameLoaderClientQt::makeDocumentView()
    170163{
  • trunk/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h

    r27780 r28399  
    8181        virtual void invalidateCurrentItemPageCache();
    8282
    83         virtual bool privateBrowsingEnabled() const;
    84 
    8583        virtual void makeDocumentView();
    8684        virtual void makeRepresentation(DocumentLoader*);
  • trunk/WebKit/win/ChangeLog

    r28391 r28399  
     12007-12-04  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Kevin Decker.
     4
     5        * WebFrame.cpp: Removed obsolete privateBrowsingEnabled.
     6        * WebFrame.h: Ditto.
     7
    182007-12-04  Adam Roben  <aroben@apple.com>
    29
  • trunk/WebKit/win/WebFrame.cpp

    r28334 r28399  
    14941494}
    14951495
    1496 bool WebFrame::privateBrowsingEnabled() const
    1497 {
    1498     BOOL privateBrowsingEnabled = FALSE;
    1499     COMPtr<IWebPreferences> preferences;
    1500     if (SUCCEEDED(d->webView->preferences(&preferences)))
    1501         preferences->privateBrowsingEnabled(&privateBrowsingEnabled);
    1502     return !!privateBrowsingEnabled;
    1503 }
    1504 
    15051496void WebFrame::makeDocumentView()
    15061497{
  • trunk/WebKit/win/WebFrame.h

    r27612 r28399  
    230230    virtual bool hasWebView() const;
    231231    virtual bool hasFrameView() const;
    232     virtual bool privateBrowsingEnabled() const;
    233232    virtual void makeDocumentView();
    234233    virtual void makeRepresentation(WebCore::DocumentLoader*);
  • trunk/WebKit/wx/ChangeLog

    r28339 r28399  
     12007-12-04  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Kevin Decker.
     4
     5        * WebKitSupport/FrameLoaderClientWx.cpp: Removed obsolete privateBrowsingEnabled.
     6        * WebKitSupport/FrameLoaderClientWx.h: Ditto.
     7
    182007-12-03  Mark Rowe  <mrowe@apple.com>
    29
  • trunk/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp

    r27899 r28399  
    132132
    133133
    134 bool FrameLoaderClientWx::privateBrowsingEnabled() const
    135 {
    136     notImplemented();
    137     return false;
    138 }
    139 
    140 
    141134void FrameLoaderClientWx::makeDocumentView()
    142135{
  • trunk/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h

    r27899 r28399  
    6666        virtual bool provisionalItemIsTarget() const;
    6767
    68         virtual bool privateBrowsingEnabled() const;
    69 
    7068        virtual void makeDocumentView();
    7169        virtual void makeRepresentation(DocumentLoader*);
Note: See TracChangeset for help on using the changeset viewer.