diff options
Diffstat (limited to 'WebCore/loader/FrameLoader.h')
-rw-r--r-- | WebCore/loader/FrameLoader.h | 705 |
1 files changed, 356 insertions, 349 deletions
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h index 9ea3775..1323089 100644 --- a/WebCore/loader/FrameLoader.h +++ b/WebCore/loader/FrameLoader.h @@ -1,6 +1,7 @@ /* * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) + * Copyright (C) Research In Motion Limited 2009. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,9 +33,11 @@ #include "CachePolicy.h" #include "FrameLoaderTypes.h" +#include "HistoryController.h" #include "PolicyCallback.h" #include "PolicyChecker.h" #include "RedirectScheduler.h" +#include "ResourceLoadNotifier.h" #include "ResourceRequest.h" #include "ThreadableLoader.h" #include "Timer.h" @@ -42,6 +45,7 @@ namespace WebCore { +<<<<<<< HEAD:WebCore/loader/FrameLoader.h #if ENABLE(ARCHIVE) // ANDROID extension: disabled to reduce code size class Archive; #endif @@ -75,369 +79,369 @@ namespace WebCore { class SubstituteData; class TextResourceDecoder; class Widget; +======= +class Archive; +class AuthenticationChallenge; +class CachedFrameBase; +class CachedPage; +class CachedResource; +class Document; +class DocumentLoader; +class Event; +class FormData; +class FormState; +class Frame; +class FrameLoaderClient; +class HistoryItem; +class HTMLAppletElement; +class HTMLFormElement; +class HTMLFrameOwnerElement; +class IconLoader; +class IntSize; +class NavigationAction; +class RenderPart; +class ResourceError; +class ResourceLoader; +class ResourceResponse; +class ScriptSourceCode; +class ScriptString; +class ScriptValue; +class SecurityOrigin; +class SharedBuffer; +class SubstituteData; +class TextResourceDecoder; +class Widget; +>>>>>>> webkit.org at r50258.:WebCore/loader/FrameLoader.h + +struct FrameLoadRequest; +struct WindowFeatures; + +bool isBackForwardLoadType(FrameLoadType); + +class FrameLoader : public Noncopyable { +public: + FrameLoader(Frame*, FrameLoaderClient*); + ~FrameLoader(); + + void init(); + + Frame* frame() const { return m_frame; } + + PolicyChecker* policyChecker() const { return &m_policyChecker; } + HistoryController* history() const { return &m_history; } + ResourceLoadNotifier* notifier() const { return &m_notifer; } + + // FIXME: This is not cool, people. There are too many different functions that all start loads. + // We should aim to consolidate these into a smaller set of functions, and try to reuse more of + // the logic by extracting common code paths. + + void prepareForLoadStart(); + void setupForReplace(); + void setupForReplaceByMIMEType(const String& newMIMEType); + + void loadURLIntoChildFrame(const KURL&, const String& referer, Frame*); + + void loadFrameRequest(const FrameLoadRequest&, bool lockHistory, bool lockBackForwardList, // Called by submitForm, calls loadPostRequest and loadURL. + PassRefPtr<Event>, PassRefPtr<FormState>, ReferrerPolicy); + +<<<<<<< HEAD:WebCore/loader/FrameLoader.h + void load(const ResourceRequest&, bool lockHistory); // Called by WebFrame, calls load(ResourceRequest, SubstituteData). + void load(const ResourceRequest&, const SubstituteData&, bool lockHistory); // Called both by WebFrame and internally, calls load(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>); +#endif +======= + void load(const ResourceRequest&, bool lockHistory); // Called by WebFrame, calls load(ResourceRequest, SubstituteData). + void load(const ResourceRequest&, const SubstituteData&, bool lockHistory); // Called both by WebFrame and internally, calls load(DocumentLoader*). + void load(const ResourceRequest&, const String& frameName, bool lockHistory); // Called by WebPluginController. + + void loadArchive(PassRefPtr<Archive>); +>>>>>>> webkit.org at r50258.:WebCore/loader/FrameLoader.h + + static void reportLocalLoadFailed(Frame*, const String& url); - struct FrameLoadRequest; - struct WindowFeatures; + // Called by createWindow in JSDOMWindowBase.cpp, e.g. to fulfill a modal dialog creation + Frame* createWindow(FrameLoader* frameLoaderForFrameLookup, const FrameLoadRequest&, const WindowFeatures&, bool& created); - bool isBackForwardLoadType(FrameLoadType); + unsigned long loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data); - class FrameLoader : public Noncopyable { - public: - FrameLoader(Frame*, FrameLoaderClient*); - ~FrameLoader(); + bool canHandleRequest(const ResourceRequest&); - void init(); + // Also not cool. + void stopAllLoaders(DatabasePolicy = DatabasePolicyStop); + void stopForUserCancel(bool deferCheckLoadComplete = false); - Frame* frame() const { return m_frame; } + bool isLoadingMainResource() const { return m_isLoadingMainResource; } + bool isLoading() const; + bool frameHasLoaded() const; - PolicyChecker* policyChecker() { return &m_policyChecker; } + int numPendingOrLoadingRequests(bool recurse) const; + String referrer() const; + String outgoingReferrer() const; + String outgoingOrigin() const; - // FIXME: This is not cool, people. There are too many different functions that all start loads. - // We should aim to consolidate these into a smaller set of functions, and try to reuse more of - // the logic by extracting common code paths. + DocumentLoader* activeDocumentLoader() const; + DocumentLoader* documentLoader() const { return m_documentLoader.get(); } + DocumentLoader* policyDocumentLoader() const { return m_policyDocumentLoader.get(); } + DocumentLoader* provisionalDocumentLoader() const { return m_provisionalDocumentLoader.get(); } + FrameState state() const { return m_state; } + static double timeOfLastCompletedLoad(); - void prepareForLoadStart(); - void setupForReplace(); - void setupForReplaceByMIMEType(const String& newMIMEType); + bool shouldUseCredentialStorage(ResourceLoader*); + const ResourceRequest& originalRequest() const; + const ResourceRequest& initialRequest() const; + void receivedMainResourceError(const ResourceError&, bool isComplete); + void receivedData(const char*, int); - void loadURLIntoChildFrame(const KURL&, const String& referer, Frame*); + bool willLoadMediaElementURL(KURL&); - void loadFrameRequest(const FrameLoadRequest&, bool lockHistory, bool lockBackForwardList, // Called by submitForm, calls loadPostRequest and loadURL. - PassRefPtr<Event>, PassRefPtr<FormState>); + void handleFallbackContent(); + bool isStopping() const; - void load(const ResourceRequest&, bool lockHistory); // Called by WebFrame, calls load(ResourceRequest, SubstituteData). - void load(const ResourceRequest&, const SubstituteData&, bool lockHistory); // Called both by WebFrame and internally, calls load(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>); -#endif + void finishedLoading(); - static void reportLocalLoadFailed(Frame*, const String& url); + ResourceError cancelledError(const ResourceRequest&) const; + ResourceError fileDoesNotExistError(const ResourceResponse&) const; + ResourceError blockedError(const ResourceRequest&) const; + ResourceError cannotShowURLError(const ResourceRequest&) const; + ResourceError interruptionForPolicyChangeError(const ResourceRequest&); - // Called by createWindow in JSDOMWindowBase.cpp, e.g. to fulfill a modal dialog creation - Frame* createWindow(FrameLoader* frameLoaderForFrameLookup, const FrameLoadRequest&, const WindowFeatures&, bool& created); + bool isHostedByObjectElement() const; + bool isLoadingMainFrame() const; + bool canShowMIMEType(const String& MIMEType) const; + bool representationExistsForURLScheme(const String& URLScheme); + String generatedMIMETypeForURLScheme(const String& URLScheme); - unsigned long loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data); + void reload(bool endToEndReload = false); + void reloadWithOverrideEncoding(const String& overrideEncoding); - bool canHandleRequest(const ResourceRequest&); + void didReceiveServerRedirectForProvisionalLoadForFrame(); + void finishedLoadingDocument(DocumentLoader*); + void committedLoad(DocumentLoader*, const char*, int); + bool isReplacing() const; + void setReplacing(); + void revertToProvisional(DocumentLoader*); + void setMainDocumentError(DocumentLoader*, const ResourceError&); + void mainReceivedCompleteError(DocumentLoader*, const ResourceError&); + bool subframeIsLoading() const; + void willChangeTitle(DocumentLoader*); + void didChangeTitle(DocumentLoader*); - // Also not cool. - void stopAllLoaders(DatabasePolicy = DatabasePolicyStop); - void stopForUserCancel(bool deferCheckLoadComplete = false); + FrameLoadType loadType() const; + CachePolicy subresourceCachePolicy() const; - bool isLoadingMainResource() const { return m_isLoadingMainResource; } - bool isLoading() const; - bool frameHasLoaded() const; + void didFirstLayout(); + bool firstLayoutDone() const; - int numPendingOrLoadingRequests(bool recurse) const; - String referrer() const; - String outgoingReferrer() const; - String outgoingOrigin() const; + void didFirstVisuallyNonEmptyLayout(); - DocumentLoader* activeDocumentLoader() const; - DocumentLoader* documentLoader() const { return m_documentLoader.get(); } - DocumentLoader* policyDocumentLoader() const { return m_policyDocumentLoader.get(); } - DocumentLoader* provisionalDocumentLoader() const { return m_provisionalDocumentLoader.get(); } - FrameState state() const { return m_state; } - static double timeOfLastCompletedLoad(); - - bool shouldUseCredentialStorage(ResourceLoader*); - void didReceiveAuthenticationChallenge(ResourceLoader*, const AuthenticationChallenge&); - void didCancelAuthenticationChallenge(ResourceLoader*, const AuthenticationChallenge&); - - void assignIdentifierToInitialRequest(unsigned long identifier, const ResourceRequest&); - void willSendRequest(ResourceLoader*, ResourceRequest&, const ResourceResponse& redirectResponse); - void didReceiveResponse(ResourceLoader*, const ResourceResponse&); - void didReceiveData(ResourceLoader*, const char*, int, int lengthReceived); - void didFinishLoad(ResourceLoader*); - void didFailToLoad(ResourceLoader*, const ResourceError&); - void didLoadResourceByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString); - const ResourceRequest& originalRequest() const; - const ResourceRequest& initialRequest() const; - void receivedMainResourceError(const ResourceError&, bool isComplete); - void receivedData(const char*, int); - - bool willLoadMediaElementURL(KURL&); - - void handleFallbackContent(); - bool isStopping() const; - - void finishedLoading(); - - ResourceError cancelledError(const ResourceRequest&) const; - ResourceError fileDoesNotExistError(const ResourceResponse&) const; - ResourceError blockedError(const ResourceRequest&) const; - ResourceError cannotShowURLError(const ResourceRequest&) const; - ResourceError interruptionForPolicyChangeError(const ResourceRequest&); - - bool isHostedByObjectElement() const; - bool isLoadingMainFrame() const; - bool canShowMIMEType(const String& MIMEType) const; - bool representationExistsForURLScheme(const String& URLScheme); - String generatedMIMETypeForURLScheme(const String& URLScheme); - - void reload(bool endToEndReload = false); - void reloadWithOverrideEncoding(const String& overrideEncoding); - - void didReceiveServerRedirectForProvisionalLoadForFrame(); - void finishedLoadingDocument(DocumentLoader*); - void committedLoad(DocumentLoader*, const char*, int); - bool isReplacing() const; - void setReplacing(); - void revertToProvisional(DocumentLoader*); - void setMainDocumentError(DocumentLoader*, const ResourceError&); - void mainReceivedCompleteError(DocumentLoader*, const ResourceError&); - bool subframeIsLoading() const; - void willChangeTitle(DocumentLoader*); - void didChangeTitle(DocumentLoader*); - - FrameLoadType loadType() const; - CachePolicy subresourceCachePolicy() const; - - void didFirstLayout(); - bool firstLayoutDone() const; - - void didFirstVisuallyNonEmptyLayout(); - - void loadedResourceFromMemoryCache(const CachedResource*); - void tellClientAboutPastMemoryCacheLoads(); - - void checkLoadComplete(); - void detachFromParent(); - void detachViewsAndDocumentLoader(); - - void addExtraFieldsToSubresourceRequest(ResourceRequest&); - void addExtraFieldsToMainResourceRequest(ResourceRequest&); - - static void addHTTPOriginIfNeeded(ResourceRequest&, String origin); + void loadedResourceFromMemoryCache(const CachedResource*); + void tellClientAboutPastMemoryCacheLoads(); - FrameLoaderClient* client() const { return m_client; } + void checkLoadComplete(); + void detachFromParent(); + void detachViewsAndDocumentLoader(); - void setDefersLoading(bool); + void addExtraFieldsToSubresourceRequest(ResourceRequest&); + void addExtraFieldsToMainResourceRequest(ResourceRequest&); + + static void addHTTPOriginIfNeeded(ResourceRequest&, String origin); - 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, PassRefPtr<Event>, bool lockHistory, bool lockBackForwardList, bool userGesture); - bool requestFrame(HTMLFrameOwnerElement*, const String& url, const AtomicString& frameName); + FrameLoaderClient* client() const { return m_client; } - void submitForm(const char* action, const String& url, - PassRefPtr<FormData>, const String& target, const String& contentType, const String& boundary, - bool lockHistory, PassRefPtr<Event>, PassRefPtr<FormState>); + void setDefersLoading(bool); - void stop(); - void stopLoading(UnloadEventPolicy, DatabasePolicy = DatabasePolicyStop); - bool closeURL(); + 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, PassRefPtr<Event>, bool lockHistory, bool lockBackForwardList, bool userGesture, ReferrerPolicy); + bool requestFrame(HTMLFrameOwnerElement*, const String& url, const AtomicString& frameName); - void didExplicitOpen(); + void submitForm(const char* action, const String& url, + PassRefPtr<FormData>, const String& target, const String& contentType, const String& boundary, + bool lockHistory, PassRefPtr<Event>, PassRefPtr<FormState>); - KURL iconURL(); - void commitIconURLToIconDatabase(const KURL&); + void stop(); + void stopLoading(UnloadEventPolicy, DatabasePolicy = DatabasePolicyStop); + bool closeURL(); - KURL baseURL() const; + void didExplicitOpen(); - void begin(); - void begin(const KURL&, bool dispatchWindowObjectAvailable = true, SecurityOrigin* forcedSecurityOrigin = 0); + KURL iconURL(); + void commitIconURLToIconDatabase(const KURL&); - void write(const char* string, int length = -1, bool flush = false); - void write(const String&); - void end(); - void endIfNotLoadingMainResource(); + KURL baseURL() const; - void setEncoding(const String& encoding, bool userChosen); - String encoding() const; + void replaceDocument(const String&); - ScriptValue executeScript(const ScriptSourceCode&); - ScriptValue executeScript(const String& script, bool forceUserGesture = false); + void begin(); + void begin(const KURL&, bool dispatchWindowObjectAvailable = true, SecurityOrigin* forcedSecurityOrigin = 0); - void gotoAnchor(); + void write(const char* string, int length = -1, bool flush = false); + void write(const String&); + void end(); + void endIfNotLoadingMainResource(); - void tokenizerProcessedData(); + void setEncoding(const String& encoding, bool userChosen); + String encoding() const; - void handledOnloadEvents(); - String userAgent(const KURL&) const; + void tokenizerProcessedData(); - PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const HashMap<String, String>& args); + void handledOnloadEvents(); + String userAgent(const KURL&) const; - void dispatchWindowObjectAvailable(); - void dispatchDocumentElementAvailable(); - void restoreDocumentState(); + PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const HashMap<String, String>& args); - // Mixed content related functions. - static bool isMixedContent(SecurityOrigin* context, const KURL&); - void checkIfDisplayInsecureContent(SecurityOrigin* context, const KURL&); - void checkIfRunInsecureContent(SecurityOrigin* context, const KURL&); + void dispatchWindowObjectAvailable(); + void dispatchDocumentElementAvailable(); - Frame* opener(); - void setOpener(Frame*); + // Mixed content related functions. + static bool isMixedContent(SecurityOrigin* context, const KURL&); + void checkIfDisplayInsecureContent(SecurityOrigin* context, const KURL&); + void checkIfRunInsecureContent(SecurityOrigin* context, const KURL&); - bool isProcessingUserGesture(); + Frame* opener(); + void setOpener(Frame*); - void resetMultipleFormSubmissionProtection(); + bool isProcessingUserGesture(); - void addData(const char* bytes, int length); + void resetMultipleFormSubmissionProtection(); - void checkCallImplicitClose(); + void addData(const char* bytes, int length); - void frameDetached(); + void checkCallImplicitClose(); - const KURL& url() const { return m_URL; } + void frameDetached(); - void setResponseMIMEType(const String&); - const String& responseMIMEType() const; + const KURL& url() const { return m_URL; } - bool containsPlugins() const; + void setResponseMIMEType(const String&); + const String& responseMIMEType() const; - void loadDone(); - void finishedParsing(); - void checkCompleted(); + bool containsPlugins() const; - bool isComplete() const; + void loadDone(); + void finishedParsing(); + void checkCompleted(); - bool requestObject(RenderPart* frame, const String& url, const AtomicString& frameName, - const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues); + void checkDidPerformFirstNavigation(); - KURL completeURL(const String& url); + bool isComplete() const; - void cancelAndClear(); + bool requestObject(RenderPart* frame, const String& url, const AtomicString& frameName, + const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues); - void setTitle(const String&); + KURL completeURL(const String& url); - void commitProvisionalLoad(PassRefPtr<CachedPage>); - bool isLoadingFromCachedPage() const { return m_loadingFromCachedPage; } + void cancelAndClear(); - void goToItem(HistoryItem*, FrameLoadType); - void saveDocumentAndScrollState(); + void setTitle(const String&); - HistoryItem* currentHistoryItem(); - void setCurrentHistoryItem(PassRefPtr<HistoryItem>); + void commitProvisionalLoad(PassRefPtr<CachedPage>); + bool isLoadingFromCachedPage() const { return m_loadingFromCachedPage; } - bool committingFirstRealLoad() const { return !m_creatingInitialEmptyDocument && !m_committedFirstRealDocumentLoad; } - bool committedFirstRealDocumentLoad() const { return m_committedFirstRealDocumentLoad; } + bool committingFirstRealLoad() const { return !m_creatingInitialEmptyDocument && !m_committedFirstRealDocumentLoad; } + bool committedFirstRealDocumentLoad() const { return m_committedFirstRealDocumentLoad; } + bool creatingInitialEmptyDocument() const { return m_creatingInitialEmptyDocument; } - void iconLoadDecisionAvailable(); + void iconLoadDecisionAvailable(); - bool shouldAllowNavigation(Frame* targetFrame) const; - Frame* findFrameForNavigation(const AtomicString& name); + bool shouldAllowNavigation(Frame* targetFrame) const; + Frame* findFrameForNavigation(const AtomicString& name); - void startIconLoader(); + void startIconLoader(); - void applyUserAgent(ResourceRequest& request); + void applyUserAgent(ResourceRequest& request); - bool shouldInterruptLoadForXFrameOptions(const String&, const KURL&); + bool shouldInterruptLoadForXFrameOptions(const String&, const KURL&); - void open(CachedFrameBase&); + void open(CachedFrameBase&); - // FIXME: Should these really be public? - void completed(); - bool allAncestorsAreComplete() const; // including this - bool allChildrenAreComplete() const; // immediate children, not all descendants - void clientRedirected(const KURL&, double delay, double fireDate, bool lockBackForwardList); - void clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress); + // FIXME: Should these really be public? + void completed(); + bool allAncestorsAreComplete() const; // including this + bool allChildrenAreComplete() const; // immediate children, not all descendants + void clientRedirected(const KURL&, double delay, double fireDate, bool lockBackForwardList); + void clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress); + void loadItem(HistoryItem*, FrameLoadType); - // FIXME: This is public because this asynchronous callback from the FrameLoaderClient - // uses the policy machinery (and therefore is called via the PolicyChecker). Once we - // introduce a proper callback type for this function, we should make it private again. - void continueLoadAfterWillSubmitForm(); + // FIXME: This is public because this asynchronous callback from the FrameLoaderClient + // uses the policy machinery (and therefore is called via the PolicyChecker). Once we + // introduce a proper callback type for this function, we should make it private again. + void continueLoadAfterWillSubmitForm(); + + bool suppressOpenerInNewFrame() const { return m_suppressOpenerInNewFrame; } - private: - PassRefPtr<HistoryItem> createHistoryItem(bool useOriginal); - PassRefPtr<HistoryItem> createHistoryItemTree(Frame* targetFrame, bool clipAtTarget); + static ObjectContentType defaultObjectContentType(const KURL& url, const String& mimeType); - bool canCachePageContainingThisFrame(); +private: + bool canCachePageContainingThisFrame(); #ifndef NDEBUG - void logCanCachePageDecision(); - bool logCanCacheFrameDecision(int indentLevel); + void logCanCachePageDecision(); + bool logCanCacheFrameDecision(int indentLevel); #endif - void addBackForwardItemClippedAtTarget(bool doClip); - void restoreScrollPositionAndViewState(); - void saveDocumentState(); - void loadItem(HistoryItem*, FrameLoadType); - bool urlsMatchItem(HistoryItem*) const; - void invalidateCurrentItemCachedPage(); - void recursiveGoToItem(HistoryItem*, HistoryItem*, FrameLoadType); - bool childFramesMatchItem(HistoryItem*) const; - - void updateHistoryForBackForwardNavigation(); - void updateHistoryForReload(); - void updateHistoryForStandardLoad(); - void updateHistoryForRedirectWithLockedBackForwardList(); - void updateHistoryForClientRedirect(); - void updateHistoryForCommit(); - void updateHistoryForAnchorScroll(); - - void checkTimerFired(Timer<FrameLoader>*); - - void started(); - - bool shouldUsePlugin(const KURL&, const String& mimeType, bool hasFallback, bool& useFallback); - bool loadPlugin(RenderPart*, const KURL&, const String& mimeType, - const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback); - - bool loadProvisionalItemFromCachedPage(); - void cachePageForHistoryItem(HistoryItem*); - void pageHidden(); + void checkTimerFired(Timer<FrameLoader>*); - void receivedFirstData(); + void started(); - void updateFirstPartyForCookies(); - void setFirstPartyForCookies(const KURL&); - - void addExtraFieldsToRequest(ResourceRequest&, FrameLoadType loadType, bool isMainResource, bool cookiePolicyURLFromRequest); + bool shouldUsePlugin(const KURL&, const String& mimeType, bool hasFallback, bool& useFallback); + bool loadPlugin(RenderPart*, const KURL&, const String& mimeType, + const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback); + + bool loadProvisionalItemFromCachedPage(); + void cachePageForHistoryItem(HistoryItem*); + void pageHidden(); - // Also not cool. - void stopLoadingSubframes(); + void receivedFirstData(); - void clearProvisionalLoad(); - void markLoadComplete(); - void transitionToCommitted(PassRefPtr<CachedPage>); - void frameLoadCompleted(); + void updateFirstPartyForCookies(); + void setFirstPartyForCookies(const KURL&); + + void addExtraFieldsToRequest(ResourceRequest&, FrameLoadType loadType, bool isMainResource, bool cookiePolicyURLFromRequest); - void mainReceivedError(const ResourceError&, bool isComplete); + // Also not cool. + void stopLoadingSubframes(); - void setLoadType(FrameLoadType); + void clearProvisionalLoad(); + void markLoadComplete(); + void transitionToCommitted(PassRefPtr<CachedPage>); + void frameLoadCompleted(); - static void callContinueLoadAfterNavigationPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue); - static void callContinueLoadAfterNewWindowPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, bool shouldContinue); - static void callContinueFragmentScrollAfterNavigationPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue); + void mainReceivedError(const ResourceError&, bool isComplete); - void continueLoadAfterNavigationPolicy(const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue); - void continueLoadAfterNewWindowPolicy(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, bool shouldContinue); - void continueFragmentScrollAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue); + void setLoadType(FrameLoadType); - bool shouldScrollToAnchor(bool isFormSubmission, FrameLoadType, const KURL&); - void addHistoryItemForFragmentScroll(); + static void callContinueLoadAfterNavigationPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue); + static void callContinueLoadAfterNewWindowPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, bool shouldContinue); + static void callContinueFragmentScrollAfterNavigationPolicy(void*, const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue); - void checkLoadCompleteForThisFrame(); + void continueLoadAfterNavigationPolicy(const ResourceRequest&, PassRefPtr<FormState>, bool shouldContinue); + void continueLoadAfterNewWindowPolicy(const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, bool shouldContinue); + void continueFragmentScrollAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue); - void setDocumentLoader(DocumentLoader*); - void setPolicyDocumentLoader(DocumentLoader*); - void setProvisionalDocumentLoader(DocumentLoader*); + bool shouldScrollToAnchor(bool isFormSubmission, FrameLoadType, const KURL&); - void setState(FrameState); + void checkLoadCompleteForThisFrame(); - void closeOldDataSources(); - void open(CachedPage&); + void setDocumentLoader(DocumentLoader*); + void setPolicyDocumentLoader(DocumentLoader*); + void setProvisionalDocumentLoader(DocumentLoader*); - void updateHistoryAfterClientRedirect(); + void setState(FrameState); - void clear(bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true); + void closeOldDataSources(); + void open(CachedPage&); - bool shouldReloadToHandleUnreachableURL(DocumentLoader*); + void updateHistoryAfterClientRedirect(); - void dispatchDidCommitLoad(); - void dispatchAssignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&); - void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse); - void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&); - void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int length); - void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier); + void clear(bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true); - void loadWithDocumentLoader(DocumentLoader*, FrameLoadType, PassRefPtr<FormState>); // Calls continueLoadAfterNavigationPolicy - void load(DocumentLoader*); // Calls loadWithDocumentLoader + bool shouldReloadToHandleUnreachableURL(DocumentLoader*); - void loadWithNavigationAction(const ResourceRequest&, const NavigationAction&, // Calls loadWithDocumentLoader - bool lockHistory, FrameLoadType, PassRefPtr<FormState>); + void dispatchDidCommitLoad(); +<<<<<<< HEAD:WebCore/loader/FrameLoader.h #ifdef ANDROID_USER_GESTURE void loadPostRequest(const ResourceRequest&, const String& referrer, // Called by loadFrameRequest, calls loadWithNavigationAction const String& frameName, bool lockHistory, FrameLoadType, PassRefPtr<Event>, PassRefPtr<FormState>, bool); @@ -449,118 +453,121 @@ namespace WebCore { void loadURL(const KURL&, const String& referrer, const String& frameName, // Called by loadFrameRequest, calls loadWithNavigationAction or dispatches to navigation policy delegate bool lockHistory, FrameLoadType, PassRefPtr<Event>, PassRefPtr<FormState>); #endif +======= + void loadWithDocumentLoader(DocumentLoader*, FrameLoadType, PassRefPtr<FormState>); // Calls continueLoadAfterNavigationPolicy + void load(DocumentLoader*); // Calls loadWithDocumentLoader +>>>>>>> webkit.org at r50258.:WebCore/loader/FrameLoader.h - bool shouldReload(const KURL& currentURL, const KURL& destinationURL); + void loadWithNavigationAction(const ResourceRequest&, const NavigationAction&, // Calls loadWithDocumentLoader + bool lockHistory, FrameLoadType, PassRefPtr<FormState>); - void sendRemainingDelegateMessages(unsigned long identifier, const ResourceResponse&, int length, const ResourceError&); - void requestFromDelegate(ResourceRequest&, unsigned long& identifier, ResourceError&); + void loadPostRequest(const ResourceRequest&, const String& referrer, // Called by loadFrameRequest, calls loadWithNavigationAction + const String& frameName, bool lockHistory, FrameLoadType, PassRefPtr<Event>, PassRefPtr<FormState>); + void loadURL(const KURL&, const String& referrer, const String& frameName, // Called by loadFrameRequest, calls loadWithNavigationAction or dispatches to navigation policy delegate + bool lockHistory, FrameLoadType, PassRefPtr<Event>, PassRefPtr<FormState>); - void recursiveCheckLoadComplete(); + bool shouldReload(const KURL& currentURL, const KURL& destinationURL); - void detachChildren(); - void closeAndRemoveChild(Frame*); + void requestFromDelegate(ResourceRequest&, unsigned long& identifier, ResourceError&); - Frame* loadSubframe(HTMLFrameOwnerElement*, const KURL&, const String& name, const String& referrer); + void recursiveCheckLoadComplete(); - // Returns true if argument is a JavaScript URL. - bool executeIfJavaScriptURL(const KURL&, bool userGesture = false, bool replaceDocument = true); + void detachChildren(); + void closeAndRemoveChild(Frame*); - bool gotoAnchor(const String& name); // returns true if the anchor was found - void scrollToAnchor(const KURL&); + Frame* loadSubframe(HTMLFrameOwnerElement*, const KURL&, const String& name, const String& referrer); - void provisionalLoadStarted(); + void scrollToAnchor(const KURL&); - bool canCachePage(); + void provisionalLoadStarted(); - bool didOpenURL(const KURL&); + bool canCachePage(); - void scheduleCheckCompleted(); - void scheduleCheckLoadComplete(); - void startCheckCompleteTimer(); + bool didOpenURL(const KURL&); - KURL originalRequestURL() const; + void scheduleCheckCompleted(); + void scheduleCheckLoadComplete(); + void startCheckCompleteTimer(); - bool shouldTreatURLAsSameAsCurrent(const KURL&) const; + KURL originalRequestURL() const; - void saveScrollPositionAndViewStateToItem(HistoryItem*); + bool shouldTreatURLAsSameAsCurrent(const KURL&) const; - Frame* m_frame; - FrameLoaderClient* m_client; + Frame* m_frame; + FrameLoaderClient* m_client; - PolicyChecker m_policyChecker; + mutable PolicyChecker m_policyChecker; + mutable HistoryController m_history; + mutable ResourceLoadNotifier m_notifer; - FrameState m_state; - FrameLoadType m_loadType; + FrameState m_state; + FrameLoadType m_loadType; - // Document loaders for the three phases of frame loading. Note that while - // a new request is being loaded, the old document loader may still be referenced. - // E.g. while a new request is in the "policy" state, the old document loader may - // be consulted in particular as it makes sense to imply certain settings on the new loader. - RefPtr<DocumentLoader> m_documentLoader; - RefPtr<DocumentLoader> m_provisionalDocumentLoader; - RefPtr<DocumentLoader> m_policyDocumentLoader; + // Document loaders for the three phases of frame loading. Note that while + // a new request is being loaded, the old document loader may still be referenced. + // E.g. while a new request is in the "policy" state, the old document loader may + // be consulted in particular as it makes sense to imply certain settings on the new loader. + RefPtr<DocumentLoader> m_documentLoader; + RefPtr<DocumentLoader> m_provisionalDocumentLoader; + RefPtr<DocumentLoader> m_policyDocumentLoader; - bool m_delegateIsHandlingProvisionalLoadError; + bool m_delegateIsHandlingProvisionalLoadError; - bool m_firstLayoutDone; - bool m_quickRedirectComing; - bool m_sentRedirectNotification; - bool m_inStopAllLoaders; + bool m_firstLayoutDone; + bool m_quickRedirectComing; + bool m_sentRedirectNotification; + bool m_inStopAllLoaders; - String m_outgoingReferrer; + String m_outgoingReferrer; - bool m_isExecutingJavaScriptFormAction; - bool m_isRunningScript; + bool m_isExecutingJavaScriptFormAction; - String m_responseMIMEType; + String m_responseMIMEType; - bool m_didCallImplicitClose; - bool m_wasUnloadEventEmitted; - bool m_unloadEventBeingDispatched; - bool m_isComplete; - bool m_isLoadingMainResource; + bool m_didCallImplicitClose; + bool m_wasUnloadEventEmitted; + bool m_unloadEventBeingDispatched; + bool m_isComplete; + bool m_isLoadingMainResource; - KURL m_URL; - KURL m_workingURL; + KURL m_URL; + KURL m_workingURL; - OwnPtr<IconLoader> m_iconLoader; - bool m_mayLoadIconLater; + OwnPtr<IconLoader> m_iconLoader; + bool m_mayLoadIconLater; - bool m_cancellingWithLoadInProgress; + bool m_cancellingWithLoadInProgress; - bool m_needsClear; - bool m_receivedData; + bool m_needsClear; + bool m_receivedData; - bool m_encodingWasChosenByUser; - String m_encoding; - RefPtr<TextResourceDecoder> m_decoder; + bool m_encodingWasChosenByUser; + String m_encoding; + RefPtr<TextResourceDecoder> m_decoder; - bool m_containsPlugIns; + bool m_containsPlugIns; - KURL m_submittedFormURL; + KURL m_submittedFormURL; - Timer<FrameLoader> m_checkTimer; - bool m_shouldCallCheckCompleted; - bool m_shouldCallCheckLoadComplete; + Timer<FrameLoader> m_checkTimer; + bool m_shouldCallCheckCompleted; + bool m_shouldCallCheckLoadComplete; - Frame* m_opener; - HashSet<Frame*> m_openedFrames; + Frame* m_opener; + HashSet<Frame*> m_openedFrames; - bool m_creatingInitialEmptyDocument; - bool m_isDisplayingInitialEmptyDocument; - bool m_committedFirstRealDocumentLoad; + bool m_creatingInitialEmptyDocument; + bool m_isDisplayingInitialEmptyDocument; + bool m_committedFirstRealDocumentLoad; - RefPtr<HistoryItem> m_currentHistoryItem; - RefPtr<HistoryItem> m_previousHistoryItem; - RefPtr<HistoryItem> m_provisionalHistoryItem; - - bool m_didPerformFirstNavigation; - bool m_loadingFromCachedPage; - + bool m_didPerformFirstNavigation; + bool m_loadingFromCachedPage; + bool m_suppressOpenerInNewFrame; + #ifndef NDEBUG - bool m_didDispatchDidCommitLoad; + bool m_didDispatchDidCommitLoad; #endif - }; +}; } // namespace WebCore |