summaryrefslogtreecommitdiffstats
path: root/WebCore/loader/FrameLoader.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/loader/FrameLoader.h')
-rw-r--r--WebCore/loader/FrameLoader.h110
1 files changed, 58 insertions, 52 deletions
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index 47a56af..4650b03 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -1,5 +1,6 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,20 +30,12 @@
#ifndef FrameLoader_h
#define FrameLoader_h
-#include "CachedResource.h"
#include "CachePolicy.h"
#include "FormState.h"
#include "FrameLoaderTypes.h"
-#include "KURL.h"
-#include "StringHash.h"
-#include "Timer.h"
-#include <wtf/Forward.h>
-#include <wtf/HashSet.h>
-#include <wtf/HashMap.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/RefPtr.h>
#include "ResourceRequest.h"
+#include "Timer.h"
+
#if USE(LOW_BANDWIDTH_DISPLAY)
#include "CachedResourceClient.h"
#endif
@@ -51,10 +44,10 @@ namespace WebCore {
#if ENABLE(ARCHIVE) // ANDROID extension: disabled to reduce code size
class Archive;
- class ArchiveResource;
#endif
class AuthenticationChallenge;
class CachedPage;
+ class CachedResource;
class Document;
class DocumentLoader;
class Element;
@@ -68,13 +61,12 @@ namespace WebCore {
class IconLoader;
class IntSize;
class NavigationAction;
- class Node;
- class Page;
class RenderPart;
class ResourceError;
class ResourceLoader;
- class ResourceRequest;
class ResourceResponse;
+ class ScriptSourceCode;
+ class ScriptValue;
class SecurityOrigin;
class SharedBuffer;
class SubstituteData;
@@ -125,7 +117,7 @@ namespace WebCore {
class FrameLoader : Noncopyable
#if USE(LOW_BANDWIDTH_DISPLAY)
- , private CachedResourceClient
+ , private CachedResourceClient
#endif
{
public:
@@ -146,30 +138,30 @@ namespace WebCore {
void load(DocumentLoader*); // Calls loadWithDocumentLoader
void loadWithNavigationAction(const ResourceRequest&, const NavigationAction&, // Calls loadWithDocumentLoader()
- FrameLoadType, PassRefPtr<FormState>);
+ bool lockHistory, FrameLoadType, PassRefPtr<FormState>);
#ifdef ANDROID_USER_GESTURE
- void loadPostRequest(const ResourceRequest& inRequest, const String& referrer, // Called by loadFrameRequestWithFormAndValues(), calls loadWithNavigationAction
- const String& frameName, Event* event, PassRefPtr<FormState> prpFormState, bool userGesture);
+ void loadPostRequest(const ResourceRequest&, const String& referrer, // Called by loadFrameRequestWithFormAndValues(), calls loadWithNavigationAction
+ const String& frameName, bool lockHistory, FrameLoadType, Event*, PassRefPtr<FormState>, bool userGesture);
void loadURL(const KURL& newURL, const String& referrer, const String& frameName, // Called by loadFrameRequestWithFormAndValues(), calls loadWithNavigationAction or else dispatches to navigation policy delegate
- FrameLoadType, Event* event, PassRefPtr<FormState> prpFormState, bool userGesture);
+ bool lockHistory, FrameLoadType, Event*, PassRefPtr<FormState>, bool userGesture);
#else
- void loadPostRequest(const ResourceRequest& inRequest, const String& referrer, // Called by loadFrameRequestWithFormAndValues(), calls loadWithNavigationAction
- const String& frameName, Event* event, PassRefPtr<FormState> prpFormState);
+ void loadPostRequest(const ResourceRequest&, const String& referrer, // Called by loadFrameRequestWithFormAndValues(), calls loadWithNavigationAction
+ const String& frameName, bool lockHistory, FrameLoadType, Event*, PassRefPtr<FormState>);
void loadURL(const KURL& newURL, const String& referrer, const String& frameName, // Called by loadFrameRequestWithFormAndValues(), calls loadWithNavigationAction or else dispatches to navigation policy delegate
- FrameLoadType, Event* event, PassRefPtr<FormState> prpFormState);
+ bool lockHistory, FrameLoadType, Event*, PassRefPtr<FormState>);
#endif
+
void loadURLIntoChildFrame(const KURL&, const String& referer, Frame*);
- void loadFrameRequestWithFormState(const FrameLoadRequest&, bool lockHistory, Event*, PassRefPtr<FormState>);
- void loadFrameRequestWithFormAndValues(const FrameLoadRequest&, bool lockHistory, // Called by submitForm, calls loadPostRequest()
+ void loadFrameRequestWithFormAndValues(const FrameLoadRequest&, bool lockHistory, bool lockBackForwardList, // Called by submitForm, calls loadPostRequest()
Event*, HTMLFormElement*, const HashMap<String, String>& formValues);
- void load(const ResourceRequest&); // Called by WebFrame, calls (ResourceRequest, SubstituteData)
- void load(const ResourceRequest&, const SubstituteData&); // Called both by WebFrame and internally, calls (DocumentLoader*)
- void load(const ResourceRequest&, const String& frameName); // Called by WebPluginController
+ void load(const ResourceRequest&, bool lockHistory); // Called by WebFrame, calls (ResourceRequest, SubstituteData)
+ void load(const ResourceRequest&, const SubstituteData&, bool lockHistory); // Called both by WebFrame and internally, calls (DocumentLoader*)
+ void load(const ResourceRequest&, const String& frameName, bool lockHistory); // Called by WebPluginController
#if ENABLE(ARCHIVE) // ANDROID extension: disabled to reduce code size
void loadArchive(PassRefPtr<Archive> archive);
@@ -198,7 +190,6 @@ namespace WebCore {
bool frameHasLoaded() const;
int numPendingOrLoadingRequests(bool recurse) const;
- bool isReloading() const;
String referrer() const;
String outgoingReferrer() const;
String outgoingOrigin() const;
@@ -210,7 +201,8 @@ namespace WebCore {
DocumentLoader* provisionalDocumentLoader() const;
FrameState state() const;
static double timeOfLastCompletedLoad();
-
+
+ bool shouldUseCredentialStorage(ResourceLoader*);
void didReceiveAuthenticationChallenge(ResourceLoader*, const AuthenticationChallenge&);
void didCancelAuthenticationChallenge(ResourceLoader*, const AuthenticationChallenge&);
@@ -250,8 +242,8 @@ namespace WebCore {
void checkContentPolicy(const String& MIMEType, ContentPolicyDecisionFunction, void* argument);
void cancelContentPolicyCheck();
- void reload();
- void reloadAllowingStaleData(const String& overrideEncoding);
+ void reload(bool endToEndReload = false);
+ void reloadWithOverrideEncoding(const String& overrideEncoding);
void didReceiveServerRedirectForProvisionalLoadForFrame();
void finishedLoadingDocument(DocumentLoader*);
@@ -266,43 +258,52 @@ namespace WebCore {
void didChangeTitle(DocumentLoader*);
FrameLoadType loadType() const;
+ CachePolicy cachePolicy() const;
void didFirstLayout();
bool firstLayoutDone() const;
+ void didFirstVisuallyNonEmptyLayout();
+
void clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress);
- void clientRedirected(const KURL&, double delay, double fireDate, bool lockHistory, bool isJavaScriptFormAction);
+ void clientRedirected(const KURL&, double delay, double fireDate, bool lockBackForwardList, bool isJavaScriptFormAction);
bool shouldReload(const KURL& currentURL, const KURL& destinationURL);
+#if ENABLE(WML)
+ void setForceReloadWmlDeck(bool);
+#endif
bool isQuickRedirectComing() const;
void sendRemainingDelegateMessages(unsigned long identifier, const ResourceResponse&, int length, const ResourceError&);
void requestFromDelegate(ResourceRequest&, unsigned long& identifier, ResourceError&);
void loadedResourceFromMemoryCache(const CachedResource*);
+ void tellClientAboutPastMemoryCacheLoads();
void recursiveCheckLoadComplete();
void checkLoadComplete();
void detachFromParent();
void detachChildren();
- void addExtraFieldsToRequest(ResourceRequest&, bool isMainResource, bool alwaysFromRequest);
+ void addExtraFieldsToSubresourceRequest(ResourceRequest&);
+ void addExtraFieldsToMainResourceRequest(ResourceRequest&);
+
static void addHTTPOriginIfNeeded(ResourceRequest&, String origin);
- FrameLoaderClient* client() const;
+ FrameLoaderClient* client() const { return m_client; }
void setDefersLoading(bool);
- void changeLocation(const String& url, const String& referrer, bool lockHistory = true, bool userGesture = false);
- void changeLocation(const KURL&, const String& referrer, bool lockHistory = true, bool userGesture = false);
- void urlSelected(const ResourceRequest&, const String& target, Event*, bool lockHistory, bool userGesture);
- void urlSelected(const FrameLoadRequest&, Event*, bool lockHistory);
+ void changeLocation(const String& url, const String& referrer, bool lockHistory = true, bool lockBackForwardList = true, bool userGesture = false, bool refresh = false);
+ void changeLocation(const KURL&, const String& referrer, bool lockHistory = true, bool lockBackForwardList = true, bool userGesture = false, bool refresh = false);
+ void urlSelected(const ResourceRequest&, const String& target, Event*, bool lockHistory, bool lockBackForwardList, bool userGesture);
+ void urlSelected(const FrameLoadRequest&, Event*, bool lockHistory, bool lockBackForwardList);
bool requestFrame(HTMLFrameOwnerElement*, const String& url, const AtomicString& frameName);
Frame* loadSubframe(HTMLFrameOwnerElement*, const KURL&, const String& name, const String& referrer);
- void submitForm(const char* action, const String& url, PassRefPtr<FormData>, const String& target, const String& contentType, const String& boundary, Event*);
+ void submitForm(const char* action, const String& url, PassRefPtr<FormData>, const String& target, const String& contentType, const String& boundary, Event*, bool lockHistory, bool lockBackForwardList);
void submitFormAgain();
- void submitForm(const FrameLoadRequest&, Event*);
+ void submitForm(const FrameLoadRequest&, Event*, bool lockHistory, bool lockBackForwardList);
void stop();
void stopLoading(bool sendUnload);
@@ -319,7 +320,7 @@ namespace WebCore {
bool isScheduledLocationChangePending() const { return m_scheduledRedirection && isLocationChange(*m_scheduledRedirection); }
void scheduleHTTPRedirection(double delay, const String& url);
- void scheduleLocationChange(const String& url, const String& referrer, bool lockHistory = true, bool userGesture = false);
+ void scheduleLocationChange(const String& url, const String& referrer, bool lockHistory = true, bool lockBackForwardList = true, bool userGesture = false);
void scheduleRefresh(bool userGesture = false);
void scheduleHistoryNavigation(int steps);
@@ -342,8 +343,8 @@ namespace WebCore {
// Returns true if url is a JavaScript URL.
bool executeIfJavaScriptURL(const KURL& url, bool userGesture = false, bool replaceDocument = true);
- JSC::JSValue* executeScript(const String& url, int baseLine, const String& script);
- JSC::JSValue* executeScript(const String& script, bool forceUserGesture = false);
+ ScriptValue executeScript(const ScriptSourceCode&);
+ ScriptValue executeScript(const String& script, bool forceUserGesture = false);
void gotoAnchor();
bool gotoAnchor(const String& name); // returns true if the anchor was found
@@ -406,9 +407,6 @@ namespace WebCore {
KURL completeURL(const String& url);
- void didTellClientAboutLoad(const String& url);
- bool haveToldClientAboutLoad(const String& url);
-
KURL originalRequestURL() const;
void cancelAndClear();
@@ -472,6 +470,12 @@ namespace WebCore {
PassRefPtr<HistoryItem> createHistoryItem(bool useOriginal);
PassRefPtr<HistoryItem> createHistoryItemTree(Frame* targetFrame, bool clipAtTarget);
+ bool canCachePageContainingThisFrame();
+#ifndef NDEBUG
+ void logCanCachePageDecision();
+ bool logCanCacheFrameDecision(int indentLevel);
+#endif
+
void addBackForwardItemClippedAtTarget(bool doClip);
void restoreScrollPositionAndViewState();
void saveDocumentState();
@@ -484,7 +488,7 @@ namespace WebCore {
void updateHistoryForBackForwardNavigation();
void updateHistoryForReload();
void updateHistoryForStandardLoad();
- void updateHistoryForRedirectWithLockedHistory();
+ void updateHistoryForRedirectWithLockedBackForwardList();
void updateHistoryForClientRedirect();
void updateHistoryForCommit();
void updateHistoryForAnchorScroll();
@@ -511,6 +515,8 @@ namespace WebCore {
void updatePolicyBaseURL();
void setPolicyBaseURL(const KURL&);
+
+ void addExtraFieldsToRequest(ResourceRequest&, FrameLoadType loadType, bool isMainResource, bool cookiePolicyURLFromRequest);
// Also not cool.
void stopLoadingSubframes();
@@ -618,10 +624,6 @@ namespace WebCore {
String m_outgoingReferrer;
- CachePolicy m_cachePolicy;
-
- HashSet<String> m_urlsClientKnowsAbout;
-
OwnPtr<FormSubmission> m_deferredFormSubmission;
bool m_isExecutingJavaScriptFormAction;
@@ -694,6 +696,10 @@ namespace WebCore {
String m_pendingSourceInLowBandwidthDisplay;
HashSet<CachedResource*> m_externalRequestsInLowBandwidthDisplay;
#endif
+
+#if ENABLE(WML)
+ bool m_forceReloadWmlDeck;
+#endif
};
}