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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28399
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-12-04 Darin Adler <darin@apple.com>
+
+ 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.
+
2007-12-03 Antti Koivisto <antti@apple.com>
Reviewed by Adele.
, m_isDisplayingInitialEmptyDocument(false)
, m_committedFirstRealDocumentLoad(false)
, m_didPerformFirstNavigation(false)
+#ifndef NDEBUG
+ , m_didDispatchDidCommitLoad(false)
+#endif
#if USE(LOW_BANDWIDTH_DISPLAY)
, m_useLowBandwidthDisplay(true)
, m_finishedParsingDuringLowBandwidthDisplay(false)
}
}
-bool FrameLoader::privateBrowsingEnabled() const
-{
- return m_client->privateBrowsingEnabled();
-}
-
void FrameLoader::clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress)
{
// Note that -webView:didCancelClientRedirectForFrame: is called on the frame load delegate even if
return;
const ResourceError& error = dl->mainDocumentError();
+#ifndef NDEBUG
+ ASSERT(m_didDispatchDidCommitLoad);
+ m_didDispatchDidCommitLoad = false;
+#endif
if (!error.isNull())
m_client->dispatchDidFailLoad(error);
else
m_client->detachedFromParent4();
}
-void FrameLoader::dispatchDidChangeLocationWithinPage()
-{
- m_client->dispatchDidChangeLocationWithinPage();
-}
-
-void FrameLoader::dispatchDidFinishLoadToClient()
-{
- m_client->didFinishLoad();
-}
-
-void FrameLoader::updateGlobalHistoryForStandardLoad(const KURL& url)
-{
- m_client->updateGlobalHistoryForStandardLoad(url);
-}
-
-void FrameLoader::updateGlobalHistoryForReload(const KURL& url)
-{
- m_client->updateGlobalHistoryForReload(url);
-}
-
-bool FrameLoader::shouldGoToHistoryItem(HistoryItem* item) const
-{
- return m_client->shouldGoToHistoryItem(item);
-}
-
void FrameLoader::addExtraFieldsToRequest(ResourceRequest& request, bool mainResource, bool alwaysFromRequest)
{
applyUserAgent(request);
// we'll not go through a real load and reach Completed state.
checkLoadComplete();
- dispatchDidChangeLocationWithinPage();
+ m_client->dispatchDidChangeLocationWithinPage();
m_client->didFinishLoad();
}
// be necessary if we do the better fix described above.
documentLoader()->replaceRequestURLForAnchorScroll(itemURL);
- dispatchDidChangeLocationWithinPage();
+ m_client->dispatchDidChangeLocationWithinPage();
// FrameLoaderClient::didFinishLoad() tells the internal load delegate the load finished with no error
- dispatchDidFinishLoadToClient();
+ m_client->didFinishLoad();
} else {
// Remember this item so we can traverse any child items as child frames load
m_provisionalHistoryItem = item;
// Ultimately, history item navigations should go through the policy delegate. That's covered in:
// <rdar://problem/3979539> back/forward cache navigations should consult policy delegate
if (Page* page = m_frame->page())
- if (shouldGoToHistoryItem(targetItem)) {
+ if (m_client->shouldGoToHistoryItem(targetItem)) {
BackForwardList* bfList = page->backForwardList();
HistoryItem* currentItem = bfList->currentItem();
void FrameLoader::addHistoryForCurrentLocation()
{
- if (!privateBrowsingEnabled()) {
+ if (!m_frame->settings()->privateBrowsingEnabled()) {
// FIXME: <rdar://problem/4880065> - This will be a hook into the WebCore global history, and this loader/client call will be removed
- updateGlobalHistoryForStandardLoad(documentLoader()->urlForHistory());
+ m_client->updateGlobalHistoryForStandardLoad(documentLoader()->urlForHistory());
}
addBackForwardItemClippedAtTarget(true);
}
// FIXME: <rdar://problem/4880065> - This will be a hook into the WebCore global history, and this loader/client call will be removed
// Update the last visited time. Mostly interesting for URL autocompletion statistics.
- updateGlobalHistoryForReload(documentLoader()->originalURL());
+ m_client->updateGlobalHistoryForReload(documentLoader()->originalURL());
}
void FrameLoader::updateHistoryForRedirectWithLockedHistory()
void FrameLoader::dispatchDidCommitLoad()
{
+#ifndef NDEBUG
+ ASSERT(!m_didDispatchDidCommitLoad);
+ m_didDispatchDidCommitLoad = true;
+#endif
+
m_client->dispatchDidCommitLoad();
if (Page* page = m_frame->page())
void didReceiveData(ResourceLoader*, const char*, int, int lengthReceived);
void didFinishLoad(ResourceLoader*);
void didFailToLoad(ResourceLoader*, const ResourceError&);
- bool privateBrowsingEnabled() const;
const ResourceRequest& originalRequest() const;
const ResourceRequest& initialRequest() const;
void receivedMainResourceError(const ResourceError&, bool isComplete);
void cancelAndClear();
void setTitle(const String&);
- void dispatchDidChangeLocationWithinPage();
- void dispatchDidFinishLoadToClient();
- void updateGlobalHistoryForStandardLoad(const KURL&);
- void updateGlobalHistoryForReload(const KURL&);
- bool shouldGoToHistoryItem(HistoryItem*) const;
bool shouldTreatURLAsSameAsCurrent(const KURL&) const;
void commitProvisionalLoad(PassRefPtr<CachedPage>);
bool m_didPerformFirstNavigation;
+#ifndef NDEBUG
+ bool m_didDispatchDidCommitLoad;
+#endif
+
#if USE(LOW_BANDWIDTH_DISPLAY)
// whether to use low bandwidth dislay, set by client
bool m_useLowBandwidthDisplay;
String m_pendingSourceInLowBandwidthDisplay;
HashSet<CachedResource*> m_externalRequestsInLowBandwidthDisplay;
-#endif
+#endif
};
}
virtual bool hasHTMLView() const { return true; }
- virtual bool privateBrowsingEnabled() const = 0;
-
virtual void makeDocumentView() = 0;
virtual void makeRepresentation(DocumentLoader*) = 0;
virtual void setDocumentViewFromCachedPage(CachedPage*) = 0;
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* (C) 2007 Graham Dennis (graham.dennis@gmail.com)
*
* Redistribution and use in source and binary forms, with or without
#include "ProgressTracker.h"
#include "ResourceHandle.h"
#include "ResourceError.h"
+#include "Settings.h"
#include "SharedBuffer.h"
namespace WebCore {
void ResourceLoader::willCacheResponse(ResourceHandle*, CacheStoragePolicy& policy)
{
// When in private browsing mode, prevent caching to disk
- if (policy == StorageAllowed && frameLoader()->privateBrowsingEnabled())
+ if (policy == StorageAllowed && m_frame->settings()->privateBrowsingEnabled())
policy = StorageAllowedInMemoryOnly;
}
virtual bool hasWebView() const { return true; } // mainly for assertions
virtual bool hasFrameView() const { return true; } // ditto
- virtual bool privateBrowsingEnabled() const { return false; }
-
virtual void makeDocumentView() { }
virtual void makeRepresentation(DocumentLoader*) { }
virtual void forceLayout() { }
+2007-12-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp: Removed obsolete privateBrowsingEnabled.
+ * WebCoreSupport/FrameLoaderClientGtk.h: Ditto.
+
2007-12-04 Michael Natterer <mitch@imendio.com>
Reviewed by Alp Toker.
return item != 0;
}
-bool FrameLoaderClient::privateBrowsingEnabled() const { notImplemented(); return false; }
void FrameLoaderClient::makeDocumentView() { notImplemented(); }
void FrameLoaderClient::makeRepresentation(DocumentLoader*) { notImplemented(); }
void FrameLoaderClient::forceLayout() { notImplemented(); }
virtual bool hasWebView() const;
virtual bool hasFrameView() const;
- virtual bool privateBrowsingEnabled() const;
-
virtual void makeDocumentView();
virtual void makeRepresentation(WebCore::DocumentLoader*);
virtual void setDocumentViewFromCachedPage(WebCore::CachedPage*);
+2007-12-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ * WebCoreSupport/WebFrameLoaderClient.h: Removed obsolete privateBrowsingEnabled.
+ * WebCoreSupport/WebFrameLoaderClient.mm: Ditto.
+ * WebKit.order: Ditto.
+
2007-12-03 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
virtual bool hasWebView() const; // mainly for assertions
virtual bool hasFrameView() const; // ditto
- virtual bool privateBrowsingEnabled() const;
-
virtual void makeDocumentView();
virtual void makeRepresentation(WebCore::DocumentLoader*);
virtual bool hasHTMLView() const;
return m_webFrame->_private->webFrameView != nil;
}
-bool WebFrameLoaderClient::privateBrowsingEnabled() const
-{
- return [[getWebView(m_webFrame.get()) preferences] privateBrowsingEnabled];
-}
-
void WebFrameLoaderClient::makeDocumentView()
{
WebFrameView *v = m_webFrame->_private->webFrameView;
-[WebFrame(WebInternal) _bridge]
__ZN20WebDocumentLoaderMac15detachFromFrameEv
__ZN20WebDocumentLoaderMac17releaseDataSourceEv
-__ZNK20WebFrameLoaderClient22privateBrowsingEnabledEv
__ZN20WebFrameLoaderClient34updateGlobalHistoryForStandardLoadERKN7WebCore4KURLE
+[WebHistory optionalSharedHistory]
-[WebHistory addItemForURL:]
+2007-12-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp: Removed obsolete privateBrowsingEnabled.
+ * WebCoreSupport/FrameLoaderClientQt.h: Ditto.
+
2007-12-04 Holger Hans Peter Freyther <holger.freyther@trolltech.com>
Reviewed by Simon.
}
-bool FrameLoaderClientQt::privateBrowsingEnabled() const
-{
- notImplemented();
- return false;
-}
-
-
void FrameLoaderClientQt::makeDocumentView()
{
// qDebug() << "FrameLoaderClientQt::makeDocumentView" << m_frame->document();
virtual bool loadProvisionalItemFromPageCache();
virtual void invalidateCurrentItemPageCache();
- virtual bool privateBrowsingEnabled() const;
-
virtual void makeDocumentView();
virtual void makeRepresentation(DocumentLoader*);
virtual void forceLayout();
+2007-12-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ * WebFrame.cpp: Removed obsolete privateBrowsingEnabled.
+ * WebFrame.h: Ditto.
+
2007-12-04 Adam Roben <aroben@apple.com>
Windows build fix
return !!d->frameView();
}
-bool WebFrame::privateBrowsingEnabled() const
-{
- BOOL privateBrowsingEnabled = FALSE;
- COMPtr<IWebPreferences> preferences;
- if (SUCCEEDED(d->webView->preferences(&preferences)))
- preferences->privateBrowsingEnabled(&privateBrowsingEnabled);
- return !!privateBrowsingEnabled;
-}
-
void WebFrame::makeDocumentView()
{
ASSERT(core(this));
virtual void frameLoaderDestroyed();
virtual bool hasWebView() const;
virtual bool hasFrameView() const;
- virtual bool privateBrowsingEnabled() const;
virtual void makeDocumentView();
virtual void makeRepresentation(WebCore::DocumentLoader*);
virtual void forceLayout();
+2007-12-04 Darin Adler <darin@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ * WebKitSupport/FrameLoaderClientWx.cpp: Removed obsolete privateBrowsingEnabled.
+ * WebKitSupport/FrameLoaderClientWx.h: Ditto.
+
2007-12-03 Mark Rowe <mrowe@apple.com>
wx build fix.
}
-bool FrameLoaderClientWx::privateBrowsingEnabled() const
-{
- notImplemented();
- return false;
-}
-
-
void FrameLoaderClientWx::makeDocumentView()
{
notImplemented();
virtual bool provisionalItemIsTarget() const;
- virtual bool privateBrowsingEnabled() const;
-
virtual void makeDocumentView();
virtual void makeRepresentation(DocumentLoader*);
virtual void forceLayout();