WebCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Oct 2006 05:35:02 +0000 (05:35 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Oct 2006 05:35:02 +0000 (05:35 +0000)
        Reviewed by Anders.

        - converted WebFrameLoaderClient to C++
        - renamed frame->frameLoader() function to frame->loader()
        - renamed [bridge impl] to [bridge _frame]
        - removed some bridge methods

        * WebCore.exp: Added more exports.
        * WebCore.xcodeproj/project.pbxproj: Made FrameTree.h private instead of project-internal
        so it can be used in WebKit.

        * bridge/mac/BrowserExtensionMac.mm:
        (WebCore::BrowserExtensionMac::createNewWindow):
        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::createFrame):
        (WebCore::FrameMac::didFirstLayout):
        * bridge/mac/WebCoreAXObject.mm:
        (-[WebCoreAXObject rendererForView:]):
        * bridge/mac/WebCoreFrameBridge.h:
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge _shouldAllowAccessFrom:]):
        (-[WebCoreFrameBridge canTargetLoadInFrame:]):
        (-[WebCoreFrameBridge setOpener:]):
        (-[WebCoreFrameBridge getData:andResponse:forURL:]):
        (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
        (-[WebCoreFrameBridge setTitle:]):
        (-[WebCoreFrameBridge originalRequestURL]):
        (-[WebCoreFrameBridge isLoadTypeReload]):
        (-[WebCoreFrameBridge frameDetached]):
        (-[WebCoreFrameBridge tokenizerProcessedData]):
        (-[WebCoreFrameBridge receivedData:textEncodingName:]):
        (-[WebCoreFrameBridge objectLoadedFromCacheWithURL:response:data:]):
        (-[WebCoreFrameBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]):
        (-[WebCoreFrameBridge reportClientRedirectCancelled:]):
        (-[WebCoreFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]):
        (-[WebCoreFrameBridge incomingReferrer]):
        (-[WebCoreFrameBridge isReloading]):
        (-[WebCoreFrameBridge handledOnloadEvents]):
        (-[WebCoreFrameBridge mainResourceURLResponse]):
        (-[WebCoreFrameBridge loadEmptyDocumentSynchronously]):
        (-[WebCoreFrameBridge _frame]):
        (-[WebCoreFrameBridge executionContextForView:]):
        * bridge/mac/WebCorePageBridge.mm:
        (-[WebCorePageBridge setMainFrame:]):
        * dom/Position.cpp:
        (WebCore::Position::upstream):
        * loader/mac/IconLoaderMac.mm:
        (IconLoader::notifyIconChanged):
        * loader/mac/WebDocumentLoader.mm:
        (WebCore::DocumentLoader::frameLoader):
        (WebCore::DocumentLoader::stopLoading):
        (WebCore::DocumentLoader::finishedLoading):
        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
        * loader/mac/WebFormState.mm:
        (WebCore::FormState::FormState):
        * loader/mac/WebFrameLoader.h:
        * loader/mac/WebFrameLoader.mm:
        (WebCore::FrameLoader::~FrameLoader):
        (WebCore::FrameLoader::prepareForLoadStart):
        (WebCore::FrameLoader::finalSetupForReplace):
        (WebCore::FrameLoader::safeLoad):
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::startLoading):
        (WebCore::FrameLoader::stopLoadingSubframes):
        (WebCore::FrameLoader::stopLoading):
        (WebCore::FrameLoader::cancelPendingArchiveLoad):
        (WebCore::FrameLoader::defersCallbacksChanged):
        (WebCore::FrameLoader::setDefersCallbacks):
        (WebCore::FrameLoader::setDocumentLoader):
        (WebCore::FrameLoader::provisionalLoadStarted):
        (WebCore::FrameLoader::clearProvisionalLoad):
        (WebCore::FrameLoader::identifierForInitialRequest):
        (WebCore::FrameLoader::willSendRequest):
        (WebCore::FrameLoader::didReceiveAuthenticationChallenge):
        (WebCore::FrameLoader::didCancelAuthenticationChallenge):
        (WebCore::FrameLoader::didReceiveResponse):
        (WebCore::FrameLoader::didReceiveData):
        (WebCore::FrameLoader::didFinishLoad):
        (WebCore::FrameLoader::didFailToLoad):
        (WebCore::FrameLoader::privateBrowsingEnabled):
        (WebCore::FrameLoader::receivedMainResourceError):
        (WebCore::FrameLoader::clientRedirectCancelledOrFinished):
        (WebCore::FrameLoader::clientRedirected):
        (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
        (WebCore::FrameLoader::closeOldDataSources):
        (WebCore::FrameLoader::opened):
        (WebCore::FrameLoader::commitProvisionalLoad):
        (WebCore::FrameLoader::download):
        (WebCore::FrameLoader::finishedLoading):
        (WebCore::FrameLoader::notifyIconChanged):
        (WebCore::FrameLoader::cancelledError):
        (WebCore::FrameLoader::fileDoesNotExistError):
        (WebCore::FrameLoader::willUseArchive):
        (WebCore::FrameLoader::isArchiveLoadPending):
        (WebCore::FrameLoader::handleUnimplementablePolicy):
        (WebCore::FrameLoader::cannotShowMIMEType):
        (WebCore::FrameLoader::interruptionForPolicyChangeError):
        (WebCore::FrameLoader::canShowMIMEType):
        (WebCore::FrameLoader::representationExistsForURLScheme):
        (WebCore::FrameLoader::generatedMIMETypeForURLScheme):
        (WebCore::FrameLoader::checkContentPolicy):
        (WebCore::FrameLoader::reloadAllowingStaleData):
        (WebCore::FrameLoader::reload):
        (WebCore::FrameLoader::didReceiveServerRedirectForProvisionalLoadForFrame):
        (WebCore::FrameLoader::finishedLoadingDocument):
        (WebCore::FrameLoader::committedLoad):
        (WebCore::FrameLoader::revertToProvisional):
        (WebCore::FrameLoader::setMainDocumentError):
        (WebCore::FrameLoader::mainReceivedCompleteError):
        (WebCore::FrameLoader::subframeIsLoading):
        (WebCore::FrameLoader::willChangeTitle):
        (WebCore::FrameLoader::didChangeTitle):
        (WebCore::FrameLoader::checkNewWindowPolicy):
        (WebCore::FrameLoader::continueAfterNewWindowPolicy):
        (WebCore::FrameLoader::checkNavigationPolicy):
        (WebCore::FrameLoader::continueAfterNavigationPolicy):
        (WebCore::FrameLoader::continueLoadRequestAfterNavigationPolicy):
        (WebCore::FrameLoader::didFirstLayout):
        (WebCore::FrameLoader::frameLoadCompleted):
        (WebCore::FrameLoader::transitionToCommitted):
        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
        (WebCore::FrameLoader::continueLoadRequestAfterNewWindowPolicy):
        (WebCore::FrameLoader::sendRemainingDelegateMessages):
        (WebCore::FrameLoader::requestFromDelegate):
        (WebCore::FrameLoader::post):
        (WebCore::FrameLoader::detachChildren):
        (WebCore::FrameLoader::detachFromParent):
        (WebCore::FrameLoader::addExtraFieldsToRequest):
        (WebCore::FrameLoader::actionInformation):
        (WebCore::FrameLoader::checkLoadComplete):
        (WebCore::FrameLoader::setClient):
        (WebCore::FrameLoader::client):
        (WebCore::FrameLoaderClient::~FrameLoaderClient):
        * loader/mac/WebFrameLoaderClient.h:
        * loader/mac/WebLoader.mm:
        (WebCore::WebResourceLoader::frameLoader):
        * loader/mac/WebSubresourceLoader.mm:
        (-[WebCoreSubresourceHandle initWithLoader:]):
        * page/Frame.cpp:
        (WebCore::Frame::loader):
        * page/Frame.h:
        * platform/mac/SliderMac.mm:
        (Slider::focusPolicy):

WebKit:

        Reviewed by Anders.

        - converted WebFrameLoaderClient to C++
        - renamed frame->frameLoader() function to frame->loader()
        - renamed [bridge impl] to [bridge _frame]
        - removed some bridge methods

        * Plugins/WebNetscapePluginStream.mm:
        * WebCoreSupport/WebEditorClient.mm:
        * WebCoreSupport/WebFrameLoaderClient.h: Added.
        (WebFrameLoaderClient::webFrame):
        * WebCoreSupport/WebFrameLoaderClient.mm: Added.
        (WebFrameLoaderClient::detachFrameLoader):
        (WebFrameLoaderClient::hasWebView):
        (WebFrameLoaderClient::hasFrameView):
        (WebFrameLoaderClient::hasBackForwardList):
        (WebFrameLoaderClient::resetBackForwardList):
        (WebFrameLoaderClient::provisionalItemIsTarget):
        (WebFrameLoaderClient::loadProvisionalItemFromPageCache):
        (WebFrameLoaderClient::invalidateCurrentItemPageCache):
        (WebFrameLoaderClient::privateBrowsingEnabled):
        (WebFrameLoaderClient::makeDocumentView):
        (WebFrameLoaderClient::makeRepresentation):
        (WebFrameLoaderClient::setDocumentViewFromPageCache):
        (WebFrameLoaderClient::forceLayout):
        (WebFrameLoaderClient::forceLayoutForNonHTML):
        (WebFrameLoaderClient::updateHistoryForCommit):
        (WebFrameLoaderClient::updateHistoryForBackForwardNavigation):
        (WebFrameLoaderClient::updateHistoryForReload):
        (WebFrameLoaderClient::updateHistoryForStandardLoad):
        (WebFrameLoaderClient::updateHistoryForInternalLoad):
        (WebFrameLoaderClient::updateHistoryAfterClientRedirect):
        (WebFrameLoaderClient::setCopiesOnScroll):
        (WebFrameLoaderClient::tokenForLoadErrorReset):
        (WebFrameLoaderClient::resetAfterLoadError):
        (WebFrameLoaderClient::doNotResetAfterLoadError):
        (WebFrameLoaderClient::detachedFromParent1):
        (WebFrameLoaderClient::detachedFromParent2):
        (WebFrameLoaderClient::detachedFromParent3):
        (WebFrameLoaderClient::detachedFromParent4):
        (WebFrameLoaderClient::loadedFromPageCache):
        (WebFrameLoaderClient::download):
        (WebFrameLoaderClient::dispatchIdentifierForInitialRequest):
        (WebFrameLoaderClient::dispatchWillSendRequest):
        (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
        (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge):
        (WebFrameLoaderClient::dispatchDidReceiveResponse):
        (WebFrameLoaderClient::dispatchDidReceiveContentLength):
        (WebFrameLoaderClient::dispatchDidFinishLoading):
        (WebFrameLoaderClient::dispatchDidFailLoading):
        (WebFrameLoaderClient::dispatchDidHandleOnloadEvents):
        (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
        (WebFrameLoaderClient::dispatchDidCancelClientRedirect):
        (WebFrameLoaderClient::dispatchWillPerformClientRedirect):
        (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
        (WebFrameLoaderClient::dispatchWillClose):
        (WebFrameLoaderClient::dispatchDidReceiveIcon):
        (WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
        (WebFrameLoaderClient::dispatchDidReceiveTitle):
        (WebFrameLoaderClient::dispatchDidCommitLoad):
        (WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
        (WebFrameLoaderClient::dispatchDidFailLoad):
        (WebFrameLoaderClient::dispatchDidFinishLoad):
        (WebFrameLoaderClient::dispatchDidFirstLayout):
        (WebFrameLoaderClient::dispatchCreatePage):
        (WebFrameLoaderClient::dispatchShow):
        (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
        (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
        (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        (WebFrameLoaderClient::dispatchUnableToImplementPolicy):
        (WebFrameLoaderClient::dispatchWillSubmitForm):
        (WebFrameLoaderClient::dispatchDidLoadMainResource):
        (WebFrameLoaderClient::clearLoadingFromPageCache):
        (WebFrameLoaderClient::isLoadingFromPageCache):
        (WebFrameLoaderClient::revertToProvisionalState):
        (WebFrameLoaderClient::setMainDocumentError):
        (WebFrameLoaderClient::clearUnarchivingState):
        (WebFrameLoaderClient::progressStarted):
        (WebFrameLoaderClient::progressCompleted):
        (WebFrameLoaderClient::incrementProgress):
        (WebFrameLoaderClient::completeProgress):
        (WebFrameLoaderClient::setMainFrameDocumentReady):
        (WebFrameLoaderClient::startDownload):
        (WebFrameLoaderClient::willChangeTitle):
        (WebFrameLoaderClient::didChangeTitle):
        (WebFrameLoaderClient::committedLoad):
        (WebFrameLoaderClient::finishedLoading):
        (WebFrameLoaderClient::finalSetupForReplace):
        (WebFrameLoaderClient::cancelledError):
        (WebFrameLoaderClient::cannotShowURLError):
        (WebFrameLoaderClient::interruptForPolicyChangeError):
        (WebFrameLoaderClient::cannotShowMIMETypeError):
        (WebFrameLoaderClient::fileDoesNotExistError):
        (WebFrameLoaderClient::shouldFallBack):
        (WebFrameLoaderClient::mainFrameURL):
        (WebFrameLoaderClient::setDefersCallbacks):
        (WebFrameLoaderClient::willUseArchive):
        (WebFrameLoaderClient::isArchiveLoadPending):
        (WebFrameLoaderClient::cancelPendingArchiveLoad):
        (WebFrameLoaderClient::clearArchivedResources):
        (WebFrameLoaderClient::canHandleRequest):
        (WebFrameLoaderClient::canShowMIMEType):
        (WebFrameLoaderClient::representationExistsForURLScheme):
        (WebFrameLoaderClient::generatedMIMETypeForURLScheme):
        (WebFrameLoaderClient::elementForEvent):
        (WebFrameLoaderClient::createPolicyDecider):
        (WebFrameLoaderClient::frameLoadCompleted):
        (WebFrameLoaderClient::restoreScrollPositionAndViewState):
        (WebFrameLoaderClient::provisionalLoadStarted):
        (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent):
        (WebFrameLoaderClient::addHistoryItemForFragmentScroll):
        (WebFrameLoaderClient::didFinishLoad):
        (WebFrameLoaderClient::prepareForDataSourceReplacement):
        (WebFrameLoaderClient::createDocumentLoader):
        (WebFrameLoaderClient::setTitle):
        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebDataSource.mm:
        (-[WebDataSource webFrame]):
        * WebView/WebFrame.mm:
        (frame):
        (-[WebFrame _loadItem:withLoadType:]):
        (-[WebFrame _reloadForPluginChanges]):
        (-[WebFrame _initWithWebFrameView:webView:bridge:]):
        (-[WebFrame _frameLoader]):
        (-[WebFrame provisionalDataSource]):
        (-[WebFrame dataSource]):
        (-[WebFrame parentFrame]):
        (-[WebFrame _provisionalLoadStarted]):
        * WebView/WebFrameInternal.h:
        * WebView/WebHTMLRepresentation.m:
        (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
        * WebView/WebHTMLView.m:
        (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
        (-[NSArray validateUserInterfaceItem:]):
        (-[NSArray scrollWheel:]):
        (-[NSArray acceptsFirstMouse:]):
        (-[NSArray shouldDelayWindowOrderingForEvent:]):
        (-[NSArray _selectionStartFontAttributesAsRTF]):
        (-[NSArray changeBaseWritingDirection:]):
        (-[NSArray indent:]):
        (-[NSArray outdent:]):
        (-[WebHTMLView copy:]):
        (-[WebHTMLView cut:]):
        (-[WebHTMLView paste:]):
        * WebView/WebView.mm:
        (-[WebView _dashboardRegions]):
        (-[WebView setProhibitsMainFrameScrolling:]):
        (-[WebView _setInViewSourceMode:]):
        (-[WebView _inViewSourceMode]):
        (-[WebView setEditable:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17280 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/mac/BrowserExtensionMac.mm
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/bridge/mac/WebCorePageBridge.mm
WebCore/loader/mac/IconLoaderMac.mm
WebCore/loader/mac/WebDocumentLoader.mm
WebCore/loader/mac/WebFormState.mm
WebCore/loader/mac/WebFrameLoader.h
WebCore/loader/mac/WebFrameLoader.mm
WebCore/loader/mac/WebFrameLoaderClient.h
WebCore/loader/mac/WebLoader.mm
WebCore/loader/mac/WebSubresourceLoader.mm
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/platform/mac/SliderMac.mm
WebKit/ChangeLog
WebKit/Plugins/WebNetscapePluginStream.mm
WebKit/WebCoreSupport/WebEditorClient.mm
WebKit/WebCoreSupport/WebFrameLoaderClient.h [new file with mode: 0644]
WebKit/WebCoreSupport/WebFrameLoaderClient.mm [new file with mode: 0644]
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebDataSource.mm
WebKit/WebView/WebFrame.mm
WebKit/WebView/WebFrameInternal.h
WebKit/WebView/WebHTMLRepresentation.m
WebKit/WebView/WebHTMLView.m
WebKit/WebView/WebView.mm

index ec3eddcd7903e6bea61d2f86a490ca037e17ef44..add28bbf9accd2fcb21f57854fe7903e996265fe 100644 (file)
@@ -1,3 +1,149 @@
+2006-10-24  Darin Adler  <darin@apple.com>
+
+        Reviewed by Anders.
+
+        - converted WebFrameLoaderClient to C++
+        - renamed frame->frameLoader() function to frame->loader()
+        - renamed [bridge impl] to [bridge _frame]
+        - removed some bridge methods
+
+        * WebCore.exp: Added more exports.
+        * WebCore.xcodeproj/project.pbxproj: Made FrameTree.h private instead of project-internal
+        so it can be used in WebKit.
+
+        * bridge/mac/BrowserExtensionMac.mm:
+        (WebCore::BrowserExtensionMac::createNewWindow):
+        * bridge/mac/FrameMac.mm:
+        (WebCore::FrameMac::createFrame):
+        (WebCore::FrameMac::didFirstLayout):
+        * bridge/mac/WebCoreAXObject.mm:
+        (-[WebCoreAXObject rendererForView:]):
+        * bridge/mac/WebCoreFrameBridge.h:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge _shouldAllowAccessFrom:]):
+        (-[WebCoreFrameBridge canTargetLoadInFrame:]):
+        (-[WebCoreFrameBridge setOpener:]):
+        (-[WebCoreFrameBridge getData:andResponse:forURL:]):
+        (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
+        (-[WebCoreFrameBridge setTitle:]):
+        (-[WebCoreFrameBridge originalRequestURL]):
+        (-[WebCoreFrameBridge isLoadTypeReload]):
+        (-[WebCoreFrameBridge frameDetached]):
+        (-[WebCoreFrameBridge tokenizerProcessedData]):
+        (-[WebCoreFrameBridge receivedData:textEncodingName:]):
+        (-[WebCoreFrameBridge objectLoadedFromCacheWithURL:response:data:]):
+        (-[WebCoreFrameBridge reportClientRedirectToURL:delay:fireDate:lockHistory:isJavaScriptFormAction:]):
+        (-[WebCoreFrameBridge reportClientRedirectCancelled:]):
+        (-[WebCoreFrameBridge syncLoadResourceWithMethod:URL:customHeaders:postData:finalURL:responseHeaders:statusCode:]):
+        (-[WebCoreFrameBridge incomingReferrer]):
+        (-[WebCoreFrameBridge isReloading]):
+        (-[WebCoreFrameBridge handledOnloadEvents]):
+        (-[WebCoreFrameBridge mainResourceURLResponse]):
+        (-[WebCoreFrameBridge loadEmptyDocumentSynchronously]):
+        (-[WebCoreFrameBridge _frame]):
+        (-[WebCoreFrameBridge executionContextForView:]):
+        * bridge/mac/WebCorePageBridge.mm:
+        (-[WebCorePageBridge setMainFrame:]):
+        * dom/Position.cpp:
+        (WebCore::Position::upstream):
+        * loader/mac/IconLoaderMac.mm:
+        (IconLoader::notifyIconChanged):
+        * loader/mac/WebDocumentLoader.mm:
+        (WebCore::DocumentLoader::frameLoader):
+        (WebCore::DocumentLoader::stopLoading):
+        (WebCore::DocumentLoader::finishedLoading):
+        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
+        * loader/mac/WebFormState.mm:
+        (WebCore::FormState::FormState):
+        * loader/mac/WebFrameLoader.h:
+        * loader/mac/WebFrameLoader.mm:
+        (WebCore::FrameLoader::~FrameLoader):
+        (WebCore::FrameLoader::prepareForLoadStart):
+        (WebCore::FrameLoader::finalSetupForReplace):
+        (WebCore::FrameLoader::safeLoad):
+        (WebCore::FrameLoader::load):
+        (WebCore::FrameLoader::startLoading):
+        (WebCore::FrameLoader::stopLoadingSubframes):
+        (WebCore::FrameLoader::stopLoading):
+        (WebCore::FrameLoader::cancelPendingArchiveLoad):
+        (WebCore::FrameLoader::defersCallbacksChanged):
+        (WebCore::FrameLoader::setDefersCallbacks):
+        (WebCore::FrameLoader::setDocumentLoader):
+        (WebCore::FrameLoader::provisionalLoadStarted):
+        (WebCore::FrameLoader::clearProvisionalLoad):
+        (WebCore::FrameLoader::identifierForInitialRequest):
+        (WebCore::FrameLoader::willSendRequest):
+        (WebCore::FrameLoader::didReceiveAuthenticationChallenge):
+        (WebCore::FrameLoader::didCancelAuthenticationChallenge):
+        (WebCore::FrameLoader::didReceiveResponse):
+        (WebCore::FrameLoader::didReceiveData):
+        (WebCore::FrameLoader::didFinishLoad):
+        (WebCore::FrameLoader::didFailToLoad):
+        (WebCore::FrameLoader::privateBrowsingEnabled):
+        (WebCore::FrameLoader::receivedMainResourceError):
+        (WebCore::FrameLoader::clientRedirectCancelledOrFinished):
+        (WebCore::FrameLoader::clientRedirected):
+        (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
+        (WebCore::FrameLoader::closeOldDataSources):
+        (WebCore::FrameLoader::opened):
+        (WebCore::FrameLoader::commitProvisionalLoad):
+        (WebCore::FrameLoader::download):
+        (WebCore::FrameLoader::finishedLoading):
+        (WebCore::FrameLoader::notifyIconChanged):
+        (WebCore::FrameLoader::cancelledError):
+        (WebCore::FrameLoader::fileDoesNotExistError):
+        (WebCore::FrameLoader::willUseArchive):
+        (WebCore::FrameLoader::isArchiveLoadPending):
+        (WebCore::FrameLoader::handleUnimplementablePolicy):
+        (WebCore::FrameLoader::cannotShowMIMEType):
+        (WebCore::FrameLoader::interruptionForPolicyChangeError):
+        (WebCore::FrameLoader::canShowMIMEType):
+        (WebCore::FrameLoader::representationExistsForURLScheme):
+        (WebCore::FrameLoader::generatedMIMETypeForURLScheme):
+        (WebCore::FrameLoader::checkContentPolicy):
+        (WebCore::FrameLoader::reloadAllowingStaleData):
+        (WebCore::FrameLoader::reload):
+        (WebCore::FrameLoader::didReceiveServerRedirectForProvisionalLoadForFrame):
+        (WebCore::FrameLoader::finishedLoadingDocument):
+        (WebCore::FrameLoader::committedLoad):
+        (WebCore::FrameLoader::revertToProvisional):
+        (WebCore::FrameLoader::setMainDocumentError):
+        (WebCore::FrameLoader::mainReceivedCompleteError):
+        (WebCore::FrameLoader::subframeIsLoading):
+        (WebCore::FrameLoader::willChangeTitle):
+        (WebCore::FrameLoader::didChangeTitle):
+        (WebCore::FrameLoader::checkNewWindowPolicy):
+        (WebCore::FrameLoader::continueAfterNewWindowPolicy):
+        (WebCore::FrameLoader::checkNavigationPolicy):
+        (WebCore::FrameLoader::continueAfterNavigationPolicy):
+        (WebCore::FrameLoader::continueLoadRequestAfterNavigationPolicy):
+        (WebCore::FrameLoader::didFirstLayout):
+        (WebCore::FrameLoader::frameLoadCompleted):
+        (WebCore::FrameLoader::transitionToCommitted):
+        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+        (WebCore::FrameLoader::continueLoadRequestAfterNewWindowPolicy):
+        (WebCore::FrameLoader::sendRemainingDelegateMessages):
+        (WebCore::FrameLoader::requestFromDelegate):
+        (WebCore::FrameLoader::post):
+        (WebCore::FrameLoader::detachChildren):
+        (WebCore::FrameLoader::detachFromParent):
+        (WebCore::FrameLoader::addExtraFieldsToRequest):
+        (WebCore::FrameLoader::actionInformation):
+        (WebCore::FrameLoader::checkLoadComplete):
+        (WebCore::FrameLoader::setClient):
+        (WebCore::FrameLoader::client):
+        (WebCore::FrameLoaderClient::~FrameLoaderClient):
+        * loader/mac/WebFrameLoaderClient.h:
+        * loader/mac/WebLoader.mm:
+        (WebCore::WebResourceLoader::frameLoader):
+        * loader/mac/WebSubresourceLoader.mm:
+        (-[WebCoreSubresourceHandle initWithLoader:]):
+        * page/Frame.cpp:
+        (WebCore::Frame::loader):
+        * page/Frame.h:
+        * platform/mac/SliderMac.mm:
+        (Slider::focusPolicy):
+
 2006-10-24  Darin Adler  <darin@apple.com>
 
         Rubber stamped by Anders.
index c1972eb37c7c58c3097bb50bd88eef98a900b208..1bcfa8a027ccaf05af818e71b052050d0428c70b 100644 (file)
@@ -153,6 +153,7 @@ __ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE
 __ZN7WebCore11FrameLoader4loadEPNS_14DocumentLoaderE13FrameLoadTypeN3WTF10PassRefPtrINS_9FormStateEEE
 __ZN7WebCore11FrameLoader6reloadEv
 __ZN7WebCore11FrameLoader8safeLoadEP5NSURL
+__ZN7WebCore11FrameLoader9setClientEPNS_17FrameLoaderClientE
 __ZN7WebCore14DocumentLoader12setCommittedEb
 __ZN7WebCore14DocumentLoader13attachToFrameEv
 __ZN7WebCore14DocumentLoader15detachFromFrameEv
@@ -162,10 +163,27 @@ __ZN7WebCore14DocumentLoader32replaceRequestURLForAnchorScrollEP5NSURL
 __ZN7WebCore14DocumentLoader7requestEv
 __ZN7WebCore14DocumentLoaderC2EP12NSURLRequest
 __ZN7WebCore14DocumentLoaderD2Ev
+__ZN7WebCore16DeprecatedStringD1Ev
+__ZN7WebCore17FrameLoaderClientD2Ev
 __ZN7WebCore17WebResourceLoader14cancelledErrorEv
 __ZN7WebCore17WebResourceLoader20inConnectionCallbackEv
 __ZN7WebCore21isBackForwardLoadTypeE13FrameLoadType
 __ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEP11objc_object
+__ZN7WebCore4KURLC1EP5NSURL
+__ZN7WebCore5Frame14scrollToAnchorERKNS_4KURLE
+__ZN7WebCore5Frame20setSelectionFromNoneEv
+__ZN7WebCore5Frame21setProhibitsScrollingEb
+__ZN7WebCore5Frame6indentEv
+__ZN7WebCore5Frame7outdentEv
+__ZN7WebCore8FrameMac10wheelEventEP7NSEvent
+__ZN7WebCore8FrameMac11mayDHTMLCutEv
+__ZN7WebCore8FrameMac11tryDHTMLCutEv
+__ZN7WebCore8FrameMac12mayDHTMLCopyEv
+__ZN7WebCore8FrameMac12tryDHTMLCopyEv
+__ZN7WebCore8FrameMac13mayDHTMLPasteEv
+__ZN7WebCore8FrameMac13tryDHTMLPasteEv
+__ZN7WebCore8FrameMac26dashboardRegionsDictionaryEv
+__ZN7WebCore8FrameMac5clearEv
 __ZNK7WebCore11FrameLoader14documentLoaderEv
 __ZNK7WebCore11FrameLoader15defersCallbacksEv
 __ZNK7WebCore11FrameLoader15firstLayoutDoneEv
@@ -191,6 +209,16 @@ __ZNK7WebCore14DocumentLoader8responseEv
 __ZNK7WebCore14DocumentLoader9isLoadingEv
 __ZNK7WebCore17WebResourceLoader11frameLoaderEv
 __ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv
+__ZNK7WebCore5Frame15containsPluginsEv
+__ZNK7WebCore5Frame16inViewSourceModeEv
+__ZNK7WebCore5Frame19setInViewSourceModeEb
+__ZNK7WebCore5Frame30applyEditingStyleToBodyElementEv
+__ZNK7WebCore5Frame33removeEditingStyleFromBodyElementEv
+__ZNK7WebCore5Frame4treeEv
+__ZNK7WebCore5Frame6loaderEv
+__ZNK7WebCore8FrameMac17eventMayStartDragEP7NSEvent
+__ZNK7WebCore8FrameMac31fontAttributesForSelectionStartEv
+__ZTVN7WebCore17FrameLoaderClientE
 _canonicalURL
 _stringIsFileURL
 _urlByRemovingComponent
index b0d0ec0c0f40325b0edc7090cdce9ae9839d77f1..b5108474a6b5490f66727a00cc89a99ff9c6eccc 100644 (file)
                659DDC8309E198BA001BF3C6 /* JSDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 659DDC8109E198BA001BF3C6 /* JSDocument.h */; };
                65A21468097A329100B9050A /* Page.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21467097A329100B9050A /* Page.h */; };
                65A21484097A3F5300B9050A /* FrameTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65A21482097A3F5300B9050A /* FrameTree.cpp */; };
-               65A21485097A3F5300B9050A /* FrameTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21483097A3F5300B9050A /* FrameTree.h */; };
+               65A21485097A3F5300B9050A /* FrameTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 65A21483097A3F5300B9050A /* FrameTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
                65BAAABE0ADCA015005BB5A4 /* RetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 65BAAABD0ADCA015005BB5A4 /* RetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
                65BF022E0974816300C43196 /* Frame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65BF02290974816300C43196 /* Frame.cpp */; };
                65BF022F0974816300C43196 /* Frame.h in Headers */ = {isa = PBXBuildFile; fileRef = 65BF022A0974816300C43196 /* Frame.h */; settings = {ATTRIBUTES = (Private, ); }; };
index 0041e0afc5b1ffff27a77706893b30ce5bb09f0c..09f200ba1336f5ef247fcaf91023f4f8d7228980 100644 (file)
@@ -63,11 +63,11 @@ void BrowserExtensionMac::createNewWindow(const FrameLoadRequest& request,
         // ANSWER: No, because such a method doesn't exist - YET
         if (WebCoreFrameBridge *frameBridge = [m_frame->bridge() findFrameNamed:frameName]) {
             if (!url.isEmpty())
-                [frameBridge impl]->loadRequest(request, true, nil, nil, nil);
+                [frameBridge _frame]->loadRequest(request, true, nil, nil, nil);
 
             [frameBridge activateWindow];
 
-            newFrame = [frameBridge impl];
+            newFrame = [frameBridge _frame];
 
             return;
         }
@@ -82,10 +82,10 @@ void BrowserExtensionMac::createNewWindow(const FrameLoadRequest& request,
         return;
     
     WebCoreFrameBridge *frameBridge = [pageBridge mainFrame];
-    if ([frameBridge impl])
-        [frameBridge impl]->tree()->setName(AtomicString(request.m_frameName));
+    if ([frameBridge _frame])
+        [frameBridge _frame]->tree()->setName(AtomicString(request.m_frameName));
     
-    newFrame = [frameBridge impl];
+    newFrame = [frameBridge _frame];
     
     [frameBridge setToolbarsVisible:windowFeatures.toolBarVisible || windowFeatures.locationBarVisible];
     [frameBridge setStatusbarVisible:windowFeatures.statusBarVisible];
index eecc6691855808b0b492ba9f0a9b3bbe5c90bd4b..814977eda2d8bf847460455a7559e38dd030fe2d 100644 (file)
@@ -368,7 +368,7 @@ Frame* FrameMac::createFrame(const KURL& url, const String& name, Element* owner
                                                      allowsScrolling:allowsScrolling
                                                          marginWidth:marginWidth
                                                         marginHeight:marginHeight];
-    return [childBridge impl];
+    return [childBridge _frame];
 
     END_BLOCK_OBJC_EXCEPTIONS;
     return 0;
@@ -3386,7 +3386,7 @@ bool FrameMac::canGoBackOrForward(int distance) const
 
 void FrameMac::didFirstLayout()
 {
-    [_bridge didFirstLayout];
+    loader()->didFirstLayout();
 }
 
 NSMutableDictionary *FrameMac::dashboardRegionsDictionary()
index 038184cf6352f15d43f4b7a1b6a1b8e8dd879688..a9b598546b1b6bd82bfe366fc1c5402934b9091c 100644 (file)
@@ -2309,7 +2309,7 @@ static VisiblePosition endOfStyleRange (const VisiblePosition visiblePos)
         bridge = [bridgeHolder webCoreBridge];
     }
 
-    FrameMac* frameMac = [bridge impl];
+    FrameMac* frameMac = [bridge _frame];
     if (!frameMac)
         return NULL;
         
index 9a71e6423aade6061460c24f7a5d0a6d335c28e3..3ded5d6d347582a408433714f47919e59b0d5138 100644 (file)
 namespace WebCore {
     class EditorClient;
     class Element;
-    class FrameLoader;
     class FrameMac;
 }
 
 typedef WebCore::EditorClient WebCoreEditorClient;
 typedef WebCore::Element WebCoreElement;
-typedef WebCore::FrameLoader WebCoreFrameLoader;
 typedef WebCore::FrameMac WebCoreFrameMac;
 
 #else
@@ -47,7 +45,6 @@ typedef WebCore::FrameMac WebCoreFrameMac;
 @class NSMenu;
 @class WebCoreEditorClient;
 @class WebCoreElement;
-@class WebCoreFrameLoader;
 @class WebCoreFrameMac;
 
 #endif
@@ -71,8 +68,6 @@ typedef WebCore::FrameMac WebCoreFrameMac;
 @protocol WebCoreRenderTreeCopier;
 @protocol WebCoreResourceHandle;
 @protocol WebCoreResourceLoader;
-@protocol WebFrameLoaderClient;
-
 
 extern NSString *WebCorePageCacheStateKey;
 
@@ -194,6 +189,8 @@ typedef enum {
     BOOL _closed;
 }
 
+- (WebCoreFrameMac*)_frame; // underscore to prevent conflict with -[NSView frame]
+
 + (WebCoreFrameBridge *)bridgeForDOMDocument:(DOMDocument *)document;
 
 - (id)initMainFrameWithPage:(WebCorePageBridge *)page withEditorClient:(WebCoreEditorClient *)client;
@@ -212,8 +209,6 @@ typedef enum {
 
 - (WebCorePageBridge *)page;
 
-- (WebCoreFrameBridge *)parent;
-
 - (WebCoreFrameBridge *)firstChild;
 - (WebCoreFrameBridge *)lastChild;
 - (WebCoreFrameBridge *)previousSibling;
@@ -234,17 +229,12 @@ typedef enum {
 - (WebCoreFrameBridge *)childFrameNamed:(NSString *)name;
 - (WebCoreFrameBridge *)findFrameNamed:(NSString *)name;
 
-- (void)provisionalLoadStarted;
-
 - (void)openURL:(NSURL *)URL reload:(BOOL)reload
     contentType:(NSString *)contentType refresh:(NSString *)refresh lastModified:(NSDate *)lastModified
     pageCache:(NSDictionary *)pageCache;
-- (void)setEncoding:(NSString *)encoding userChosen:(BOOL)userChosen;
 - (void)addData:(NSData *)data;
 - (void)closeURL;
-- (void)stopLoading;
 
-- (void)didNotOpenURL:(NSURL *)URL;
 - (void)invalidatePageCache:(NSDictionary *)pageCache;
 
 - (BOOL)canLoadURL:(NSURL *)URL fromReferrer:(NSString *)referrer hideReferrer:(BOOL *)hideReferrer;
@@ -256,9 +246,6 @@ typedef enum {
 - (BOOL)canCachePage;
 - (BOOL)saveDocumentToPageCache;
 
-- (void)end;
-- (void)stop;
-
 - (void)clearFrame;
 - (void)handleFallbackContent;
 
@@ -271,8 +258,6 @@ typedef enum {
 - (void)installInFrame:(NSView *)view;
 - (void)removeFromFrame;
 
-- (void)scrollToAnchorWithURL:(NSURL *)URL;
-
 - (BOOL)scrollOverflowInDirection:(WebScrollDirection)direction granularity:(WebScrollGranularity)granularity;
 
 - (void)createFrameViewWithNSView:(NSView *)view marginWidth:(int)mw marginHeight:(int)mh;
@@ -297,7 +282,6 @@ typedef enum {
 - (void)mouseDragged:(NSEvent *)event;
 
 // these return YES if event is eaten by WebCore
-- (BOOL)sendScrollWheelEvent:(NSEvent *)event;
 - (BOOL)sendContextMenuEvent:(NSEvent *)event;
 
 - (NSView *)nextKeyView;
@@ -392,7 +376,6 @@ typedef enum {
 - (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset;
 
 - (NSFont *)fontForSelection:(BOOL *)hasMultipleFonts;
-- (NSDictionary *)fontAttributesForSelectionStart;
 - (NSWritingDirection)baseWritingDirectionForSelectionStart;
 
 - (NSString *)stringWithData:(NSData *)data; // using the encoding of the frame's main resource
@@ -473,36 +456,18 @@ typedef enum {
 - (void)setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
 - (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
 - (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
-- (void)indent;
-- (void)outdent;
 - (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style;
 - (NSCellStateValue)selectionHasStyle:(DOMCSSStyleDeclaration *)style;
-- (void)applyEditingStyleToBodyElement;
-- (void)removeEditingStyleFromBodyElement;
-- (void)applyEditingStyleToElement:(DOMElement *)element;
-- (void)removeEditingStyleFromElement:(DOMElement *)element;
 
 - (WebScriptObject *)windowScriptObject;
 - (NPObject *)windowScriptNPObject;
 
-- (BOOL)eventMayStartDrag:(NSEvent *)event;
 - (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)info;
 - (void)dragExitedWithDraggingInfo:(id <NSDraggingInfo>)info;
 - (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)info;
 - (void)dragSourceMovedTo:(NSPoint)windowLoc;
 - (void)dragSourceEndedAt:(NSPoint)windowLoc operation:(NSDragOperation)operation;
 
-- (BOOL)mayDHTMLCut;
-- (BOOL)mayDHTMLCopy;
-- (BOOL)mayDHTMLPaste;
-- (BOOL)tryDHTMLCut;
-- (BOOL)tryDHTMLCopy;
-- (BOOL)tryDHTMLPaste;
-
-- (NSMutableDictionary *)dashboardRegions;
-
-- (void)clear;
-
 - (BOOL)isCharacterSmartReplaceExempt:(unichar)c isPreviousCharacter:(BOOL)isPreviousCharacter;
 
 - (BOOL)getData:(NSData **)data andResponse:(NSURLResponse **)response forURL:(NSURL *)URL;
@@ -510,19 +475,8 @@ typedef enum {
 
 - (BOOL)canProvideDocumentSource;
 - (BOOL)canSaveAsWebArchive;
-- (BOOL)containsPlugins;
-
-- (void)setInViewSourceMode:(BOOL)flag;
-- (BOOL)inViewSourceMode;
-
-- (void)setProhibitsScrolling:(BOOL)prohibits;
-
-- (void)setFrameLoaderClient:(id<WebFrameLoaderClient>)client;
-- (WebCoreFrameLoader *)frameLoader;
 
 - (void)setTitle:(NSString *)title;
-- (void)didFirstLayout;
-- (void)notifyIconChanged:(NSURL*)iconURL;
 - (NSURL*)originalRequestURL;
 - (BOOL)isLoadTypeReload;
 - (void)frameDetached;
@@ -707,13 +661,6 @@ typedef enum {
 @interface WebCoreFrameBridge (SubclassResponsibility) <WebCoreFrameBridge>
 @end
 
-// One method for internal use within WebCore itself.
-// Could move this to another header, but would be a pity to create an entire header just for that.
-
-@interface WebCoreFrameBridge (WebCoreInternalUse)
-- (WebCoreFrameMac*)impl;
-@end
-
 // Protocols that make up part of the interaces above.
 
 @protocol WebCoreRenderTreeCopier <NSObject>
index e388de80d74f551fa7c594a73c27722d452ef007..d9396cb997a2678629326c0e665554e843f3467f 100644 (file)
@@ -60,9 +60,9 @@
 #import "RenderTreeAsText.h"
 #import "RenderView.h"
 #import "RenderWidget.h"
-#import "RetainPtr.h"
 #import "ReplaceSelectionCommand.h"
 #import "ResourceRequest.h"
+#import "RetainPtr.h"
 #import "Screen.h"
 #import "SelectionController.h"
 #import "TextEncoding.h"
@@ -323,7 +323,8 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
     return nil;
 }
 
-// FIXME: this is not getting called any more! security regression...
+#if 0
+// FIXME: This is not getting called any more! security regression!?
 - (BOOL)_shouldAllowAccessFrom:(WebCoreFrameBridge *)source
 {
     // if no source frame, allow access
@@ -346,8 +347,6 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
         if (ancestorDomain != nil && 
             isCaseSensitiveEqual(sourceDomain, ancestorDomain))
             return YES;
-        
-        ancestor = [ancestor parent];
     }
 
     //   - allow access if this frame is a toplevel window and the source
@@ -362,6 +361,7 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
     // otherwise deny access
     return NO;
 }
+#endif
 
 - (BOOL)canTargetLoadInFrame:(WebCoreFrameBridge *)targetFrame
 {
@@ -380,7 +380,7 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
         return YES;
     }
     
-    WebCoreFrameBridge *parentBridge = [targetFrame parent];
+    WebCoreFrameBridge *parentBridge = Mac([targetFrame _frame]->tree()->parent())->bridge();
     // Allow if target is an entire window.
     if (!parentBridge)
         return YES;
@@ -538,16 +538,6 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
     _closed = YES;
 }
 
-- (WebCoreFrameBridge *)parent
-{
-    return bridge(m_frame->tree()->parent());
-}
-
-- (void)provisionalLoadStarted
-{
-    m_frame->provisionalLoadStarted();
-}
-
 - (void)openURL:(NSURL *)URL reload:(BOOL)reload contentType:(NSString *)contentType refresh:(NSString *)refresh lastModified:(NSDate *)lastModified pageCache:(NSDictionary *)pageCache
 {
     if (pageCache) {
@@ -572,11 +562,6 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
     }
 }
 
-- (void)setEncoding:(NSString *)encoding userChosen:(BOOL)userChosen
-{
-    m_frame->setEncoding(encoding, userChosen);
-}
-
 - (void)addData:(NSData *)data
 {
     Document *doc = m_frame->document();
@@ -596,16 +581,6 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
     m_frame->closeURL();
 }
 
-- (void)stopLoading
-{
-    m_frame->stopLoading();
-}
-
-- (void)didNotOpenURL:(NSURL *)URL
-{
-    m_frame->didNotOpenURL(KURL(URL).url());
-}
-
 - (void)invalidatePageCache:(NSDictionary *)pageCache
 {
     // We might have made a page cache item, but now we're bailing out due to an error before we ever
@@ -672,11 +647,6 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
     doc->setStateForNewFormElements(stateVector);
 }
 
-- (void)scrollToAnchorWithURL:(NSURL *)URL
-{
-    m_frame->scrollToAnchor(KURL(URL).url().latin1());
-}
-
 - (BOOL)scrollOverflowInDirection:(WebScrollDirection)direction granularity:(WebScrollGranularity)granularity
 {
     if (!m_frame)
@@ -684,11 +654,6 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
     return m_frame->scrollOverflow((ScrollDirection)direction, (ScrollGranularity)granularity);
 }
 
-- (BOOL)sendScrollWheelEvent:(NSEvent *)event
-{
-    return m_frame ? m_frame->wheelEvent(event) : NO;
-}
-
 - (BOOL)saveDocumentToPageCache
 {
     Document *doc = m_frame->document();
@@ -729,21 +694,6 @@ static inline WebCoreFrameBridge *bridge(Frame *frame)
     return m_frame->canCachePage();
 }
 
-- (void)clear
-{
-    m_frame->clear();
-}
-
-- (void)end
-{
-    m_frame->end();
-}
-
-- (void)stop
-{
-    m_frame->stop();
-}
-
 - (void)clearFrame
 {
     m_frame = 0;
@@ -1494,7 +1444,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
 
 - (void)setOpener:(WebCoreFrameBridge *)bridge;
 {
-    if (Frame* f = [bridge impl])
+    if (Frame* f = [bridge _frame])
         f->setOpener(m_frame);
 }
 
@@ -2220,20 +2170,6 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     m_frame->applyParagraphStyle([style _CSSStyleDeclaration], static_cast<EditAction>(undoAction));
 }
 
-- (void)indent
-{
-    if (!m_frame)
-        return;
-    m_frame->indent();
-}
-
-- (void)outdent
-{
-    if (!m_frame)
-        return;
-    m_frame->outdent();
-}
-
 - (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style
 {
     if (!m_frame)
@@ -2256,34 +2192,6 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     return NSOffState;
 }
 
-- (void)applyEditingStyleToBodyElement
-{
-    if (!m_frame)
-        return;
-    m_frame->applyEditingStyleToBodyElement();
-}
-
-- (void)removeEditingStyleFromBodyElement
-{
-    if (!m_frame)
-        return;
-    m_frame->removeEditingStyleFromBodyElement();
-}
-
-- (void)applyEditingStyleToElement:(DOMElement *)element
-{
-    if (!m_frame)
-        return;
-    m_frame->applyEditingStyleToElement([element _element]);
-}
-
-- (void)removeEditingStyleFromElement:(DOMElement *)element
-{
-    if (!m_frame)
-        return;
-    m_frame->removeEditingStyleFromElement([element _element]);
-}
-
 - (NSFont *)fontForSelection:(BOOL *)hasMultipleFonts
 {
     bool multipleFonts = false;
@@ -2295,22 +2203,12 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     return font;
 }
 
-- (NSDictionary *)fontAttributesForSelectionStart
-{
-    return m_frame ? m_frame->fontAttributesForSelectionStart() : nil;
-}
-
 - (NSWritingDirection)baseWritingDirectionForSelectionStart
 {
     // FIXME: remove this NSWritingDirection cast once <rdar://problem/4509035> is fixed
     return m_frame ? m_frame->baseWritingDirectionForSelectionStart() : (NSWritingDirection)NSWritingDirectionLeftToRight;
 }
 
-- (BOOL)eventMayStartDrag:(NSEvent *)event
-{
-    return m_frame ? m_frame->eventMayStartDrag(event) : NO;
-}
-
 static IntPoint globalPoint(NSWindow* window, NSPoint windowPoint)
 {
     return IntPoint(flipScreenPoint([window convertBaseToScreen:windowPoint]));
@@ -2414,36 +2312,6 @@ static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id
     }
 }
 
-- (BOOL)mayDHTMLCut
-{
-    return m_frame->mayDHTMLCut();
-}
-
-- (BOOL)mayDHTMLCopy
-{
-    return m_frame->mayDHTMLCopy();
-}
-
-- (BOOL)mayDHTMLPaste
-{
-    return m_frame->mayDHTMLPaste();
-}
-
-- (BOOL)tryDHTMLCut
-{
-    return m_frame->tryDHTMLCut();
-}
-
-- (BOOL)tryDHTMLCopy
-{
-    return m_frame->tryDHTMLCopy();
-}
-
-- (BOOL)tryDHTMLPaste
-{
-    return m_frame->tryDHTMLPaste();
-}
-
 - (DOMRange *)rangeOfCharactersAroundCaret
 {
     if (!m_frame)
@@ -2462,12 +2330,7 @@ static PlatformMouseEvent createMouseEventFromDraggingInfo(NSWindow* window, id
     return [DOMRange _rangeWith:makeRange(previous, next).get()];
 }
 
-- (NSMutableDictionary *)dashboardRegions
-{
-    return m_frame->dashboardRegionsDictionary();
-}
-
-// FIXME: The following 2 functions are copied from AppKit. It would be best share code.
+// FIXME: The following 2 functions are copied from AppKit. It would be best to share code.
 
 // MF:!!! For now we will use static character sets for the computation, but we should eventually probably make these keys in the language dictionaries.
 // MF:!!! The following characters (listed with their nextstep encoding values) were in the preSmartTable in the old text objet, but aren't yet in the new text object: NS_FIGSPACE (0x80), exclamdown (0xa1), sterling (0xa3), yen (0xa5), florin (0xa6) section (0xa7), currency (0xa8), quotesingle (0xa9), quotedblleft (0xaa), guillemotleft (0xab), guilsinglleft (0xac), endash (0xb1), quotesinglbase (0xb8), quotedblbase (0xb9), questiondown (0xbf), emdash (0xd0), plusminus (0xd1).
@@ -2525,7 +2388,7 @@ static NSCharacterSet *_getPostSmartSet(void)
 
 - (BOOL)getData:(NSData **)data andResponse:(NSURLResponse **)response forURL:(NSURL *)URL
 {
-    Document* doc = [self impl]->document();
+    Document* doc = m_frame->document();
     if (!doc)
         return NO;
 
@@ -2540,7 +2403,7 @@ static NSCharacterSet *_getPostSmartSet(void)
 
 - (void)getAllResourceDatas:(NSArray **)datas andResponses:(NSArray **)responses
 {
-    Document* doc = [self impl]->document();
+    Document* doc = m_frame->document();
     if (!doc) {
         NSArray* emptyArray = [NSArray array];
         *datas = emptyArray;
@@ -2582,45 +2445,11 @@ static NSCharacterSet *_getPostSmartSet(void)
     return [self canProvideDocumentSource];
 }
 
-- (BOOL)containsPlugins
-{
-    return m_frame->containsPlugins();
-}
-
-- (void)setInViewSourceMode:(BOOL)flag
-{
-    m_frame->setInViewSourceMode(flag);
-}
-
-- (BOOL)inViewSourceMode
-{
-    return m_frame->inViewSourceMode();
-}
-
-- (void)setProhibitsScrolling:(BOOL)prohibits
-{
-    m_frame->setProhibitsScrolling(prohibits);
-}
-
 - (BOOL)isMainFrame
 {
     return m_frame->page()->mainFrame() == m_frame;
 }
 
-- (void)setFrameLoaderClient:(id<WebFrameLoaderClient>)client
-{
-    if (!m_frame)
-        return;
-    m_frame->frameLoader()->setFrameLoaderClient(client);
-}
-
-- (WebCoreFrameLoader *)frameLoader
-{
-    if (!m_frame)
-        return 0;
-    return m_frame->frameLoader();
-}
-
 static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
 {
     NSMutableString *result = [NSMutableString string];
@@ -2669,52 +2498,38 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
 {
     if (!m_frame)
         return;
-    m_frame->frameLoader()->documentLoader()->setTitle(stringByCollapsingNonPrintingCharacters(title));
-}
-
-- (void)didFirstLayout
-{
-    if (!m_frame)
-        return;
-    m_frame->frameLoader()->didFirstLayout();
-}
-
-- (void)notifyIconChanged:(NSURL*)iconURL
-{
-    if (!m_frame)
-        return;
-    m_frame->frameLoader()->notifyIconChanged(iconURL);
+    m_frame->loader()->documentLoader()->setTitle(stringByCollapsingNonPrintingCharacters(title));
 }
 
 - (NSURL*)originalRequestURL
 {
-    return [m_frame->frameLoader()->activeDocumentLoader()->initialRequest() URL];
+    return [m_frame->loader()->activeDocumentLoader()->initialRequest() URL];
 }
 
 - (BOOL)isLoadTypeReload
 {
-    return m_frame->frameLoader()->loadType() == FrameLoadTypeReload;
+    return m_frame->loader()->loadType() == FrameLoadTypeReload;
 }
 
 - (void)frameDetached
 {
-    m_frame->frameLoader()->stopLoading();
-    m_frame->frameLoader()->detachFromParent();
+    m_frame->loader()->stopLoading();
+    m_frame->loader()->detachFromParent();
 }
 
 - (void)tokenizerProcessedData
 {
-    m_frame->frameLoader()->checkLoadComplete();
+    m_frame->loader()->checkLoadComplete();
 }
 
 - (void)receivedData:(NSData *)data textEncodingName:(NSString *)textEncodingName
 {
     // Set the encoding. This only needs to be done once, but it's harmless to do it again later.
-    NSString *encoding = m_frame ? m_frame->frameLoader()->documentLoader()->overrideEncoding() : nil;
+    NSString *encoding = m_frame ? m_frame->loader()->documentLoader()->overrideEncoding() : nil;
     bool userChosen = encoding != nil;
     if (!encoding)
         encoding = textEncodingName;
-    [self setEncoding:encoding userChosen:userChosen];
+    m_frame->setEncoding(encoding, userChosen);
     [self addData:data];
 }
 
@@ -2743,8 +2558,8 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
     NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
     NSError *error;
     id identifier;
-    m_frame->frameLoader()->requestFromDelegate(request, identifier, error);    
-    m_frame->frameLoader()->sendRemainingDelegateMessages(identifier, response, [data length], error);
+    m_frame->loader()->requestFromDelegate(request, identifier, error);    
+    m_frame->loader()->sendRemainingDelegateMessages(identifier, response, [data length], error);
     [request release];
 }
 
@@ -2767,12 +2582,12 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
 
 - (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction
 {   
-    m_frame->frameLoader()->clientRedirected(URL, seconds, date, lockHistory, isJavaScriptFormAction);
+    m_frame->loader()->clientRedirected(URL, seconds, date, lockHistory, isJavaScriptFormAction);
 }
 
 - (void)reportClientRedirectCancelled:(BOOL)cancelWithLoadInProgress
 {
-    m_frame->frameLoader()->clientRedirectCancelledOrFinished(cancelWithLoadInProgress);
+    m_frame->loader()->clientRedirectCancelledOrFinished(cancelWithLoadInProgress);
 }
 
 - (NSData *)syncLoadResourceWithMethod:(NSString *)method URL:(NSURL *)URL customHeaders:(NSDictionary *)requestHeaders postData:(NSArray *)postData finalURL:(NSURL **)finalURL responseHeaders:(NSDictionary **)responseHeaderDict statusCode:(int *)statusCode
@@ -2801,18 +2616,18 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
     if (isConditionalRequest(request))
         [request setCachePolicy:NSURLRequestReloadIgnoringCacheData];
     else
-        [request setCachePolicy:[m_frame->frameLoader()->documentLoader()->request() cachePolicy]];
+        [request setCachePolicy:[m_frame->loader()->documentLoader()->request() cachePolicy]];
     
     if (!hideReferrer)
         setHTTPReferrer(request, [self referrer]);
     
     WebCorePageBridge *page = [self page];
-    [request setMainDocumentURL:[[[page mainFrame] impl]->frameLoader()->documentLoader()->request() URL]];
+    [request setMainDocumentURL:[[[page mainFrame] _frame]->loader()->documentLoader()->request() URL]];
     [request setValue:[self userAgentForURL:[request URL]] forHTTPHeaderField:@"User-Agent"];
     
     NSError *error = nil;
     id identifier = nil;    
-    NSURLRequest *newRequest = m_frame->frameLoader()->requestFromDelegate(request, identifier, error);
+    NSURLRequest *newRequest = m_frame->loader()->requestFromDelegate(request, identifier, error);
     
     NSURLResponse *response = nil;
     NSData *result = nil;
@@ -2841,7 +2656,7 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
         }
     }
     
-    m_frame->frameLoader()->sendRemainingDelegateMessages(identifier, response, [result length], error);
+    m_frame->loader()->sendRemainingDelegateMessages(identifier, response, [result length], error);
     [request release];
     
     return result;
@@ -2850,22 +2665,22 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
 
 - (NSString *)incomingReferrer
 {
-    return [m_frame->frameLoader()->documentLoader()->request() valueForHTTPHeaderField:@"Referer"];
+    return [m_frame->loader()->documentLoader()->request() valueForHTTPHeaderField:@"Referer"];
 }
 
 - (BOOL)isReloading
 {
-    return [m_frame->frameLoader()->documentLoader()->request() cachePolicy] == NSURLRequestReloadIgnoringCacheData;
+    return [m_frame->loader()->documentLoader()->request() cachePolicy] == NSURLRequestReloadIgnoringCacheData;
 }
 
 - (void)handledOnloadEvents
 {
-    [m_frame->frameLoader()->client() _dispatchDidHandleOnloadEventsForFrame];
+    m_frame->loader()->client()->dispatchDidHandleOnloadEvents();
 }
 
 - (NSURLResponse *)mainResourceURLResponse
 {
-    return m_frame->frameLoader()->documentLoader()->response();
+    return m_frame->loader()->documentLoader()->response();
 }
 
 - (void)loadEmptyDocumentSynchronously
@@ -2875,18 +2690,23 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
         
     NSURL *url = [[NSURL alloc] initWithString:@""];
     NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
-    m_frame->frameLoader()->load(request);
+    m_frame->loader()->load(request);
     [request release];
     [url release];
 }
 
+- (FrameMac*)_frame
+{
+    return m_frame;
+}
+
 @end
 
 @implementation WebCoreFrameBridge (WebCoreBridgeInternal)
 
 - (RootObject *)executionContextForView:(NSView *)aView
 {
-    FrameMac *frame = [self impl];
+    FrameMac *frame = [self _frame];
     RootObject *root = new RootObject(aView);    // The root gets deleted by JavaScriptCore.
     root->setRootObjectImp(Window::retrieveWindow(frame));
     root->setInterpreter(frame->jScript()->interpreter());
@@ -2895,12 +2715,3 @@ static NSString *stringByCollapsingNonPrintingCharacters(NSString *string)
 }
 
 @end
-
-@implementation WebCoreFrameBridge (WebCoreInternalUse)
-
-- (FrameMac*)impl
-{
-    return m_frame;
-}
-
-@end
index f7e7acaa3f639f92c980b28850a6f55c977f8f85..d2d9e5d874757c336fc4f026a13895f843a67fb3 100644 (file)
@@ -78,7 +78,7 @@ static void initializeLoggingChannelsIfNecessary()
 - (void)setMainFrame:(WebCoreFrameBridge *)mainFrame
 {
     if (_page)
-        _page->setMainFrame(adoptRef([mainFrame impl]));
+        _page->setMainFrame(adoptRef([mainFrame _frame]));
 }
 
 - (void)dealloc
index 13561aa5ebbca5fce909fb3719d3cf2c145a6dae..46edf425e46f363d9b13b7d83e7a604716387c68 100644 (file)
@@ -27,7 +27,7 @@
 #include "IconLoader.h"
 
 #include "FrameMac.h"
-#include "WebCoreFrameBridge.h"
+#include "WebFrameLoader.h"
 
 using namespace WebCore;
 
@@ -45,7 +45,6 @@ void IconLoader::receivedResponse(ResourceLoader* resourceLoader, NSURLResponse*
 
 void IconLoader::notifyIconChanged(const KURL& iconURL)
 {
-    FrameMac* frame = Mac(m_frame);
-    [frame->bridge() notifyIconChanged:iconURL.getNSURL()];
+    m_frame->loader()->notifyIconChanged(iconURL.getNSURL());
 }
 
index a00c4d81b1f1c29b9264ae311b5423d5dd4f936d..47cb852f76d02e2538a4e683725b16c17bdea627 100644 (file)
@@ -61,7 +61,7 @@ FrameLoader* DocumentLoader::frameLoader() const
 {
     if (!m_frame)
         return 0;
-    return m_frame->frameLoader();
+    return m_frame->loader();
 }
 
 DocumentLoader::~DocumentLoader()
@@ -212,10 +212,10 @@ void DocumentLoader::mainReceivedError(NSError *error, bool isComplete)
 // but not loads initiated by child frames' data sources -- that's the WebFrame's job.
 void DocumentLoader::stopLoading()
 {
-    // Always attempt to stop the bridge/part because it may still be loading/parsing after the data source
+    // Always attempt to stop the frame because it may still be loading/parsing after the data source
     // is done loading and not stopping it can cause a world leak.
     if (m_committed)
-        [bridge() stopLoading];
+        m_frame->stopLoading();
     
     if (!m_loading)
         return;
@@ -264,7 +264,7 @@ void DocumentLoader::finishedLoading()
     m_gotFirstByte = true;   
     commitIfReady();
     frameLoader()->finishedLoadingDocument(this);
-    [bridge() end];
+    m_frame->end();
 }
 
 void DocumentLoader::setCommitted(bool f)
@@ -324,7 +324,7 @@ void DocumentLoader::setupForReplaceByMIMEType(NSString *newMIMEType)
     }
     
     frameLoader()->finishedLoadingDocument(this);
-    [bridge() end];
+    m_frame->end();
     
     frameLoader()->setReplacing();
     m_gotFirstByte = false;
index c6e888a7cdf80766b0107889446e73b78ec0ed3d..a378eec50e61d015d4583c2541cc7e3c234e2ab4 100644 (file)
@@ -55,7 +55,7 @@ FormState::FormState(PassRefPtr<Element> form, const HashMap<String, String>& va
 
 FormState::FormState(DOMElement *form, NSDictionary *values, WebCoreFrameBridge *sourceFrame)
     : m_form([form _element])
-    , m_sourceFrame([sourceFrame impl])
+    , m_sourceFrame([sourceFrame _frame])
 {
     NSEnumerator *keyEnumerator = [values keyEnumerator];
     while (NSString *key = [keyEnumerator nextObject])
index 15bdd3ffa702829f1ee30113d685fa8e3ebae204..a0700bd68d25873fdea1b97c716127a02828f7e2 100644 (file)
 @class WebCoreFrameBridge;
 @class WebCoreFrameLoaderAsDelegate;
 @class WebPolicyDecider;
-@protocol WebFrameLoaderClient;
 
 namespace WebCore {
 
     class DocumentLoader;
     class FormState;
     class Frame;
+    class FrameLoaderClient;
     class MainResourceLoader;
     class WebResourceLoader;
 
@@ -169,8 +169,8 @@ namespace WebCore {
         NSDictionary *actionInformation(NavigationType, NSEvent *, NSURL *);
         NSDictionary *actionInformation(FrameLoadType loadType, bool isFormSubmission, NSEvent *, NSURL *);
 
-        void setFrameLoaderClient(id <WebFrameLoaderClient>);
-        id <WebFrameLoaderClient> client() const;
+        void setClient(FrameLoaderClient*);
+        FrameLoaderClient* client() const;
 
         void continueAfterWillSubmitForm(WebPolicyAction);
         void continueAfterNewWindowPolicy(WebPolicyAction);
@@ -228,7 +228,7 @@ namespace WebCore {
         HashSet<RefPtr<WebResourceLoader> > m_subresourceLoaders;
         HashSet<RefPtr<WebResourceLoader> > m_plugInStreamLoaders;
     
-        id <WebFrameLoaderClient> m_client;
+        FrameLoaderClient* m_client;
 
         RefPtr<DocumentLoader> m_documentLoader;
         RefPtr<DocumentLoader> m_provisionalDocumentLoader;
index b3e9643232248664710e25511aea53670b5ee676..2ba212a4a2f88ec69028cd68cf48cbb032d483ed 100644 (file)
@@ -64,7 +64,7 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-typedef HashSet<RefPtr<WebCore::WebResourceLoader> > ResourceLoaderSet;
+typedef HashSet<RefPtr<WebResourceLoader> > ResourceLoaderSet;
 
 static double storedTimeOfLastCompletedLoad;
 
@@ -118,12 +118,14 @@ FrameLoader::FrameLoader(Frame* frame)
 FrameLoader::~FrameLoader()
 {
     [m_asDelegate.get() detachFromLoader];
+    if (m_client)
+        m_client->detachFrameLoader();
 }
 
 void FrameLoader::prepareForLoadStart()
 {
-    [m_client _progressStarted];
-    [m_client _dispatchDidStartProvisionalLoadForFrame];
+    m_client->progressStarted();
+    m_client->dispatchDidStartProvisionalLoad();
 }
 
 void FrameLoader::setupForReplace()
@@ -141,7 +143,7 @@ void FrameLoader::setupForReplaceByMIMEType(NSString *newMIMEType)
 
 void FrameLoader::finalSetupForReplace(DocumentLoader* loader)
 {
-    [m_client _clearUnarchivingStateForLoader:loader];
+    m_client->clearUnarchivingState(loader);
 }
 
 void FrameLoader::safeLoad(NSURL *URL)
@@ -151,14 +153,14 @@ void FrameLoader::safeLoad(NSURL *URL)
     request.m_request.setURL(URL);
     request.m_request.setHTTPReferrer(urlOriginalDataAsString([m_documentLoader->request() URL]));
     
-    [bridge() impl]->loadRequest(request, true, [NSApp currentEvent], nil, nil);
+    Mac(m_frame)->loadRequest(request, true, [NSApp currentEvent], nil, nil);
 }
 
 void FrameLoader::load(NSURLRequest *request)
 {
     // FIXME: is this the right place to reset loadType? Perhaps this should be done after loading is finished or aborted.
     m_loadType = FrameLoadTypeStandard;
-    load([m_client _createDocumentLoaderWithRequest:request].get());
+    load(m_client->createDocumentLoader(request).get());
 }
 
 void FrameLoader::load(NSURLRequest *request, NSString *frameName)
@@ -170,7 +172,7 @@ void FrameLoader::load(NSURLRequest *request, NSString *frameName)
 
     Frame* frame = m_frame->tree()->find(frameName);
     if (frame) {
-        frame->frameLoader()->load(request);
+        frame->loader()->load(request);
         return;
     }
 
@@ -180,7 +182,7 @@ void FrameLoader::load(NSURLRequest *request, NSString *frameName)
 
 void FrameLoader::load(NSURLRequest *request, NSDictionary *action, FrameLoadType type, PassRefPtr<FormState> formState)
 {
-    RefPtr<DocumentLoader> loader = [m_client _createDocumentLoaderWithRequest:request];
+    RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request);
     setPolicyDocumentLoader(loader.get());
 
     loader->setTriggeringAction(action);
@@ -210,7 +212,7 @@ void FrameLoader::load(NSURL *URL, NSString *referrer, FrameLoadType newLoadType
     if (target) {
         Frame* targetFrame = m_frame->tree()->find(target);
         if (targetFrame)
-            targetFrame->frameLoader()->load(URL, referrer, newLoadType, nil, event, form, values);
+            targetFrame->loader()->load(URL, referrer, newLoadType, nil, event, form, values);
         else
             checkNewWindowPolicy(request, action, target, formState.release());
         [request release];
@@ -219,7 +221,7 @@ void FrameLoader::load(NSURL *URL, NSString *referrer, FrameLoadType newLoadType
 
     RefPtr<DocumentLoader> oldDocumentLoader = m_documentLoader;
 
-    bool sameURL = [m_client _shouldTreatURLAsSameAsCurrent:URL];
+    bool sameURL = m_client->shouldTreatURLAsSameAsCurrent(URL);
     
     // Make sure to do scroll to anchor processing even if the URL is
     // exactly the same so pages with '#' links and DHTML side effects
@@ -270,7 +272,7 @@ void FrameLoader::load(DocumentLoader* newDocumentLoader)
     NSMutableURLRequest *r = newDocumentLoader->request();
     addExtraFieldsToRequest(r, true, false);
     FrameLoadType type;
-    if ([m_client _shouldTreatURLAsSameAsCurrent:[newDocumentLoader->originalRequest() URL]]) {
+    if (m_client->shouldTreatURLAsSameAsCurrent([newDocumentLoader->originalRequest() URL])) {
         [r setCachePolicy:NSURLRequestReloadIgnoringCacheData];
         type = FrameLoadTypeSame;
     } else
@@ -292,17 +294,17 @@ void FrameLoader::load(DocumentLoader* newDocumentLoader)
 
 void FrameLoader::load(DocumentLoader* loader, FrameLoadType type, PassRefPtr<FormState> formState)
 {
-    ASSERT([m_client _hasWebView]);
+    ASSERT(m_client->hasWebView());
 
     // Unfortunately the view must be non-nil, this is ultimately due
     // to parser requiring a FrameView.  We should fix this dependency.
 
-    ASSERT([m_client _hasFrameView]);
+    ASSERT(m_client->hasFrameView());
 
     m_policyLoadType = type;
 
     if (Frame* parent = m_frame->tree()->parent())
-        loader->setOverrideEncoding(parent->frameLoader()->documentLoader()->overrideEncoding());
+        loader->setOverrideEncoding(parent->loader()->documentLoader()->overrideEncoding());
 
     invalidatePendingPolicyDecision(true);
     setPolicyDocumentLoader(loader);
@@ -335,10 +337,10 @@ void FrameLoader::startLoading()
     if (isLoadingMainResource())
         return;
 
-    [m_client _clearLoadingFromPageCacheForDocumentLoader:m_provisionalDocumentLoader.get()];
+    m_client->clearLoadingFromPageCache(m_provisionalDocumentLoader.get());
 
-    id identifier = [m_client _dispatchIdentifierForInitialRequest:m_provisionalDocumentLoader->originalRequest()
-        fromDocumentLoader:m_provisionalDocumentLoader.get()];
+    id identifier = m_client->dispatchIdentifierForInitialRequest
+        (m_provisionalDocumentLoader.get(), m_provisionalDocumentLoader->originalRequest());
         
     if (!startLoadingMainResource(m_provisionalDocumentLoader->actualRequest(), identifier))
         m_provisionalDocumentLoader->updateLoading();
@@ -362,7 +364,7 @@ void FrameLoader::stopLoading(NSError *error)
 void FrameLoader::stopLoadingSubframes()
 {
     for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
-        child->frameLoader()->stopLoading();
+        child->loader()->stopLoading();
 }
 
 void FrameLoader::stopLoading()
@@ -381,7 +383,7 @@ void FrameLoader::stopLoading()
     if (m_documentLoader)
         m_documentLoader->stopLoading();
     setProvisionalDocumentLoader(0);
-    [m_client _clearArchivedResources];
+    m_client->clearArchivedResources();
 
     m_isStoppingLoad = false;    
 }
@@ -394,7 +396,7 @@ void FrameLoader::cancelMainResourceLoad()
 
 void FrameLoader::cancelPendingArchiveLoad(WebResourceLoader* loader)
 {
-    [m_client _cancelPendingArchiveLoadForLoader:loader];
+    m_client->cancelPendingArchiveLoad(loader);
 }
 
 DocumentLoader* FrameLoader::activeDocumentLoader() const
@@ -420,7 +422,7 @@ void FrameLoader::defersCallbacksChanged()
 {
     bool defers = defersCallbacks();
     for (Frame* child = m_frame; child; child = child->tree()->traverseNext(m_frame))
-        child->frameLoader()->setDefersCallbacks(defers);
+        child->loader()->setDefersCallbacks(defers);
 }
 
 bool FrameLoader::defersCallbacks() const
@@ -442,7 +444,7 @@ void FrameLoader::setDefersCallbacks(bool defers)
         m_mainResourceLoader->setDefersCallbacks(defers);
     setAllDefersCallbacks(m_subresourceLoaders, defers);
     setAllDefersCallbacks(m_plugInStreamLoaders, defers);
-    [m_client _setDefersCallbacks:defers];
+    m_client->setDefersCallbacks(defers);
 }
 
 bool FrameLoader::isLoadingMainResource() const
@@ -499,7 +501,7 @@ void FrameLoader::setDocumentLoader(DocumentLoader* loader)
     ASSERT(loader != m_documentLoader);
     ASSERT(!loader || loader->frameLoader() == this);
 
-    [m_client _prepareForDataSourceReplacement];
+    m_client->prepareForDataSourceReplacement();
     if (m_documentLoader)
         m_documentLoader->detachFromFrame();
 
@@ -556,8 +558,8 @@ double FrameLoader::timeOfLastCompletedLoad()
 void FrameLoader::provisionalLoadStarted()
 {
     m_firstLayoutDone = false;
-    [bridge() provisionalLoadStarted];
-    [m_client _provisionalLoadStarted];
+    m_frame->provisionalLoadStarted();
+    m_client->provisionalLoadStarted();
 }
 
 void FrameLoader::setState(WebFrameState newState)
@@ -577,7 +579,7 @@ void FrameLoader::setState(WebFrameState newState)
 void FrameLoader::clearProvisionalLoad()
 {
     setProvisionalDocumentLoader(0);
-    [m_client _progressCompleted];
+    m_client->progressCompleted();
     setState(WebFrameStateComplete);
 }
 
@@ -598,58 +600,55 @@ void FrameLoader::commitProvisionalLoad()
 
 id FrameLoader::identifierForInitialRequest(NSURLRequest *clientRequest)
 {
-    return [m_client _dispatchIdentifierForInitialRequest:clientRequest fromDocumentLoader:activeDocumentLoader()];
+    return m_client->dispatchIdentifierForInitialRequest(activeDocumentLoader(), clientRequest);
 }
 
 NSURLRequest *FrameLoader::willSendRequest(WebResourceLoader* loader, NSMutableURLRequest *clientRequest, NSURLResponse *redirectResponse)
 {
     [clientRequest setValue:[bridge() userAgentForURL:[clientRequest URL]] forHTTPHeaderField:@"User-Agent"];
-    return [m_client _dispatchResource:loader->identifier() willSendRequest:clientRequest
-        redirectResponse:redirectResponse fromDocumentLoader:activeDocumentLoader()];
+    return m_client->dispatchWillSendRequest(activeDocumentLoader(), loader->identifier(), clientRequest, redirectResponse);
 }
 
 void FrameLoader::didReceiveAuthenticationChallenge(WebResourceLoader* loader, NSURLAuthenticationChallenge *currentWebChallenge)
 {
-    [m_client _dispatchDidReceiveAuthenticationChallenge:currentWebChallenge
-        forResource:loader->identifier() fromDocumentLoader:activeDocumentLoader()];
+    m_client->dispatchDidReceiveAuthenticationChallenge(activeDocumentLoader(), loader->identifier(), currentWebChallenge);
 }
 
 void FrameLoader::didCancelAuthenticationChallenge(WebResourceLoader* loader, NSURLAuthenticationChallenge *currentWebChallenge)
 {
-    [m_client _dispatchDidCancelAuthenticationChallenge:currentWebChallenge
-        forResource:loader->identifier() fromDocumentLoader:activeDocumentLoader()];
+    m_client->dispatchDidCancelAuthenticationChallenge(activeDocumentLoader(), loader->identifier(), currentWebChallenge);
 }
 
 void FrameLoader::didReceiveResponse(WebResourceLoader* loader, NSURLResponse *r)
 {
     activeDocumentLoader()->addResponse(r);
     
-    [m_client _incrementProgressForIdentifier:loader->identifier() response:r];
-    [m_client _dispatchResource:loader->identifier() didReceiveResponse:r fromDocumentLoader:activeDocumentLoader()];
+    m_client->incrementProgress(loader->identifier(), r);
+    m_client->dispatchDidReceiveResponse(activeDocumentLoader(), loader->identifier(), r);
 }
 
 void FrameLoader::didReceiveData(WebResourceLoader* loader, NSData *data, int lengthReceived)
 {
-    [m_client _incrementProgressForIdentifier:loader->identifier() data:data];
-    [m_client _dispatchResource:loader->identifier() didReceiveContentLength:lengthReceived fromDocumentLoader:activeDocumentLoader()];
+    m_client->incrementProgress(loader->identifier(), data);
+    m_client->dispatchDidReceiveContentLength(activeDocumentLoader(), loader->identifier(), lengthReceived);
 }
 
 void FrameLoader::didFinishLoad(WebResourceLoader* loader)
 {    
-    [m_client _completeProgressForIdentifier:loader->identifier()];
-    [m_client _dispatchResource:loader->identifier() didFinishLoadingFromDocumentLoader:activeDocumentLoader()];
+    m_client->completeProgress(loader->identifier());
+    m_client->dispatchDidFinishLoading(activeDocumentLoader(), loader->identifier());
 }
 
 void FrameLoader::didFailToLoad(WebResourceLoader* loader, NSError *error)
 {
-    [m_client _completeProgressForIdentifier:loader->identifier()];
+    m_client->completeProgress(loader->identifier());
     if (error)
-        [m_client _dispatchResource:loader->identifier() didFailLoadingWithError:error fromDocumentLoader:activeDocumentLoader()];
+        m_client->dispatchDidFailLoading(activeDocumentLoader(), loader->identifier(), error);
 }
 
 bool FrameLoader::privateBrowsingEnabled() const
 {
-    return [m_client _privateBrowsingEnabled];
+    return m_client->privateBrowsingEnabled();
 }
 
 NSURLRequest *FrameLoader::originalRequest() const
@@ -659,28 +658,24 @@ NSURLRequest *FrameLoader::originalRequest() const
 
 void FrameLoader::receivedMainResourceError(NSError *error, bool isComplete)
 {
+    // Retain because the stop may release the last reference to it.
+    RefPtr<Frame> protect(m_frame);
+
     RefPtr<DocumentLoader> loader = activeDocumentLoader();
     
-    WebCoreFrameBridge *bridge = FrameLoader::bridge();
-    
-    // Retain the bridge because the stop may release the last reference to it.
-    [bridge retain];
-    id<WebFrameLoaderClient> cli = [m_client retain];
-   
     if (isComplete) {
         // FIXME: Don't want to do this if an entirely new load is going, so should check
         // that both data sources on the frame are either this or nil.
         // Can't call _bridge because we might not have commited yet
-        [bridge stop];
-        if ([cli _shouldFallBackForError:error])
-            [bridge handleFallbackContent];
+        m_frame->stop();
+        if (m_client->shouldFallBack(error))
+            [bridge() handleFallbackContent];
     }
     
     if (m_state == WebFrameStateProvisional) {
         NSURL *failedURL = [m_provisionalDocumentLoader->originalRequestCopy() URL];
-        [bridge didNotOpenURL:failedURL];
-        [m_client _invalidateCurrentItemPageCache];
+        m_frame->didNotOpenURL(failedURL);
+        m_client->invalidateCurrentItemPageCache();
         
         // Call clientRedirectCancelledOrFinished here so that the frame load delegate is notified that the redirect's
         // status has changed, if there was a redirect. The frame load delegate may have saved some state about
@@ -693,9 +688,6 @@ void FrameLoader::receivedMainResourceError(NSError *error, bool isComplete)
     
     
     loader->mainReceivedError(error, isComplete);
-
-    [bridge release];
-    [cli release];
 }
 
 void FrameLoader::clientRedirectCancelledOrFinished(bool cancelWithLoadInProgress)
@@ -703,7 +695,7 @@ void FrameLoader::clientRedirectCancelledOrFinished(bool cancelWithLoadInProgres
     // Note that -webView:didCancelClientRedirectForFrame: is called on the frame load delegate even if
     // the redirect succeeded.  We should either rename this API, or add a new method, like
     // -webView:didFinishClientRedirectForFrame:
-    [m_client _dispatchDidCancelClientRedirectForFrame];
+    m_client->dispatchDidCancelClientRedirect();
 
     if (!cancelWithLoadInProgress)
         m_quickRedirectComing = false;
@@ -713,7 +705,7 @@ void FrameLoader::clientRedirectCancelledOrFinished(bool cancelWithLoadInProgres
 
 void FrameLoader::clientRedirected(NSURL *URL, double seconds, NSDate *date, bool lockHistory, bool isJavaScriptFormAction)
 {
-    [m_client _dispatchWillPerformClientRedirectToURL:URL delay:seconds fireDate:date];
+    m_client->dispatchWillPerformClientRedirect(URL, seconds, date);
     
     // Remember that we sent a redirect notification to the frame load delegate so that when we commit
     // the next provisional load, we can send a corresponding -webView:didCancelClientRedirectForFrame:
@@ -742,7 +734,7 @@ void FrameLoader::continueFragmentScrollAfterNavigationPolicy(NSURLRequest *requ
     m_quickRedirectComing = false;
     
     m_documentLoader->replaceRequestURLForAnchorScroll(URL);
-    if (!isRedirect && ![m_client _shouldTreatURLAsSameAsCurrent:URL]) {
+    if (!isRedirect && !m_client->shouldTreatURLAsSameAsCurrent(URL)) {
         // NB: must happen after _setURL, since we add based on the current request.
         // Must also happen before we openURL and displace the scroll position, since
         // adding the BF item will save away scroll state.
@@ -754,10 +746,10 @@ void FrameLoader::continueFragmentScrollAfterNavigationPolicy(NSURLRequest *requ
         // we have already saved away the scroll and doc state for the long slow load,
         // but it's not an obvious case.
 
-        [m_client _addHistoryItemForFragmentScroll];
+        m_client->addHistoryItemForFragmentScroll();
     }
     
-    [bridge() scrollToAnchorWithURL:URL];
+    m_frame->scrollToAnchor(URL);
     
     if (!isRedirect)
         // This will clear previousItem from the rest of the frame tree that didn't
@@ -765,8 +757,8 @@ void FrameLoader::continueFragmentScrollAfterNavigationPolicy(NSURLRequest *requ
         // we'll not go through a real load and reach Completed state.
         checkLoadComplete();
  
-    [m_client _dispatchDidChangeLocationWithinPageForFrame];
-    [m_client _didFinishLoad];
+    m_client->dispatchDidChangeLocationWithinPage();
+    m_client->didFinishLoad();
 }
 
 void FrameLoader::closeOldDataSources()
@@ -775,22 +767,22 @@ void FrameLoader::closeOldDataSources()
     // If so, add helpers for postorder traversal, and use them. If not, then lets not
     // use a recursive algorithm here.
     for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
-        child->frameLoader()->closeOldDataSources();
+        child->loader()->closeOldDataSources();
     
     if (m_documentLoader)
-        [m_client _dispatchWillCloseFrame];
+        m_client->dispatchWillClose();
 
-    [m_client _setMainFrameDocumentReady:NO]; // stop giving out the actual DOMDocument to observers
+    m_client->setMainFrameDocumentReady(false); // stop giving out the actual DOMDocument to observers
 }
 
 void FrameLoader::opened()
 {
     if (m_loadType == FrameLoadTypeStandard && m_documentLoader->isClientRedirect())
-        [m_client _updateHistoryAfterClientRedirect];
+        m_client->updateHistoryAfterClientRedirect();
 
-    if ([m_client _isDocumentLoaderLoadingFromPageCache:m_documentLoader.get()]) {
+    if (m_client->isLoadingFromPageCache(m_documentLoader.get())) {
         // Force a layout to update view size and thereby update scrollbars.
-        [m_client _forceLayout];
+        m_client->forceLayout();
 
         const ResponseVector& responses = m_documentLoader->responses();
         size_t count = responses.size();
@@ -805,7 +797,7 @@ void FrameLoader::opened()
             [request release];
         }
         
-        [m_client _loadedFromPageCache];
+        m_client->loadedFromPageCache();
 
         m_documentLoader->setPrimaryLoadComplete(true);
 
@@ -829,7 +821,7 @@ void FrameLoader::commitProvisionalLoad(NSDictionary *pageCache)
         closeOldDataSources();
     
     if (!pageCache)
-        [m_client _makeRepresentationForDocumentLoader:pdl.get()];
+        m_client->makeRepresentation(pdl.get());
     
     transitionToCommitted(pageCache);
     
@@ -873,7 +865,7 @@ void FrameLoader::setRequest(NSURLRequest *request)
 
 void FrameLoader::download(NSURLConnection *connection, NSURLRequest *request, NSURLResponse *response, id proxy)
 {
-    [m_client _downloadWithLoadingConnection:connection request:request response:response proxy:proxy];
+    m_client->download(connection, request, response, proxy);
 }
 
 WebCoreFrameBridge *FrameLoader::bridge() const
@@ -903,23 +895,16 @@ void FrameLoader::mainReceivedError(NSError *error, bool isComplete)
 
 void FrameLoader::finishedLoading()
 {
-    RefPtr<DocumentLoader> dl = activeDocumentLoader();
-    
-    WebCoreFrameBridge *bridge = FrameLoader::bridge();
+    // Retain because the stop may release the last reference to it.
+    RefPtr<Frame> protect(m_frame);
 
-    [bridge retain];
+    RefPtr<DocumentLoader> dl = activeDocumentLoader();
     dl->finishedLoading();
-
-    if (dl->mainDocumentError() || !dl->frameLoader()) {
-        [bridge release];
+    if (dl->mainDocumentError() || !dl->frameLoader())
         return;
-    }
-
     dl->setPrimaryLoadComplete(true);
-    [m_client _dispatchDidLoadMainResourceForDocumentLoader:dl.get()];
+    m_client->dispatchDidLoadMainResource(dl.get());
     checkLoadComplete();
-
-    [bridge release];
 }
 
 void FrameLoader::notifyIconChanged(NSURL *iconURL)
@@ -928,7 +913,7 @@ void FrameLoader::notifyIconChanged(NSURL *iconURL)
     NSImage *icon = [[WebCoreIconDatabaseBridge sharedInstance]
         iconForPageURL:urlOriginalDataAsString(activeDocumentLoader()->URL())
         withSize:NSMakeSize(16, 16)];
-    [m_client _dispatchDidReceiveIcon:icon];
+    m_client->dispatchDidReceiveIcon(icon);
 }
 
 NSURL *FrameLoader::URL() const
@@ -938,39 +923,39 @@ NSURL *FrameLoader::URL() const
 
 NSError *FrameLoader::cancelledError(NSURLRequest *request) const
 {
-    return [m_client _cancelledErrorWithRequest:request];
+    return m_client->cancelledError(request);
 }
 
 NSError *FrameLoader::fileDoesNotExistError(NSURLResponse *response) const
 {
-    return [m_client _fileDoesNotExistErrorWithResponse:response];    
+    return m_client->fileDoesNotExistError(response);    
 }
 
 bool FrameLoader::willUseArchive(WebResourceLoader* loader, NSURLRequest *request, NSURL *originalURL) const
 {
-    return [m_client _willUseArchiveForRequest:request originalURL:originalURL loader:loader];
+    return m_client->willUseArchive(loader, request, originalURL);
 }
 
 bool FrameLoader::isArchiveLoadPending(WebResourceLoader* loader) const
 {
-    return [m_client _archiveLoadPendingForLoader:loader];
+    return m_client->isArchiveLoadPending(loader);
 }
 
 void FrameLoader::handleUnimplementablePolicy(NSError *error)
 {
-    m_delegateIsHandlingUnimplementablePolicy = YES;
-    [m_client _dispatchUnableToImplementPolicyWithError:error];
-    m_delegateIsHandlingUnimplementablePolicy = NO;
+    m_delegateIsHandlingUnimplementablePolicy = true;
+    m_client->dispatchUnableToImplementPolicy(error);
+    m_delegateIsHandlingUnimplementablePolicy = false;
 }
 
 void FrameLoader::cannotShowMIMEType(NSURLResponse *response)
 {
-    handleUnimplementablePolicy([m_client _cannotShowMIMETypeErrorWithResponse:response]);
+    handleUnimplementablePolicy(m_client->cannotShowMIMETypeError(response));
 }
 
 NSError *FrameLoader::interruptionForPolicyChangeError(NSURLRequest *request)
 {
-    return [m_client _interruptForPolicyChangeErrorWithRequest:request];
+    return m_client->interruptForPolicyChangeError(request);
 }
 
 bool FrameLoader::isHostedByObjectElement() const
@@ -986,17 +971,17 @@ bool FrameLoader::isLoadingMainFrame() const
 
 bool FrameLoader::canShowMIMEType(NSString *MIMEType) const
 {
-    return [m_client _canShowMIMEType:MIMEType];
+    return m_client->canShowMIMEType(MIMEType);
 }
 
 bool FrameLoader::representationExistsForURLScheme(NSString *URLScheme)
 {
-    return [m_client _representationExistsForURLScheme:URLScheme];
+    return m_client->representationExistsForURLScheme(URLScheme);
 }
 
 NSString *FrameLoader::generatedMIMETypeForURLScheme(NSString *URLScheme)
 {
-    return [m_client _generatedMIMETypeForURLScheme:URLScheme];
+    return m_client->generatedMIMETypeForURLScheme(URLScheme);
 }
 
 void FrameLoader::checkNavigationPolicy(NSURLRequest *newRequest, id obj, SEL sel)
@@ -1006,9 +991,9 @@ void FrameLoader::checkNavigationPolicy(NSURLRequest *newRequest, id obj, SEL se
 
 void FrameLoader::checkContentPolicy(NSString *MIMEType, id obj, SEL sel)
 {
-    WebPolicyDecider *d = [m_client _createPolicyDeciderWithTarget:obj action:sel];
+    WebPolicyDecider *d = m_client->createPolicyDecider(obj, sel);
     m_policyDecider = d;
-    [m_client _dispatchDecidePolicyForMIMEType:MIMEType request:activeDocumentLoader()->request() decider:d];
+    m_client->dispatchDecidePolicyForMIMEType(d, MIMEType, activeDocumentLoader()->request());
     [d release];
 }
 
@@ -1053,7 +1038,7 @@ void FrameLoader::reloadAllowingStaleData(NSString *encoding)
 
     [request setCachePolicy:NSURLRequestReturnCacheDataElseLoad];
 
-    RefPtr<DocumentLoader> loader = [m_client _createDocumentLoaderWithRequest:request];
+    RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request);
     setPolicyDocumentLoader(loader.get());
 
     [request release];
@@ -1080,7 +1065,7 @@ void FrameLoader::reload()
     if (unreachableURL != nil)
         initialRequest = [NSURLRequest requestWithURL:unreachableURL];
     
-    RefPtr<DocumentLoader> loader = [m_client _createDocumentLoaderWithRequest:initialRequest];
+    RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(initialRequest);
     setPolicyDocumentLoader(loader.get());
 
     NSMutableURLRequest *request = loader->request();
@@ -1098,17 +1083,17 @@ void FrameLoader::reload()
 
 void FrameLoader::didReceiveServerRedirectForProvisionalLoadForFrame()
 {
-    [m_client _dispatchDidReceiveServerRedirectForProvisionalLoadForFrame];
+    m_client->dispatchDidReceiveServerRedirectForProvisionalLoad();
 }
 
 void FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
 {
-    [m_client _finishedLoadingDocument:loader];
+    m_client->finishedLoading(loader);
 }
 
 void FrameLoader::committedLoad(DocumentLoader* loader, NSData *data)
 {
-    [m_client _committedLoadWithDocumentLoader:loader data:data];
+    m_client->committedLoad(loader, data);
 }
 
 bool FrameLoader::isReplacing() const
@@ -1123,18 +1108,18 @@ void FrameLoader::setReplacing()
 
 void FrameLoader::revertToProvisional(DocumentLoader* loader)
 {
-    [m_client _revertToProvisionalStateForDocumentLoader:loader];
+    m_client->revertToProvisionalState(loader);
 }
 
 void FrameLoader::setMainDocumentError(DocumentLoader* loader, NSError *error)
 {
-    [m_client _setMainDocumentError:error forDocumentLoader:loader];
+    m_client->setMainDocumentError(loader, error);
 }
 
 void FrameLoader::mainReceivedCompleteError(DocumentLoader* loader, NSError *error)
 {
     loader->setPrimaryLoadComplete(true);
-    [m_client _dispatchDidLoadMainResourceForDocumentLoader:activeDocumentLoader()];
+    m_client->dispatchDidLoadMainResource(activeDocumentLoader());
     checkLoadComplete();
 }
 
@@ -1142,7 +1127,7 @@ bool FrameLoader::subframeIsLoading() const
 {
     // It's most likely that the last added frame is the last to load so we walk backwards.
     for (Frame* child = m_frame->tree()->lastChild(); child; child = child->tree()->previousSibling()) {
-        FrameLoader* childLoader = child->frameLoader();
+        FrameLoader* childLoader = child->loader();
         DocumentLoader* documentLoader = childLoader->documentLoader();
         if (documentLoader && documentLoader->isLoadingInAPISense())
             return true;
@@ -1155,21 +1140,21 @@ bool FrameLoader::subframeIsLoading() const
 
 void FrameLoader::willChangeTitle(DocumentLoader* loader)
 {
-    [m_client _willChangeTitleForDocument:loader];
+    m_client->willChangeTitle(loader);
 }
 
 void FrameLoader::didChangeTitle(DocumentLoader* loader)
 {
-    [m_client _didChangeTitleForDocument:loader];
+    m_client->didChangeTitle(loader);
 
     // The title doesn't get communicated to the WebView until we are committed.
     if (loader->isCommitted())
         if (NSURL *URLForHistory = canonicalURL(loader->URLForHistory())) {
             // Must update the entries in the back-forward list too.
             // This must go through the WebFrame because it has the right notion of the current b/f item.
-            [m_client _setTitle:loader->title() forURL:URLForHistory];
-            [m_client _setMainFrameDocumentReady:YES]; // update observers with new DOMDocument
-            [m_client _dispatchDidReceiveTitle:loader->title()];
+            m_client->setTitle(loader->title(), URLForHistory);
+            m_client->setMainFrameDocumentReady(true); // update observers with new DOMDocument
+            m_client->dispatchDidReceiveTitle(loader->title());
         }
 }
 
@@ -1203,8 +1188,8 @@ void FrameLoader::invalidatePendingPolicyDecision(bool callDefaultAction)
 void FrameLoader::checkNewWindowPolicy(NSURLRequest *request, NSDictionary *action,
     NSString *frameName, PassRefPtr<FormState> formState)
 {
-    WebPolicyDecider *decider = [m_client _createPolicyDeciderWithTarget:asDelegate()
-        action:@selector(continueAfterNewWindowPolicy:)];
+    WebPolicyDecider *decider = m_client->createPolicyDecider(asDelegate(),
+        @selector(continueAfterNewWindowPolicy:));
 
     m_policyRequest = request;
     m_policyTarget = asDelegate();
@@ -1213,8 +1198,7 @@ void FrameLoader::checkNewWindowPolicy(NSURLRequest *request, NSDictionary *acti
     m_policyDecider = decider;
     m_policyFormState = formState;
 
-    [m_client _dispatchDecidePolicyForNewWindowAction:action request:request
-        newFrameName:frameName decider:decider];
+    m_client->dispatchDecidePolicyForNewWindowAction(decider, action, request, frameName);
 
     [decider release];
 }
@@ -1234,7 +1218,7 @@ void FrameLoader::continueAfterNewWindowPolicy(WebPolicyAction policy)
             request = nil;
             break;
         case WebPolicyDownload:
-            [m_client _startDownloadWithRequest:request.get()];
+            m_client->startDownload(request.get());
             request = nil;
             break;
         case WebPolicyUse:
@@ -1271,8 +1255,8 @@ void FrameLoader::checkNavigationPolicy(NSURLRequest *request, DocumentLoader* l
     
     loader->setLastCheckedRequest(request);
 
-    WebPolicyDecider *decider = [m_client _createPolicyDeciderWithTarget:asDelegate()
-        action:@selector(continueAfterNavigationPolicy:)];
+    WebPolicyDecider *decider = m_client->createPolicyDecider(asDelegate(),
+        @selector(continueAfterNavigationPolicy:));
     
     m_policyRequest = request;
     m_policyTarget = target;
@@ -1281,7 +1265,7 @@ void FrameLoader::checkNavigationPolicy(NSURLRequest *request, DocumentLoader* l
     m_policyFormState = formState;
 
     m_delegateIsDecidingNavigationPolicy = true;
-    [m_client _dispatchDecidePolicyForNavigationAction:action request:request decider:decider];
+    m_client->dispatchDecidePolicyForNavigationAction(decider, action, request);
     m_delegateIsDecidingNavigationPolicy = false;
     
     [decider release];
@@ -1301,12 +1285,12 @@ void FrameLoader::continueAfterNavigationPolicy(WebPolicyAction policy)
             request = nil;
             break;
         case WebPolicyDownload:
-            [m_client _startDownloadWithRequest:request.get()];
+            m_client->startDownload(request.get());
             request = nil;
             break;
         case WebPolicyUse:
-            if (![m_client _canHandleRequest:request.get()]) {
-                handleUnimplementablePolicy([m_client _cannotShowURLErrorWithRequest:request.get()]);
+            if (!m_client->canHandleRequest(request.get())) {
+                handleUnimplementablePolicy(m_client->cannotShowURLError(request.get()));
                 request = nil;
             }
             break;
@@ -1331,7 +1315,7 @@ void FrameLoader::continueLoadRequestAfterNavigationPolicy(NSURLRequest *request
     // through this method already, nested; otherwise, policyDataSource should still be set.
     ASSERT(m_policyDocumentLoader || m_provisionalDocumentLoader->unreachableURL());
 
-    BOOL isTargetItem = [m_client _provisionalItemIsTarget];
+    BOOL isTargetItem = m_client->provisionalItemIsTarget();
 
     // Two reasons we can't continue:
     //    1) Navigation policy delegate said we can't so request is nil. A primary case of this 
@@ -1352,7 +1336,7 @@ void FrameLoader::continueLoadRequestAfterNavigationPolicy(NSURLRequest *request
         // problem that we have optimistically moved the b/f cursor already, so move it back.  For sanity, 
         // we only do this when punting a navigation for the target frame or top-level frame.  
         if ((isTargetItem || isLoadingMainFrame()) && isBackForwardLoadType(m_policyLoadType))
-            [m_client _resetBackForwardList];
+            m_client->resetBackForwardList();
 
         return;
     }
@@ -1365,17 +1349,15 @@ void FrameLoader::continueLoadRequestAfterNavigationPolicy(NSURLRequest *request
 
     setPolicyDocumentLoader(0);
 
-    if (isBackForwardLoadType(type) && [m_client _loadProvisionalItemFromPageCache])
+    if (isBackForwardLoadType(type) && m_client->loadProvisionalItemFromPageCache())
         return;
 
     if (formState) {
         // It's a bit of a hack to reuse the WebPolicyDecisionListener for the continuation
         // mechanism across the willSubmitForm callout.
-        WebPolicyDecider *decider = [m_client _createPolicyDeciderWithTarget:asDelegate() action:@selector(continueAfterWillSubmitForm:)];
+        WebPolicyDecider *decider = m_client->createPolicyDecider(asDelegate(), @selector(continueAfterWillSubmitForm:));
         m_policyDecider = decider;
-        [m_client _dispatchSourceFrame:Mac(formState->sourceFrame())->bridge()
-            willSubmitForm:[DOMElement _elementWith:formState->form()]
-            withValues:formState->valuesAsNSDictionary() submissionDecider:decider];
+        m_client->dispatchWillSubmitForm(decider, formState->sourceFrame(), formState->form(), formState->valuesAsNSDictionary());
         [decider release];
     } else
         continueAfterWillSubmitForm(WebPolicyUse);
@@ -1383,19 +1365,19 @@ void FrameLoader::continueLoadRequestAfterNavigationPolicy(NSURLRequest *request
 
 void FrameLoader::didFirstLayout()
 {
-    if (isBackForwardLoadType(m_loadType) && [m_client _hasBackForwardList])
-        [m_client _restoreScrollPositionAndViewState];
+    if (isBackForwardLoadType(m_loadType) && m_client->hasBackForwardList())
+        m_client->restoreScrollPositionAndViewState();
 
     m_firstLayoutDone = true;
-    [m_client _dispatchDidFirstLayoutInFrame];
+    m_client->dispatchDidFirstLayout();
 }
 
 void FrameLoader::frameLoadCompleted()
 {
-    [m_client _frameLoadCompleted];
+    m_client->frameLoadCompleted();
 
     // After a canceled provisional load, firstLayoutDone is false.
-    // Reset it to YES if we're displaying a page.
+    // Reset it to true if we're displaying a page.
     if (m_documentLoader)
         m_firstLayoutDone = true;
 }
@@ -1412,14 +1394,14 @@ bool FrameLoader::isQuickRedirectComing() const
 
 void FrameLoader::transitionToCommitted(NSDictionary *pageCache)
 {
-    ASSERT([m_client _hasWebView]);
+    ASSERT(m_client->hasWebView());
     ASSERT(m_state == WebFrameStateProvisional);
 
     if (m_state != WebFrameStateProvisional)
         return;
 
-    [m_client _setCopiesOnScroll];
-    [m_client _updateHistoryForCommit];
+    m_client->setCopiesOnScroll();
+    m_client->updateHistoryForCommit();
 
     // The call to closeURL invokes the unload event handler, which can execute arbitrary
     // JavaScript. If the script initiates a new load, we need to abandon the current load,
@@ -1439,37 +1421,37 @@ void FrameLoader::transitionToCommitted(NSDictionary *pageCache)
     case FrameLoadTypeForward:
     case FrameLoadTypeBack:
     case FrameLoadTypeIndexedBackForward:
-        if ([m_client _hasBackForwardList]) {
-            [m_client _updateHistoryForBackForwardNavigation];
+        if (m_client->hasBackForwardList()) {
+            m_client->updateHistoryForBackForwardNavigation();
 
             // Create a document view for this document, or used the cached view.
             if (pageCache)
-                [m_client _setDocumentViewFromPageCache:pageCache];
+                m_client->setDocumentViewFromPageCache(pageCache);
             else
-                [m_client _makeDocumentView];
+                m_client->makeDocumentView();
         }
         break;
 
     case FrameLoadTypeReload:
     case FrameLoadTypeSame:
     case FrameLoadTypeReplace:
-        [m_client _updateHistoryForReload];
-        [m_client _makeDocumentView];
+        m_client->updateHistoryForReload();
+        m_client->makeDocumentView();
         break;
 
     // FIXME - just get rid of this case, and merge FrameLoadTypeReloadAllowingStaleData with the above case
     case FrameLoadTypeReloadAllowingStaleData:
-        [m_client _makeDocumentView];
+        m_client->makeDocumentView();
         break;
 
     case FrameLoadTypeStandard:
-        [m_client _updateHistoryForStandardLoad];
-        [m_client _makeDocumentView];
+        m_client->updateHistoryForStandardLoad();
+        m_client->makeDocumentView();
         break;
 
     case FrameLoadTypeInternal:
-        [m_client _updateHistoryForInternalLoad];
-        [m_client _makeDocumentView];
+        m_client->updateHistoryForInternalLoad();
+        m_client->makeDocumentView();
         break;
 
     // FIXME Remove this check when dummy ds is removed (whatever "dummy ds" is).
@@ -1479,17 +1461,17 @@ void FrameLoader::transitionToCommitted(NSDictionary *pageCache)
     }
 
     // Tell the client we've committed this URL.
-    ASSERT([m_client _hasFrameView]);
-    [m_client _dispatchDidCommitLoadForFrame];
+    ASSERT(m_client->hasFrameView());
+    m_client->dispatchDidCommitLoad();
     
     // If we have a title let the WebView know about it.
     if (ptitle)
-        [m_client _dispatchDidReceiveTitle:ptitle];
+        m_client->dispatchDidReceiveTitle(ptitle);
 }
 
 void FrameLoader::checkLoadCompleteForThisFrame()
 {
-    ASSERT([m_client _hasWebView]);
+    ASSERT(m_client->hasWebView());
 
     switch (m_state) {
         case WebFrameStateProvisional: {
@@ -1504,11 +1486,11 @@ void FrameLoader::checkLoadCompleteForThisFrame()
                 return;
 
             // Check all children first.
-            LoadErrorResetToken *resetToken = [m_client _tokenForLoadErrorReset];
+            LoadErrorResetToken *resetToken = m_client->tokenForLoadErrorReset();
             bool shouldReset = true;
             if (!pdl->isLoadingInAPISense()) {
                 m_delegateIsHandlingProvisionalLoadError = true;
-                [m_client _dispatchDidFailProvisionalLoadWithError:error];
+                m_client->dispatchDidFailProvisionalLoad(error);
                 m_delegateIsHandlingProvisionalLoadError = false;
 
                 // FIXME: can stopping loading here possibly have any effect, if isLoading is false,
@@ -1528,9 +1510,9 @@ void FrameLoader::checkLoadCompleteForThisFrame()
                 }
             }
             if (shouldReset)
-                [m_client _resetAfterLoadError:resetToken];
+                m_client->resetAfterLoadError(resetToken);
             else
-                [m_client _doNotResetAfterLoadError:resetToken];
+                m_client->doNotResetAfterLoadError(resetToken);
             return;
         }
         
@@ -1545,27 +1527,27 @@ void FrameLoader::checkLoadCompleteForThisFrame()
             // Maybe there are bugs because of that, or extra work we can skip because
             // the new page is ready.
 
-            [m_client _forceLayoutForNonHTML];
+            m_client->forceLayoutForNonHTML();
              
             // If the user had a scroll point, scroll to it, overriding the anchor point if any.
             if ((isBackForwardLoadType(m_loadType) || m_loadType == FrameLoadTypeReload)
-                    && [m_client _hasBackForwardList])
-                [m_client _restoreScrollPositionAndViewState];
+                    && m_client->hasBackForwardList())
+                m_client->restoreScrollPositionAndViewState();
 
             NSError *error = dl->mainDocumentError();
             if (error)
-                [m_client _dispatchDidFailLoadWithError:error];
+                m_client->dispatchDidFailLoad(error);
             else
-                [m_client _dispatchDidFinishLoadForFrame];
+                m_client->dispatchDidFinishLoad();
 
-            [m_client _progressCompleted];
+            m_client->progressCompleted();
             return;
         }
         
         case WebFrameStateComplete:
             // Even if already complete, we might have set a previous item on a frame that
             // didn't do any data loading on the past transaction. Make sure to clear these out.
-            [m_client _frameLoadCompleted];
+            m_client->frameLoadCompleted();
             return;
     }
 
@@ -1579,44 +1561,39 @@ void FrameLoader::continueLoadRequestAfterNewWindowPolicy(NSURLRequest *request,
 
     RefPtr<Frame> frame = m_frame;
 
-    WebCoreFrameBridge *mainBridge = [m_client _dispatchCreateWebViewWithRequest:nil];
-    if (!mainBridge)
+    RefPtr<Frame> mainFrame = m_client->dispatchCreatePage(nil);
+    if (!mainFrame)
         return;
 
-    [mainBridge retain];
-
-    [mainBridge setName:frameName];
-    [[mainBridge impl]->frameLoader()->client() _dispatchShow];
-    [mainBridge impl]->setOpener(frame.get());
-    [mainBridge impl]->frameLoader()->load(request, nil, FrameLoadTypeStandard, formState);
-
-    [mainBridge release];
+    [Mac(mainFrame.get())->bridge() setName:frameName];
+    mainFrame->loader()->client()->dispatchShow();
+    mainFrame->setOpener(frame.get());
+    mainFrame->loader()->load(request, nil, FrameLoadTypeStandard, formState);
 }
 
 void FrameLoader::sendRemainingDelegateMessages(id identifier, NSURLResponse *response, unsigned length, NSError *error)
 {    
     if (response)
-        [m_client _dispatchResource:identifier didReceiveResponse:response fromDocumentLoader:m_documentLoader.get()];
+        m_client->dispatchDidReceiveResponse(m_documentLoader.get(), identifier, response);
     
     if (length > 0)
-        [m_client _dispatchResource:identifier didReceiveContentLength:length fromDocumentLoader:m_documentLoader.get()];
+        m_client->dispatchDidReceiveContentLength(m_documentLoader.get(), identifier, length);
     
     if (!error)
-        [m_client _dispatchResource:identifier didFinishLoadingFromDocumentLoader:m_documentLoader.get()];
+        m_client->dispatchDidFinishLoading(m_documentLoader.get(), identifier);
     else
-        [m_client _dispatchResource:identifier didFailLoadingWithError:error fromDocumentLoader:m_documentLoader.get()];
+        m_client->dispatchDidFailLoading(m_documentLoader.get(), identifier, error);
 }
 
 NSURLRequest *FrameLoader::requestFromDelegate(NSURLRequest *request, id& identifier, NSError *& error)
 {
     ASSERT(request != nil);
 
-    identifier = [m_client _dispatchIdentifierForInitialRequest:request fromDocumentLoader:m_documentLoader.get()]; 
-    NSURLRequest *newRequest = [m_client _dispatchResource:identifier
-        willSendRequest:request redirectResponse:nil fromDocumentLoader:m_documentLoader.get()];
+    identifier = m_client->dispatchIdentifierForInitialRequest(m_documentLoader.get(), request); 
+    NSURLRequest *newRequest = m_client->dispatchWillSendRequest(m_documentLoader.get(), identifier, request, nil);
 
     if (newRequest == nil)
-        error = [m_client _cancelledErrorWithRequest:request];
+        error = m_client->cancelledError(request);
     else
         error = nil;
 
@@ -1648,7 +1625,7 @@ void FrameLoader::post(NSURL *URL, NSString *referrer, NSString *target, NSArray
     if (target != nil) {
         Frame* targetFrame = m_frame->tree()->find(target);
         if (targetFrame)
-            targetFrame->frameLoader()->load(request, action, FrameLoadTypeStandard, formState.release());
+            targetFrame->loader()->load(request, action, FrameLoadTypeStandard, formState.release());
         else
             checkNewWindowPolicy(request, action, target, formState.release());
     } else
@@ -1663,29 +1640,25 @@ void FrameLoader::detachChildren()
     Frame* previous;
     for (Frame* child = m_frame->tree()->lastChild(); child; child = previous) {
         previous = child->tree()->previousSibling();
-        child->frameLoader()->detachFromParent();
+        child->loader()->detachFromParent();
     }
 }
 
 void FrameLoader::detachFromParent()
 {
-    WebCoreFrameBridge *bridge = [FrameLoader::bridge() retain];
-    id <WebFrameLoaderClient> client = [m_client retain];
+    RefPtr<Frame> protect(m_frame);
 
-    [bridge closeURL];
+    [bridge() closeURL];
     stopLoading();
-    [client _detachedFromParent1];
+    m_client->detachedFromParent1();
     detachChildren();
-    [client _detachedFromParent2];
+    m_client->detachedFromParent2();
     setDocumentLoader(0);
-    [client _detachedFromParent3];
+    m_client->detachedFromParent3();
     if (Frame* parent = m_frame->tree()->parent())
         parent->tree()->removeChild(m_frame);
-    [bridge close];
-    [client _detachedFromParent4];
-
-    [client release];
-    [bridge release];
+    [bridge() close];
+    m_client->detachedFromParent4();
 }
 
 void FrameLoader::addExtraFieldsToRequest(NSMutableURLRequest *request, bool mainResource, bool alwaysFromRequest)
@@ -1700,7 +1673,7 @@ void FrameLoader::addExtraFieldsToRequest(NSMutableURLRequest *request, bool mai
         if (mainResource && (isLoadingMainFrame() || alwaysFromRequest))
             [request setMainDocumentURL:[request URL]];
         else
-            [request setMainDocumentURL:[m_client _mainFrameURL]];
+            [request setMainDocumentURL:m_client->mainFrameURL()];
     }
     
     if (mainResource)
@@ -1730,7 +1703,7 @@ NSDictionary *FrameLoader::actionInformation(NavigationType navigationType, NSEv
     NSString *ActionButtonKey = @"WebActionButtonKey"; 
     NSString *ActionModifierFlagsKey = @"WebActionModifierFlagsKey";
     NSString *ActionOriginalURLKey = @"WebActionOriginalURLKey";
-    NSDictionary *elementInfo = [m_client _elementForEvent:event];
+    NSDictionary *elementInfo = m_client->elementForEvent(event);
     if (elementInfo)
         return [NSDictionary dictionaryWithObjectsAndKeys:
             [NSNumber numberWithInt:navigationType], ActionNavigationTypeKey,
@@ -1749,18 +1722,20 @@ NSDictionary *FrameLoader::actionInformation(NavigationType navigationType, NSEv
 // Called every time a resource is completely loaded, or an error is received.
 void FrameLoader::checkLoadComplete()
 {
-    ASSERT([m_client _hasWebView]);
+    ASSERT(m_client->hasWebView());
 
     for (RefPtr<Frame> frame = m_frame; frame; frame = frame->tree()->parent())
-        frame->frameLoader()->checkLoadCompleteForThisFrame();
+        frame->loader()->checkLoadCompleteForThisFrame();
 }
 
-void FrameLoader::setFrameLoaderClient(id <WebFrameLoaderClient> client)
+void FrameLoader::setClient(FrameLoaderClient* client)
 {
+    ASSERT(client);
+    ASSERT(!m_client);
     m_client = client;
 }
 
-id <WebFrameLoaderClient> FrameLoader::client() const
+FrameLoaderClient* FrameLoader::client() const
 {
     return m_client;
 }
@@ -1775,6 +1750,10 @@ WebCoreFrameLoaderAsDelegate *FrameLoader::asDelegate()
     return m_asDelegate.get();
 }
 
+FrameLoaderClient::~FrameLoaderClient()
+{
+}
+
 }
 
 @implementation WebCoreFrameLoaderAsDelegate
index c4a02cd9dd13ee4ab146e480bd37e81d64898541..d0d15abee9f51d26fb3f4b507cbb9a3f344d3312 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <Cocoa/Cocoa.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Forward.h>
+
+@class WebPolicyDecider;
 
 namespace WebCore {
+
     class DocumentLoader;
+    class Element;
+    class Frame;
     class WebResourceLoader;
-}
 
-typedef struct LoadErrorResetToken LoadErrorResetToken;
+    struct LoadErrorResetToken;
 
-@class DOMElement;
-@class WebCoreFrameBridge;
-@class WebPolicyDecider;
-@class WebResource;
+    class FrameLoaderClient : Noncopyable {
+    public:
+        virtual void detachFrameLoader() = 0;
 
-@protocol WebFrameLoaderClient <NSObject>
+        virtual bool hasWebView() const = 0; // mainly for assertions
+        virtual bool hasFrameView() const = 0; // ditto
 
-- (BOOL)_hasWebView; // mainly for assertions
-- (BOOL)_hasFrameView; // ditto
+        virtual bool hasBackForwardList() const = 0;
+        virtual void resetBackForwardList() = 0;
 
-- (BOOL)_hasBackForwardList;
-- (void)_resetBackForwardList;
+        virtual bool provisionalItemIsTarget() const = 0;
+        virtual bool loadProvisionalItemFromPageCache() = 0;
+        virtual void invalidateCurrentItemPageCache() = 0;
 
-- (BOOL)_provisionalItemIsTarget;
-- (BOOL)_loadProvisionalItemFromPageCache;
-- (void)_invalidateCurrentItemPageCache;
+        virtual bool privateBrowsingEnabled() const = 0;
 
-- (BOOL)_privateBrowsingEnabled;
+        virtual void makeDocumentView() = 0;
+        virtual void makeRepresentation(DocumentLoader*) = 0;
+        virtual void setDocumentViewFromPageCache(NSDictionary *) = 0;
+        virtual void forceLayout() = 0;
+        virtual void forceLayoutForNonHTML() = 0;
 
-- (void)_makeDocumentView;
-- (void)_makeRepresentationForDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_setDocumentViewFromPageCache:(NSDictionary *)dictionary;
-- (void)_forceLayout;
-- (void)_forceLayoutForNonHTML;
+        virtual void updateHistoryForCommit() = 0;
 
-- (void)_updateHistoryForCommit;
+        virtual void updateHistoryForBackForwardNavigation() = 0;
+        virtual void updateHistoryForReload() = 0;
+        virtual void updateHistoryForStandardLoad() = 0;
+        virtual void updateHistoryForInternalLoad() = 0;
 
-- (void)_updateHistoryForBackForwardNavigation;
-- (void)_updateHistoryForReload;
-- (void)_updateHistoryForStandardLoad;
-- (void)_updateHistoryForInternalLoad;
+        virtual void updateHistoryAfterClientRedirect() = 0;
 
-- (void)_updateHistoryAfterClientRedirect;
+        virtual void setCopiesOnScroll() = 0;
 
-- (void)_setCopiesOnScroll;
+        virtual LoadErrorResetToken* tokenForLoadErrorReset() = 0;
+        virtual void resetAfterLoadError(LoadErrorResetToken*) = 0;
+        virtual void doNotResetAfterLoadError(LoadErrorResetToken*) = 0;
 
-- (LoadErrorResetToken *)_tokenForLoadErrorReset;
-- (void)_resetAfterLoadError:(LoadErrorResetToken *)token;
-- (void)_doNotResetAfterLoadError:(LoadErrorResetToken *)token;
+        virtual void detachedFromParent1() = 0;
+        virtual void detachedFromParent2() = 0;
+        virtual void detachedFromParent3() = 0;
+        virtual void detachedFromParent4() = 0;
 
-- (void)_detachedFromParent1;
-- (void)_detachedFromParent2;
-- (void)_detachedFromParent3;
-- (void)_detachedFromParent4;
+        virtual void loadedFromPageCache() = 0;
 
-- (void)_loadedFromPageCache;
+        virtual void download(NSURLConnection *, NSURLRequest *, NSURLResponse *, id proxy) = 0;
 
-- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response proxy:(id)proxy;
+        virtual id dispatchIdentifierForInitialRequest(DocumentLoader*, NSURLRequest *) = 0;
+        virtual NSURLRequest *dispatchWillSendRequest(DocumentLoader*, id identifier, NSURLRequest *, NSURLResponse *redirectResponse) = 0;
+        virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, id identifier, NSURLAuthenticationChallenge *) = 0;
+        virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, id identifier, NSURLAuthenticationChallenge *) = 0;
+        virtual void dispatchDidReceiveResponse(DocumentLoader*, id identifier, NSURLResponse *) = 0;
+        virtual void dispatchDidReceiveContentLength(DocumentLoader*, id identifier, int lengthReceived) = 0;
+        virtual void dispatchDidFinishLoading(DocumentLoader*, id identifier) = 0;
+        virtual void dispatchDidFailLoading(DocumentLoader*, id identifier, NSError *) = 0;
 
-- (id)_dispatchIdentifierForInitialRequest:(NSURLRequest *)request fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (NSURLRequest *)_dispatchResource:(id)identifier willSendRequest:(NSURLRequest *)clientRequest redirectResponse:(NSURLResponse *)redirectResponse fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchDidReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchDidCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchResource:(id)identifier didReceiveResponse:(NSURLResponse *)r fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchResource:(id)identifier didReceiveContentLength:(int)lengthReceived fromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchResource:(id)identifier didFinishLoadingFromDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_dispatchResource:(id)identifier didFailLoadingWithError:error fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+        virtual void dispatchDidHandleOnloadEvents() = 0;
+        virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() = 0;
+        virtual void dispatchDidCancelClientRedirect() = 0;
+        virtual void dispatchWillPerformClientRedirect(NSURL *URL, NSTimeInterval, NSDate *) = 0;
+        virtual void dispatchDidChangeLocationWithinPage() = 0;
+        virtual void dispatchWillClose() = 0;
+        virtual void dispatchDidReceiveIcon(NSImage *) = 0;
+        virtual void dispatchDidStartProvisionalLoad() = 0;
+        virtual void dispatchDidReceiveTitle(NSString *title) = 0;
+        virtual void dispatchDidCommitLoad() = 0;
+        virtual void dispatchDidFailProvisionalLoad(NSError *) = 0;
+        virtual void dispatchDidFailLoad(NSError *) = 0;
+        virtual void dispatchDidFinishLoad() = 0;
+        virtual void dispatchDidFirstLayout() = 0;
 
-- (void)_dispatchDidHandleOnloadEventsForFrame;
-- (void)_dispatchDidReceiveServerRedirectForProvisionalLoadForFrame;
-- (void)_dispatchDidCancelClientRedirectForFrame;
-- (void)_dispatchWillPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date;
-- (void)_dispatchDidChangeLocationWithinPageForFrame;
-- (void)_dispatchWillCloseFrame;
-- (void)_dispatchDidReceiveIcon:(NSImage *)icon;
-- (void)_dispatchDidStartProvisionalLoadForFrame;
-- (void)_dispatchDidReceiveTitle:(NSString *)title;
-- (void)_dispatchDidCommitLoadForFrame;
-- (void)_dispatchDidFailProvisionalLoadWithError:(NSError *)error;
-- (void)_dispatchDidFailLoadWithError:(NSError *)error;
-- (void)_dispatchDidFinishLoadForFrame;
-- (void)_dispatchDidFirstLayoutInFrame;
+        virtual Frame* dispatchCreatePage(NSURLRequest *) = 0;
+        virtual void dispatchShow() = 0;
 
-- (WebCoreFrameBridge *)_dispatchCreateWebViewWithRequest:(NSURLRequest *)request;
-- (void)_dispatchShow;
+        virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, NSString *MIMEType, NSURLRequest *) = 0;
+        virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, NSString *frameName) = 0;
+        virtual void dispatchDecidePolicyForNavigationAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *) = 0;
+        virtual void dispatchUnableToImplementPolicy(NSError *) = 0;
 
-- (void)_dispatchDecidePolicyForMIMEType:(NSString *)MIMEType request:(NSURLRequest *)request decider:(WebPolicyDecider *)decider;
-- (void)_dispatchDecidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frameName decider:(WebPolicyDecider *)decider;
-- (void)_dispatchDecidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request decider:(WebPolicyDecider *)decider;
-- (void)_dispatchUnableToImplementPolicyWithError:(NSError *)error;
+        virtual void dispatchWillSubmitForm(WebPolicyDecider *, Frame* sourceFrame, Element* form, NSDictionary *values) = 0;
 
-- (void)_dispatchSourceFrame:(WebCoreFrameBridge *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionDecider:(WebPolicyDecider *)decider;
+        virtual void dispatchDidLoadMainResource(DocumentLoader*) = 0;
+        virtual void clearLoadingFromPageCache(DocumentLoader*) = 0;
+        virtual bool isLoadingFromPageCache(DocumentLoader*) = 0;
+        virtual void revertToProvisionalState(DocumentLoader*) = 0;
+        virtual void setMainDocumentError(DocumentLoader*, NSError *) = 0;
+        virtual void clearUnarchivingState(DocumentLoader*) = 0;
 
-- (void)_dispatchDidLoadMainResourceForDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_clearLoadingFromPageCacheForDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (BOOL)_isDocumentLoaderLoadingFromPageCache:(WebCore::DocumentLoader*)loader;
-- (void)_revertToProvisionalStateForDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_setMainDocumentError:(NSError *)error forDocumentLoader:(WebCore::DocumentLoader*)loader;
-- (void)_clearUnarchivingStateForLoader:(WebCore::DocumentLoader*)loader;
+        virtual void progressStarted() = 0;
+        virtual void progressCompleted() = 0;
 
-- (void)_progressStarted;
-- (void)_progressCompleted;
+        virtual void incrementProgress(id identifier, NSURLResponse *) = 0;
+        virtual void incrementProgress(id identifier, NSData *) = 0;
+        virtual void completeProgress(id identifier) = 0;
 
-- (void)_incrementProgressForIdentifier:(id)identifier response:(NSURLResponse *)response;
-- (void)_incrementProgressForIdentifier:(id)identifier data:(NSData *)data;
-- (void)_completeProgressForIdentifier:(id)identifier;
+        virtual void setMainFrameDocumentReady(bool) = 0;
 
-- (void)_setMainFrameDocumentReady:(BOOL)ready;
+        virtual void startDownload(NSURLRequest *) = 0;
 
-- (void)_startDownloadWithRequest:(NSURLRequest *)request;
+        virtual void willChangeTitle(DocumentLoader*) = 0;
+        virtual void didChangeTitle(DocumentLoader*) = 0;
 
-- (void)_willChangeTitleForDocument:(WebCore::DocumentLoader*)loader;
-- (void)_didChangeTitleForDocument:(WebCore::DocumentLoader*)loader;
+        virtual void committedLoad(DocumentLoader*, NSData *) = 0;
+        virtual void finishedLoading(DocumentLoader*) = 0;
+        virtual void finalSetupForReplace(DocumentLoader*) = 0;
 
-- (void)_committedLoadWithDocumentLoader:(WebCore::DocumentLoader*)loader data:(NSData *)data;
-- (void)_finishedLoadingDocument:(WebCore::DocumentLoader*)loader;
-- (void)_documentLoader:(WebCore::DocumentLoader*)loader setMainDocumentError:(NSError *)error;
-- (void)_finalSetupForReplaceWithDocumentLoader:(WebCore::DocumentLoader*)loader;
+        virtual NSError *cancelledError(NSURLRequest *) = 0;
+        virtual NSError *cannotShowURLError(NSURLRequest *) = 0;
+        virtual NSError *interruptForPolicyChangeError(NSURLRequest *) = 0;
 
-- (NSError *)_cancelledErrorWithRequest:(NSURLRequest *)request;
-- (NSError *)_cannotShowURLErrorWithRequest:(NSURLRequest *)request;
-- (NSError *)_interruptForPolicyChangeErrorWithRequest:(NSURLRequest *)request;
+        virtual NSError *cannotShowMIMETypeError(NSURLResponse *) = 0;
+        virtual NSError *fileDoesNotExistError(NSURLResponse *) = 0;
 
-- (NSError *)_cannotShowMIMETypeErrorWithResponse:(NSURLResponse *)response;
-- (NSError *)_fileDoesNotExistErrorWithResponse:(NSURLResponse *)response;
+        virtual bool shouldFallBack(NSError *) = 0;
 
-- (BOOL)_shouldFallBackForError:(NSError *)error;
+        virtual NSURL *mainFrameURL() = 0;
 
-- (NSURL *)_mainFrameURL;
-
-- (void)_setDefersCallbacks:(BOOL)defers;
+        virtual void setDefersCallbacks(bool) = 0;
 
-- (BOOL)_willUseArchiveForRequest:(NSURLRequest *)request originalURL:(NSURL *)originalURL loader:(WebCore::WebResourceLoader *)loader;
-- (BOOL)_archiveLoadPendingForLoader:(WebCore::WebResourceLoader *)loader;
-- (void)_cancelPendingArchiveLoadForLoader:(WebCore::WebResourceLoader *)loader;
-- (void)_clearArchivedResources;
+        virtual bool willUseArchive(WebResourceLoader*, NSURLRequest *, NSURL *originalURL) const = 0;
+        virtual bool isArchiveLoadPending(WebResourceLoader*) const = 0;
+        virtual void cancelPendingArchiveLoad(WebResourceLoader*) = 0;
+        virtual void clearArchivedResources() = 0;
 
-- (BOOL)_canHandleRequest:(NSURLRequest *)request;
-- (BOOL)_canShowMIMEType:(NSString *)MIMEType;
-- (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme;
-- (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme;
+        virtual bool canHandleRequest(NSURLRequest *) const = 0;
+        virtual bool canShowMIMEType(NSString *MIMEType) const = 0;
+        virtual bool representationExistsForURLScheme(NSString *URLScheme) const = 0;
+        virtual NSString *generatedMIMETypeForURLScheme(NSString *URLScheme) const = 0;
 
-- (NSDictionary *)_elementForEvent:(NSEvent *)event;
+        virtual NSDictionary *elementForEvent(NSEvent *) const = 0;
 
-- (WebPolicyDecider *)_createPolicyDeciderWithTarget:(id)obj action:(SEL)selector;
-
-- (void)_frameLoadCompleted;
-- (void)_restoreScrollPositionAndViewState;
-- (void)_provisionalLoadStarted;
-    // used to decide to use loadType=Same
-- (BOOL)_shouldTreatURLAsSameAsCurrent:(NSURL *)URL;
-- (void)_addHistoryItemForFragmentScroll;
-- (void)_didFinishLoad;
-- (void)_prepareForDataSourceReplacement;
-- (PassRefPtr<WebCore::DocumentLoader>)_createDocumentLoaderWithRequest:(NSURLRequest *)request;
-- (void)_setTitle:(NSString *)title forURL:(NSURL *)URL;
-
-@end
+        virtual WebPolicyDecider *createPolicyDecider(id object, SEL selector) = 0;
+
+        virtual void frameLoadCompleted() = 0;
+        virtual void restoreScrollPositionAndViewState() = 0;
+        virtual void provisionalLoadStarted() = 0;
+        virtual bool shouldTreatURLAsSameAsCurrent(NSURL *) const = 0;
+        virtual void addHistoryItemForFragmentScroll() = 0;
+        virtual void didFinishLoad() = 0;
+        virtual void prepareForDataSourceReplacement() = 0;
+        virtual PassRefPtr<DocumentLoader> createDocumentLoader(NSURLRequest *) = 0;
+        virtual void setTitle(NSString *title, NSURL *URL) = 0;
+
+    protected:
+        virtual ~FrameLoaderClient();
+    };
+
+}
index 3b29f2dee2cb4199daf38d5fa906206ab50a4321..bcd2eafe8d9017969fcf41a8062f02ab37850342 100644 (file)
@@ -159,7 +159,7 @@ FrameLoader* WebResourceLoader::frameLoader() const
 {
     if (!m_frame)
         return 0;
-    return m_frame->frameLoader();
+    return m_frame->loader();
 }
 
 void WebResourceLoader::addData(NSData *data, bool allAtOnce)
index 6e728619368517ec88e562594dbb6fd7bc8c50f8..d6396300d65912c582831a2ae7eefb34972525ad 100644 (file)
@@ -66,7 +66,7 @@ SubresourceLoader::~SubresourceLoader()
 id <WebCoreResourceHandle> SubresourceLoader::create(Frame* frame, id <WebCoreResourceLoader> rLoader,
     NSMutableURLRequest *newRequest, NSString *method, NSDictionary *customHeaders, NSString *referrer)
 {
-    FrameLoader* fl = frame->frameLoader();
+    FrameLoader* fl = frame->loader();
     if (fl->state() == WebFrameStateProvisional)
         return nil;
 
index 33040b903d5bfbcea1c997717e39045f45378f56..035521f5c3f7ff1fcbe5f90da77d12f93d8ccdb7 100644 (file)
@@ -530,7 +530,7 @@ void Frame::cancelRedirection(bool cancelWithLoadInProgress)
 
 #pragma mark END LOADING FUNCTIONS
 
-FrameLoader* Frame::frameLoader()
+FrameLoader* Frame::loader() const
 {
     return d->m_frameLoader;
 }
index c4b9288bf73accce068a73ddb8dc86dcdcbaf200..7c291947ccd8473f0201764ffa7f514d07068834 100644 (file)
@@ -113,8 +113,6 @@ public:
   virtual void urlSelected(const ResourceRequest&, const String& target, const Event* triggeringEvent, bool lockHistory = false);
   virtual void urlSelected(const FrameLoadRequest&, const Event* triggeringEvent) = 0;
   
-  FrameLoader* frameLoader();
-
   bool requestFrame(Element* ownerElement, const String& url, const AtomicString& frameName);
   virtual Frame* createFrame(const KURL& url, const String& name, Element* ownerElement, const String& referrer) = 0;
   Frame* loadSubframe(Element* ownerElement, const KURL& url, const String& name, const String& referrer);
@@ -832,6 +830,8 @@ public:
   DOMWindow* domWindow() const;
   Editor* editor() const;
   CommandByName* command() const;
+  FrameLoader* loader() const;
+
  private:
   friend class FramePrivate;
   FramePrivate* d;
index 30656d0ecce3d7be4b669f5e1fc7e0086f4025a2..7a90b73f9477acf03ba0ce65e149212d08efc86c 100644 (file)
@@ -226,9 +226,8 @@ Widget::FocusPolicy Slider::focusPolicy() const
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
     WebCoreFrameBridge *bridge = FrameMac::bridgeForWidget(this);
-    if (!bridge || ![bridge impl] || ![bridge impl]->tabsToAllControls()) {
+    if (!bridge || ![bridge _frame] || ![bridge _frame]->tabsToAllControls())
         return NoFocus;
-    }
     
     END_BLOCK_OBJC_EXCEPTIONS;
     
index 124f22d5aeebb7dff805d42a6ef544ff44593fcd..20ce8cbf143dfe1a9f7fcd2464bbe9a493f6542a 100644 (file)
@@ -1,3 +1,156 @@
+2006-10-24  Darin Adler  <darin@apple.com>
+
+        Reviewed by Anders.
+
+        - converted WebFrameLoaderClient to C++
+        - renamed frame->frameLoader() function to frame->loader()
+        - renamed [bridge impl] to [bridge _frame]
+        - removed some bridge methods
+
+        * Plugins/WebNetscapePluginStream.mm:
+        * WebCoreSupport/WebEditorClient.mm:
+        * WebCoreSupport/WebFrameLoaderClient.h: Added.
+        (WebFrameLoaderClient::webFrame):
+        * WebCoreSupport/WebFrameLoaderClient.mm: Added.
+        (WebFrameLoaderClient::detachFrameLoader):
+        (WebFrameLoaderClient::hasWebView):
+        (WebFrameLoaderClient::hasFrameView):
+        (WebFrameLoaderClient::hasBackForwardList):
+        (WebFrameLoaderClient::resetBackForwardList):
+        (WebFrameLoaderClient::provisionalItemIsTarget):
+        (WebFrameLoaderClient::loadProvisionalItemFromPageCache):
+        (WebFrameLoaderClient::invalidateCurrentItemPageCache):
+        (WebFrameLoaderClient::privateBrowsingEnabled):
+        (WebFrameLoaderClient::makeDocumentView):
+        (WebFrameLoaderClient::makeRepresentation):
+        (WebFrameLoaderClient::setDocumentViewFromPageCache):
+        (WebFrameLoaderClient::forceLayout):
+        (WebFrameLoaderClient::forceLayoutForNonHTML):
+        (WebFrameLoaderClient::updateHistoryForCommit):
+        (WebFrameLoaderClient::updateHistoryForBackForwardNavigation):
+        (WebFrameLoaderClient::updateHistoryForReload):
+        (WebFrameLoaderClient::updateHistoryForStandardLoad):
+        (WebFrameLoaderClient::updateHistoryForInternalLoad):
+        (WebFrameLoaderClient::updateHistoryAfterClientRedirect):
+        (WebFrameLoaderClient::setCopiesOnScroll):
+        (WebFrameLoaderClient::tokenForLoadErrorReset):
+        (WebFrameLoaderClient::resetAfterLoadError):
+        (WebFrameLoaderClient::doNotResetAfterLoadError):
+        (WebFrameLoaderClient::detachedFromParent1):
+        (WebFrameLoaderClient::detachedFromParent2):
+        (WebFrameLoaderClient::detachedFromParent3):
+        (WebFrameLoaderClient::detachedFromParent4):
+        (WebFrameLoaderClient::loadedFromPageCache):
+        (WebFrameLoaderClient::download):
+        (WebFrameLoaderClient::dispatchIdentifierForInitialRequest):
+        (WebFrameLoaderClient::dispatchWillSendRequest):
+        (WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
+        (WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge):
+        (WebFrameLoaderClient::dispatchDidReceiveResponse):
+        (WebFrameLoaderClient::dispatchDidReceiveContentLength):
+        (WebFrameLoaderClient::dispatchDidFinishLoading):
+        (WebFrameLoaderClient::dispatchDidFailLoading):
+        (WebFrameLoaderClient::dispatchDidHandleOnloadEvents):
+        (WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
+        (WebFrameLoaderClient::dispatchDidCancelClientRedirect):
+        (WebFrameLoaderClient::dispatchWillPerformClientRedirect):
+        (WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
+        (WebFrameLoaderClient::dispatchWillClose):
+        (WebFrameLoaderClient::dispatchDidReceiveIcon):
+        (WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
+        (WebFrameLoaderClient::dispatchDidReceiveTitle):
+        (WebFrameLoaderClient::dispatchDidCommitLoad):
+        (WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
+        (WebFrameLoaderClient::dispatchDidFailLoad):
+        (WebFrameLoaderClient::dispatchDidFinishLoad):
+        (WebFrameLoaderClient::dispatchDidFirstLayout):
+        (WebFrameLoaderClient::dispatchCreatePage):
+        (WebFrameLoaderClient::dispatchShow):
+        (WebFrameLoaderClient::dispatchDecidePolicyForMIMEType):
+        (WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
+        (WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
+        (WebFrameLoaderClient::dispatchUnableToImplementPolicy):
+        (WebFrameLoaderClient::dispatchWillSubmitForm):
+        (WebFrameLoaderClient::dispatchDidLoadMainResource):
+        (WebFrameLoaderClient::clearLoadingFromPageCache):
+        (WebFrameLoaderClient::isLoadingFromPageCache):
+        (WebFrameLoaderClient::revertToProvisionalState):
+        (WebFrameLoaderClient::setMainDocumentError):
+        (WebFrameLoaderClient::clearUnarchivingState):
+        (WebFrameLoaderClient::progressStarted):
+        (WebFrameLoaderClient::progressCompleted):
+        (WebFrameLoaderClient::incrementProgress):
+        (WebFrameLoaderClient::completeProgress):
+        (WebFrameLoaderClient::setMainFrameDocumentReady):
+        (WebFrameLoaderClient::startDownload):
+        (WebFrameLoaderClient::willChangeTitle):
+        (WebFrameLoaderClient::didChangeTitle):
+        (WebFrameLoaderClient::committedLoad):
+        (WebFrameLoaderClient::finishedLoading):
+        (WebFrameLoaderClient::finalSetupForReplace):
+        (WebFrameLoaderClient::cancelledError):
+        (WebFrameLoaderClient::cannotShowURLError):
+        (WebFrameLoaderClient::interruptForPolicyChangeError):
+        (WebFrameLoaderClient::cannotShowMIMETypeError):
+        (WebFrameLoaderClient::fileDoesNotExistError):
+        (WebFrameLoaderClient::shouldFallBack):
+        (WebFrameLoaderClient::mainFrameURL):
+        (WebFrameLoaderClient::setDefersCallbacks):
+        (WebFrameLoaderClient::willUseArchive):
+        (WebFrameLoaderClient::isArchiveLoadPending):
+        (WebFrameLoaderClient::cancelPendingArchiveLoad):
+        (WebFrameLoaderClient::clearArchivedResources):
+        (WebFrameLoaderClient::canHandleRequest):
+        (WebFrameLoaderClient::canShowMIMEType):
+        (WebFrameLoaderClient::representationExistsForURLScheme):
+        (WebFrameLoaderClient::generatedMIMETypeForURLScheme):
+        (WebFrameLoaderClient::elementForEvent):
+        (WebFrameLoaderClient::createPolicyDecider):
+        (WebFrameLoaderClient::frameLoadCompleted):
+        (WebFrameLoaderClient::restoreScrollPositionAndViewState):
+        (WebFrameLoaderClient::provisionalLoadStarted):
+        (WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent):
+        (WebFrameLoaderClient::addHistoryItemForFragmentScroll):
+        (WebFrameLoaderClient::didFinishLoad):
+        (WebFrameLoaderClient::prepareForDataSourceReplacement):
+        (WebFrameLoaderClient::createDocumentLoader):
+        (WebFrameLoaderClient::setTitle):
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebView/WebDataSource.mm:
+        (-[WebDataSource webFrame]):
+        * WebView/WebFrame.mm:
+        (frame):
+        (-[WebFrame _loadItem:withLoadType:]):
+        (-[WebFrame _reloadForPluginChanges]):
+        (-[WebFrame _initWithWebFrameView:webView:bridge:]):
+        (-[WebFrame _frameLoader]):
+        (-[WebFrame provisionalDataSource]):
+        (-[WebFrame dataSource]):
+        (-[WebFrame parentFrame]):
+        (-[WebFrame _provisionalLoadStarted]):
+        * WebView/WebFrameInternal.h:
+        * WebView/WebHTMLRepresentation.m:
+        (-[WebHTMLRepresentation finishedLoadingWithDataSource:]):
+        * WebView/WebHTMLView.m:
+        (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
+        (-[NSArray validateUserInterfaceItem:]):
+        (-[NSArray scrollWheel:]):
+        (-[NSArray acceptsFirstMouse:]):
+        (-[NSArray shouldDelayWindowOrderingForEvent:]):
+        (-[NSArray _selectionStartFontAttributesAsRTF]):
+        (-[NSArray changeBaseWritingDirection:]):
+        (-[NSArray indent:]):
+        (-[NSArray outdent:]):
+        (-[WebHTMLView copy:]):
+        (-[WebHTMLView cut:]):
+        (-[WebHTMLView paste:]):
+        * WebView/WebView.mm:
+        (-[WebView _dashboardRegions]):
+        (-[WebView setProhibitsMainFrameScrolling:]):
+        (-[WebView _setInViewSourceMode:]):
+        (-[WebView _inViewSourceMode]):
+        (-[WebView setEditable:]):
+
 2006-10-24  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Kevin Decker
index 895c8aa51288dda6e534d3bf1223bc896ddf159f..f99902a526e480080c4871261e95536d29413b29 100644 (file)
@@ -73,7 +73,7 @@ using namespace WebCore;
     if (hideReferrer)
         [(NSMutableURLRequest *)request _web_setHTTPReferrer:nil];
 
-    _loader = NetscapePlugInStreamLoader::create([bridge impl], self).release();
+    _loader = NetscapePlugInStreamLoader::create([bridge _frame], self).release();
     
     isTerminated = NO;
 
index 1479934fd44073c5242e39a3c331869f7ccfdf47..07758199d911d308d35e6727bde044c2621a16ee 100644 (file)
 // we can't make the internal DOM headers private since they are not generated at the time installhdrs is called
 
 @interface DOMHTMLElement (WebCoreInternal)
-+ (DOMHTMLElement *)_HTMLElementWith:(WebCore::HTMLElement *)impl;
++ (DOMHTMLElement *)_HTMLElementWith:(WebCore::HTMLElement*)impl;
 @end
 
 @interface DOMRange (WebCoreInternal)
-+ (DOMRange *)_rangeWith:(WebCore::Range *)impl;
++ (DOMRange *)_rangeWith:(WebCore::Range*)impl;
 @end
 
 WebEditorClient::WebEditorClient()
diff --git a/WebKit/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/WebCoreSupport/WebFrameLoaderClient.h
new file mode 100644 (file)
index 0000000..73d3b2f
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebCore/RetainPtr.h>
+#import <WebCore/WebFrameLoaderClient.h>
+
+@class WebFrame;
+
+class WebFrameLoaderClient : public WebCore::FrameLoaderClient {
+public:
+    WebFrameLoaderClient(WebFrame*);
+    WebFrame* webFrame() const { return m_webFrame.get(); }
+
+    virtual void detachFrameLoader();
+
+    virtual bool hasWebView() const; // mainly for assertions
+    virtual bool hasFrameView() const; // ditto
+
+    virtual bool hasBackForwardList() const;
+    virtual void resetBackForwardList();
+
+    virtual bool provisionalItemIsTarget() const;
+    virtual bool loadProvisionalItemFromPageCache();
+    virtual void invalidateCurrentItemPageCache();
+
+    virtual bool privateBrowsingEnabled() const;
+
+    virtual void makeDocumentView();
+    virtual void makeRepresentation(WebCore::DocumentLoader*);
+    virtual void setDocumentViewFromPageCache(NSDictionary *);
+    virtual void forceLayout();
+    virtual void forceLayoutForNonHTML();
+
+    virtual void updateHistoryForCommit();
+
+    virtual void updateHistoryForBackForwardNavigation();
+    virtual void updateHistoryForReload();
+    virtual void updateHistoryForStandardLoad();
+    virtual void updateHistoryForInternalLoad();
+
+    virtual void updateHistoryAfterClientRedirect();
+
+    virtual void setCopiesOnScroll();
+
+    virtual WebCore::LoadErrorResetToken* tokenForLoadErrorReset();
+    virtual void resetAfterLoadError(WebCore::LoadErrorResetToken*);
+    virtual void doNotResetAfterLoadError(WebCore::LoadErrorResetToken*);
+
+    virtual void detachedFromParent1();
+    virtual void detachedFromParent2();
+    virtual void detachedFromParent3();
+    virtual void detachedFromParent4();
+
+    virtual void loadedFromPageCache();
+
+    virtual void download(NSURLConnection *, NSURLRequest *, NSURLResponse *, id proxy);
+
+    virtual id dispatchIdentifierForInitialRequest(WebCore::DocumentLoader*, NSURLRequest *);
+    virtual NSURLRequest *dispatchWillSendRequest(WebCore::DocumentLoader*, id identifier, NSURLRequest *, NSURLResponse *redirectResponse);
+    virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, id identifier, NSURLAuthenticationChallenge *);
+    virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, id identifier, NSURLAuthenticationChallenge *);
+    virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, id identifier, NSURLResponse *);
+    virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, id identifier, int lengthReceived);
+    virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, id identifier);
+    virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, id identifier, NSError *);
+
+    virtual void dispatchDidHandleOnloadEvents();
+    virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
+    virtual void dispatchDidCancelClientRedirect();
+    virtual void dispatchWillPerformClientRedirect(NSURL *URL, NSTimeInterval, NSDate *);
+    virtual void dispatchDidChangeLocationWithinPage();
+    virtual void dispatchWillClose();
+    virtual void dispatchDidReceiveIcon(NSImage *);
+    virtual void dispatchDidStartProvisionalLoad();
+    virtual void dispatchDidReceiveTitle(NSString *title);
+    virtual void dispatchDidCommitLoad();
+    virtual void dispatchDidFailProvisionalLoad(NSError *);
+    virtual void dispatchDidFailLoad(NSError *);
+    virtual void dispatchDidFinishLoad();
+    virtual void dispatchDidFirstLayout();
+
+    virtual WebCore::Frame* dispatchCreatePage(NSURLRequest *);
+    virtual void dispatchShow();
+
+    virtual void dispatchDecidePolicyForMIMEType(WebPolicyDecider *, NSString *MIMEType, NSURLRequest *);
+    virtual void dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *, NSString *frameName);
+    virtual void dispatchDecidePolicyForNavigationAction(WebPolicyDecider *, NSDictionary *action, NSURLRequest *);
+    virtual void dispatchUnableToImplementPolicy(NSError *);
+
+    virtual void dispatchWillSubmitForm(WebPolicyDecider *, WebCore::Frame* sourceFrame, WebCore::Element* form, NSDictionary *values);
+
+    virtual void dispatchDidLoadMainResource(WebCore::DocumentLoader*);
+    virtual void clearLoadingFromPageCache(WebCore::DocumentLoader*);
+    virtual bool isLoadingFromPageCache(WebCore::DocumentLoader*);
+    virtual void revertToProvisionalState(WebCore::DocumentLoader*);
+    virtual void setMainDocumentError(WebCore::DocumentLoader*, NSError *);
+    virtual void clearUnarchivingState(WebCore::DocumentLoader*);
+
+    virtual void progressStarted();
+    virtual void progressCompleted();
+
+    virtual void incrementProgress(id identifier, NSURLResponse *);
+    virtual void incrementProgress(id identifier, NSData *);
+    virtual void completeProgress(id identifier);
+
+    virtual void setMainFrameDocumentReady(bool);
+
+    virtual void startDownload(NSURLRequest *);
+
+    virtual void willChangeTitle(WebCore::DocumentLoader*);
+    virtual void didChangeTitle(WebCore::DocumentLoader*);
+
+    virtual void committedLoad(WebCore::DocumentLoader*, NSData *);
+    virtual void finishedLoading(WebCore::DocumentLoader*);
+    virtual void finalSetupForReplace(WebCore::DocumentLoader*);
+
+    virtual NSError *cancelledError(NSURLRequest *);
+    virtual NSError *cannotShowURLError(NSURLRequest *);
+    virtual NSError *interruptForPolicyChangeError(NSURLRequest *);
+
+    virtual NSError *cannotShowMIMETypeError(NSURLResponse *);
+    virtual NSError *fileDoesNotExistError(NSURLResponse *);
+
+    virtual bool shouldFallBack(NSError *);
+
+    virtual NSURL *mainFrameURL();
+
+    virtual void setDefersCallbacks(bool);
+
+    virtual bool willUseArchive(WebCore::WebResourceLoader*, NSURLRequest *, NSURL *originalURL) const;
+    virtual bool isArchiveLoadPending(WebCore::WebResourceLoader*) const;
+    virtual void cancelPendingArchiveLoad(WebCore::WebResourceLoader*);
+    virtual void clearArchivedResources();
+
+    virtual bool canHandleRequest(NSURLRequest *) const;
+    virtual bool canShowMIMEType(NSString *MIMEType) const;
+    virtual bool representationExistsForURLScheme(NSString *URLScheme) const;
+    virtual NSString *generatedMIMETypeForURLScheme(NSString *URLScheme) const;
+
+    virtual NSDictionary *elementForEvent(NSEvent *) const;
+
+    virtual WebPolicyDecider *createPolicyDecider(id object, SEL selector);
+
+    virtual void frameLoadCompleted();
+    virtual void restoreScrollPositionAndViewState();
+    virtual void provisionalLoadStarted();
+    virtual bool shouldTreatURLAsSameAsCurrent(NSURL *) const;
+    virtual void addHistoryItemForFragmentScroll();
+    virtual void didFinishLoad();
+    virtual void prepareForDataSourceReplacement();
+    virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(NSURLRequest *);
+    virtual void setTitle(NSString *title, NSURL *);
+
+private:
+    WebCore::RetainPtr<WebFrame> m_webFrame;
+};
diff --git a/WebKit/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/WebCoreSupport/WebFrameLoaderClient.mm
new file mode 100644 (file)
index 0000000..75af4bb
--- /dev/null
@@ -0,0 +1,584 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WebFrameLoaderClient.h"
+
+#import "WebFrameInternal.h"
+#import <WebCore/FrameMac.h>
+#import <WebCore/WebCoreFrameBridge.h>
+#import <WebCore/WebDocumentLoader.h>
+#import <WebKit/DOMElement.h>
+#import <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+// FIXME: We should have a way to get the following DOM interface from the WebCore internal headers, but we
+// can't make the internal DOM headers private since they are not generated at the time installhdrs is called.
+
+@interface DOMElement (WebCoreInternal)
++ (DOMElement *)_elementWith:(WebCore::Element*)impl;
+@end
+
+WebFrameLoaderClient::WebFrameLoaderClient(WebFrame *webFrame)
+    : m_webFrame(webFrame)
+{
+}
+
+void WebFrameLoaderClient::detachFrameLoader()
+{
+    delete this;
+}
+
+bool WebFrameLoaderClient::hasWebView() const
+{
+    return [m_webFrame.get() _hasWebView];
+}
+
+bool WebFrameLoaderClient::hasFrameView() const
+{
+    return [m_webFrame.get() _hasFrameView];
+}
+
+bool WebFrameLoaderClient::hasBackForwardList() const
+{
+    return [m_webFrame.get() _hasBackForwardList];
+}
+
+void WebFrameLoaderClient::resetBackForwardList()
+{
+    [m_webFrame.get() _resetBackForwardList];
+}
+
+bool WebFrameLoaderClient::provisionalItemIsTarget() const
+{
+    return [m_webFrame.get() _provisionalItemIsTarget];
+}
+
+bool WebFrameLoaderClient::loadProvisionalItemFromPageCache()
+{
+    return [m_webFrame.get() _loadProvisionalItemFromPageCache];
+}
+
+void WebFrameLoaderClient::invalidateCurrentItemPageCache()
+{
+    [m_webFrame.get() _invalidateCurrentItemPageCache];
+}
+
+bool WebFrameLoaderClient::privateBrowsingEnabled() const
+{
+    return [m_webFrame.get() _privateBrowsingEnabled];
+}
+
+void WebFrameLoaderClient::makeDocumentView()
+{
+    [m_webFrame.get() _makeDocumentView];
+}
+
+void WebFrameLoaderClient::makeRepresentation(DocumentLoader* loader)
+{
+    [m_webFrame.get() _makeRepresentationForDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::setDocumentViewFromPageCache(NSDictionary *dictionary)
+{
+    [m_webFrame.get() _setDocumentViewFromPageCache:dictionary];
+}
+
+void WebFrameLoaderClient::forceLayout()
+{
+    [m_webFrame.get() _forceLayout];
+}
+
+void WebFrameLoaderClient::forceLayoutForNonHTML()
+{
+    [m_webFrame.get() _forceLayoutForNonHTML];
+}
+
+void WebFrameLoaderClient::updateHistoryForCommit()
+{
+    [m_webFrame.get() _updateHistoryForCommit];
+}
+
+void WebFrameLoaderClient::updateHistoryForBackForwardNavigation()
+{
+    [m_webFrame.get() _updateHistoryForBackForwardNavigation];
+}
+
+void WebFrameLoaderClient::updateHistoryForReload()
+{
+    [m_webFrame.get() _updateHistoryForReload];
+}
+
+void WebFrameLoaderClient::updateHistoryForStandardLoad()
+{
+    [m_webFrame.get() _updateHistoryForStandardLoad];
+}
+
+void WebFrameLoaderClient::updateHistoryForInternalLoad()
+{
+    [m_webFrame.get() _updateHistoryForInternalLoad];
+}
+
+
+void WebFrameLoaderClient::updateHistoryAfterClientRedirect()
+{
+    [m_webFrame.get() _updateHistoryAfterClientRedirect];
+}
+
+void WebFrameLoaderClient::setCopiesOnScroll()
+{
+    [m_webFrame.get() _setCopiesOnScroll];
+}
+
+LoadErrorResetToken* WebFrameLoaderClient::tokenForLoadErrorReset()
+{
+    return [m_webFrame.get() _tokenForLoadErrorReset];
+}
+
+void WebFrameLoaderClient::resetAfterLoadError(LoadErrorResetToken* token)
+{
+    [m_webFrame.get() _resetAfterLoadError:token];
+}
+
+void WebFrameLoaderClient::doNotResetAfterLoadError(LoadErrorResetToken* token)
+{
+    [m_webFrame.get() _doNotResetAfterLoadError:token];
+}
+
+void WebFrameLoaderClient::detachedFromParent1()
+{
+    [m_webFrame.get() _detachedFromParent1];
+}
+
+void WebFrameLoaderClient::detachedFromParent2()
+{
+    [m_webFrame.get() _detachedFromParent2];
+}
+
+void WebFrameLoaderClient::detachedFromParent3()
+{
+    [m_webFrame.get() _detachedFromParent3];
+}
+
+void WebFrameLoaderClient::detachedFromParent4()
+{
+    [m_webFrame.get() _detachedFromParent4];
+}
+
+void WebFrameLoaderClient::loadedFromPageCache()
+{
+    [m_webFrame.get() _loadedFromPageCache];
+}
+
+void WebFrameLoaderClient::download(NSURLConnection *connection, NSURLRequest *request,
+    NSURLResponse *response, id proxy)
+{
+    [m_webFrame.get() _downloadWithLoadingConnection:connection request:request response:response proxy:proxy];
+}
+
+id WebFrameLoaderClient::dispatchIdentifierForInitialRequest(DocumentLoader* loader, NSURLRequest *request)
+{
+    return [m_webFrame.get() _dispatchIdentifierForInitialRequest:request fromDocumentLoader:loader];
+}
+
+NSURLRequest *WebFrameLoaderClient::dispatchWillSendRequest(DocumentLoader* loader, id identifier,
+    NSURLRequest *request, NSURLResponse *redirectResponse)
+{
+    return [m_webFrame.get() _dispatchResource:identifier willSendRequest:request
+        redirectResponse:redirectResponse fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader* loader, id identifier,
+    NSURLAuthenticationChallenge *challenge)
+{
+    [m_webFrame.get() _dispatchDidReceiveAuthenticationChallenge:challenge forResource:identifier
+        fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge(DocumentLoader* loader, id identifier,
+    NSURLAuthenticationChallenge *challenge)
+{
+    [m_webFrame.get() _dispatchDidCancelAuthenticationChallenge:challenge forResource:identifier
+        fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveResponse(DocumentLoader* loader, id identifier, NSURLResponse *response)
+{
+    [m_webFrame.get() _dispatchResource:identifier didReceiveResponse:response fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader* loader, id identifier, int lengthReceived)
+{
+    [m_webFrame.get() _dispatchResource:identifier didReceiveContentLength:lengthReceived fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidFinishLoading(DocumentLoader* loader, id identifier)
+{
+    [m_webFrame.get() _dispatchResource:identifier didFinishLoadingFromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, id identifier, NSError *error)
+{
+    [m_webFrame.get() _dispatchResource:identifier didFailLoadingWithError:error fromDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::dispatchDidHandleOnloadEvents()
+{
+    [m_webFrame.get() _dispatchDidHandleOnloadEventsForFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
+{
+    [m_webFrame.get() _dispatchDidReceiveServerRedirectForProvisionalLoadForFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidCancelClientRedirect()
+{
+    [m_webFrame.get() _dispatchDidCancelClientRedirectForFrame];
+}
+
+void WebFrameLoaderClient::dispatchWillPerformClientRedirect(NSURL *URL, NSTimeInterval delay, NSDate *fireDate)
+{
+    [m_webFrame.get() _dispatchWillPerformClientRedirectToURL:URL delay:delay fireDate:fireDate];
+}
+
+void WebFrameLoaderClient::dispatchDidChangeLocationWithinPage()
+{
+    [m_webFrame.get() _dispatchDidChangeLocationWithinPageForFrame];
+}
+
+void WebFrameLoaderClient::dispatchWillClose()
+{
+    [m_webFrame.get() _dispatchWillCloseFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveIcon(NSImage *icon)
+{
+    [m_webFrame.get() _dispatchDidReceiveIcon:icon];
+}
+
+void WebFrameLoaderClient::dispatchDidStartProvisionalLoad()
+{
+    [m_webFrame.get() _dispatchDidStartProvisionalLoadForFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidReceiveTitle(NSString *title)
+{
+    [m_webFrame.get() _dispatchDidReceiveTitle:title];
+}
+
+void WebFrameLoaderClient::dispatchDidCommitLoad()
+{
+    [m_webFrame.get() _dispatchDidCommitLoadForFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidFailProvisionalLoad(NSError *error)
+{
+    [m_webFrame.get() _dispatchDidFailProvisionalLoadWithError:error];
+}
+
+void WebFrameLoaderClient::dispatchDidFailLoad(NSError *error)
+{
+    [m_webFrame.get() _dispatchDidFailLoadWithError:error];
+}
+
+void WebFrameLoaderClient::dispatchDidFinishLoad()
+{
+    [m_webFrame.get() _dispatchDidFinishLoadForFrame];
+}
+
+void WebFrameLoaderClient::dispatchDidFirstLayout()
+{
+    [m_webFrame.get() _dispatchDidFirstLayoutInFrame];
+}
+
+Frame* WebFrameLoaderClient::dispatchCreatePage(NSURLRequest *request)
+{
+    return [[m_webFrame.get() _dispatchCreateWebViewWithRequest:request] _frame];
+}
+
+void WebFrameLoaderClient::dispatchShow()
+{
+    [m_webFrame.get() _dispatchShow];
+}
+
+void WebFrameLoaderClient::dispatchDecidePolicyForMIMEType(WebPolicyDecider *decider, NSString *MIMEType,
+    NSURLRequest *request)
+{
+    [m_webFrame.get() _dispatchDecidePolicyForMIMEType:MIMEType request:request decider:decider];
+}
+
+void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(WebPolicyDecider *decider, NSDictionary *action,
+    NSURLRequest *request, NSString *frameName)
+{
+    [m_webFrame.get() _dispatchDecidePolicyForNewWindowAction:action request:request newFrameName:frameName
+        decider:decider];
+}
+
+void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(WebPolicyDecider *decider, NSDictionary *action,
+    NSURLRequest *request)
+{
+    [m_webFrame.get() _dispatchDecidePolicyForNavigationAction:action request:request decider:decider];
+}
+
+void WebFrameLoaderClient::dispatchUnableToImplementPolicy(NSError *error)
+{
+    [m_webFrame.get() _dispatchUnableToImplementPolicyWithError:error];
+}
+
+void WebFrameLoaderClient::dispatchWillSubmitForm(WebPolicyDecider *decider, Frame* sourceFrame,
+    Element* form, NSDictionary *values)
+{
+    [m_webFrame.get() _dispatchSourceFrame:Mac(sourceFrame)->bridge()
+        willSubmitForm:[DOMElement _elementWith:form] withValues:values submissionDecider:decider];
+}
+
+void WebFrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader* loader)
+{
+    [m_webFrame.get() _dispatchDidLoadMainResourceForDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::clearLoadingFromPageCache(DocumentLoader* loader)
+{
+    [m_webFrame.get() _clearLoadingFromPageCacheForDocumentLoader:loader];
+}
+
+bool WebFrameLoaderClient::isLoadingFromPageCache(DocumentLoader* loader)
+{
+    return [m_webFrame.get() _isDocumentLoaderLoadingFromPageCache:loader];
+}
+
+void WebFrameLoaderClient::revertToProvisionalState(DocumentLoader* loader)
+{
+    [m_webFrame.get() _revertToProvisionalStateForDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::setMainDocumentError(DocumentLoader* loader, NSError *error)
+{
+    [m_webFrame.get() _setMainDocumentError:error forDocumentLoader:loader];
+}
+
+void WebFrameLoaderClient::clearUnarchivingState(DocumentLoader* loader)
+{
+    [m_webFrame.get() _clearUnarchivingStateForLoader:loader];
+}
+
+void WebFrameLoaderClient::progressStarted()
+{
+    [m_webFrame.get() _progressStarted];
+}
+
+void WebFrameLoaderClient::progressCompleted()
+{
+    [m_webFrame.get() _progressCompleted];
+}
+
+void WebFrameLoaderClient::incrementProgress(id identifier, NSURLResponse *response)
+{
+    [m_webFrame.get() _incrementProgressForIdentifier:identifier response:response];
+}
+
+void WebFrameLoaderClient::incrementProgress(id identifier, NSData *data)
+{
+    [m_webFrame.get() _incrementProgressForIdentifier:identifier data:data];
+}
+
+void WebFrameLoaderClient::completeProgress(id identifier)
+{
+    [m_webFrame.get() _completeProgressForIdentifier:identifier];
+}
+
+void WebFrameLoaderClient::setMainFrameDocumentReady(bool ready)
+{
+    [m_webFrame.get() _setMainFrameDocumentReady:ready];
+}
+
+void WebFrameLoaderClient::startDownload(NSURLRequest *request)
+{
+    [m_webFrame.get() _startDownloadWithRequest:request];
+}
+
+void WebFrameLoaderClient::willChangeTitle(DocumentLoader* loader)
+{
+    [m_webFrame.get() _willChangeTitleForDocument:loader];
+}
+
+void WebFrameLoaderClient::didChangeTitle(DocumentLoader* loader)
+{
+    [m_webFrame.get() _didChangeTitleForDocument:loader];
+}
+
+void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, NSData *data)
+{
+    [m_webFrame.get() _committedLoadWithDocumentLoader:loader data:data];
+}
+
+void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader)
+{
+    [m_webFrame.get() _finishedLoadingDocument:loader];
+}
+
+void WebFrameLoaderClient::finalSetupForReplace(DocumentLoader* loader)
+{
+    [m_webFrame.get() _finalSetupForReplaceWithDocumentLoader:loader];
+}
+
+NSError *WebFrameLoaderClient::cancelledError(NSURLRequest *request)
+{
+    return [m_webFrame.get() _cancelledErrorWithRequest:request];
+}
+
+NSError *WebFrameLoaderClient::cannotShowURLError(NSURLRequest *request)
+{
+    return [m_webFrame.get() _cannotShowURLErrorWithRequest:request];
+}
+
+NSError *WebFrameLoaderClient::interruptForPolicyChangeError(NSURLRequest *request)
+{
+    return [m_webFrame.get() _interruptForPolicyChangeErrorWithRequest:request];
+}
+
+NSError *WebFrameLoaderClient::cannotShowMIMETypeError(NSURLResponse *response)
+{
+    return [m_webFrame.get() _cannotShowMIMETypeErrorWithResponse:response];
+}
+
+NSError *WebFrameLoaderClient::fileDoesNotExistError(NSURLResponse *response)
+{
+    return [m_webFrame.get() _fileDoesNotExistErrorWithResponse:response];
+}
+
+bool WebFrameLoaderClient::shouldFallBack(NSError *error)
+{
+    return [m_webFrame.get() _shouldFallBackForError:error];
+}
+
+NSURL *WebFrameLoaderClient::mainFrameURL()
+{
+    return [m_webFrame.get() _mainFrameURL];
+}
+
+void WebFrameLoaderClient::setDefersCallbacks(bool defers)
+{
+    [m_webFrame.get() _setDefersCallbacks:defers];
+}
+
+bool WebFrameLoaderClient::willUseArchive(WebResourceLoader* loader, NSURLRequest *request, NSURL *originalURL) const
+{
+    return [m_webFrame.get() _willUseArchiveForRequest:request originalURL:originalURL loader:loader];
+}
+
+bool WebFrameLoaderClient::isArchiveLoadPending(WebResourceLoader* loader) const
+{
+    return [m_webFrame.get() _archiveLoadPendingForLoader:loader];
+}
+
+void WebFrameLoaderClient::cancelPendingArchiveLoad(WebResourceLoader* loader)
+{
+    [m_webFrame.get() _cancelPendingArchiveLoadForLoader:loader];
+}
+
+void WebFrameLoaderClient::clearArchivedResources()
+{
+    [m_webFrame.get() _clearArchivedResources];
+}
+
+bool WebFrameLoaderClient::canHandleRequest(NSURLRequest *request) const
+{
+    return [m_webFrame.get() _canHandleRequest:request];
+}
+
+bool WebFrameLoaderClient::canShowMIMEType(NSString *MIMEType) const
+{
+    return [m_webFrame.get() _canShowMIMEType:MIMEType];
+}
+
+bool WebFrameLoaderClient::representationExistsForURLScheme(NSString *URLScheme) const
+{
+    return [m_webFrame.get() _representationExistsForURLScheme:URLScheme];
+}
+
+NSString *WebFrameLoaderClient::generatedMIMETypeForURLScheme(NSString *URLScheme) const
+{
+    return [m_webFrame.get() _generatedMIMETypeForURLScheme:URLScheme];
+}
+
+NSDictionary *WebFrameLoaderClient::elementForEvent(NSEvent *event) const
+{
+    return [m_webFrame.get() _elementForEvent:event];
+}
+
+WebPolicyDecider *WebFrameLoaderClient::createPolicyDecider(id object, SEL selector)
+{
+    return [m_webFrame.get() _createPolicyDeciderWithTarget:object action:selector];
+}
+
+void WebFrameLoaderClient::frameLoadCompleted()
+{
+    [m_webFrame.get() _frameLoadCompleted];
+}
+
+void WebFrameLoaderClient::restoreScrollPositionAndViewState()
+{
+    [m_webFrame.get() _restoreScrollPositionAndViewState];
+}
+
+void WebFrameLoaderClient::provisionalLoadStarted()
+{
+    [m_webFrame.get() _provisionalLoadStarted];
+}
+
+bool WebFrameLoaderClient::shouldTreatURLAsSameAsCurrent(NSURL *URL) const
+{
+    return [m_webFrame.get() _shouldTreatURLAsSameAsCurrent:URL];
+}
+
+void WebFrameLoaderClient::addHistoryItemForFragmentScroll()
+{
+    [m_webFrame.get() _addHistoryItemForFragmentScroll];
+}
+
+void WebFrameLoaderClient::didFinishLoad()
+{
+    [m_webFrame.get() _didFinishLoad];
+}
+
+void WebFrameLoaderClient::prepareForDataSourceReplacement()
+{
+    [m_webFrame.get() _prepareForDataSourceReplacement];
+}
+
+PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(NSURLRequest *request)
+{
+    return [m_webFrame.get() _createDocumentLoaderWithRequest:request];
+}
+
+void WebFrameLoaderClient::setTitle(NSString *title, NSURL *URL)
+{
+    [m_webFrame.get() _setTitle:title forURL:URL];
+}
index a2cf4bd170e56592b5337a1d8450c072848a6405..63ddbcc5efbb140482dc6bcda14b7ae01f314807 100644 (file)
@@ -69,6 +69,8 @@
                7E6FEF0808985A7200C44C3F /* WebScriptDebugDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E6FEF0508985A7200C44C3F /* WebScriptDebugDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7E6FEF0908985A7200C44C3F /* WebScriptDebugDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E6FEF0608985A7200C44C3F /* WebScriptDebugDelegate.m */; };
                7E6FEF0A08985A7200C44C3F /* WebScriptDebugDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E6FEF0708985A7200C44C3F /* WebScriptDebugDelegatePrivate.h */; };
+               931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */; };
+               931633EF0AEDFFAE0062B92D /* WebFrameLoaderClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */; };
                939810110824BF01008DF038 /* WebBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607D020F50ED0ECA1767 /* WebBackForwardList.h */; settings = {ATTRIBUTES = (Public, ); }; };
                939810120824BF01008DF038 /* WebHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = F520FB190221DEFD01C1A525 /* WebHistory.h */; settings = {ATTRIBUTES = (Public, ); }; };
                939810130824BF01008DF038 /* WebHistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607F020F50ED0ECA1767 /* WebHistoryItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
                35081D9202B6D4D80ACA2ACA /* WebHTMLRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLRepresentation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                35081D9302B6D4D80ACA2ACA /* WebHTMLRepresentation.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebHTMLRepresentation.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                35081D9402B6D4D80ACA2ACA /* WebHTMLView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               35081D9502B6D4D80ACA2ACA /* WebHTMLView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebHTMLView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               35081D9502B6D4D80ACA2ACA /* WebHTMLView.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebHTMLView.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                35081D9602B6D4D80ACA2ACA /* WebHTMLViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                35081DAE02B6D4F50ACA2ACA /* WebDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDocument.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                35F3577F0198AAB80ACA1520 /* English */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                930D02BD06275F710076701E /* WebFrameInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93154EF103A41270008635CE /* WebPanelAuthenticationHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPanelAuthenticationHandler.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93154EF203A41270008635CE /* WebPanelAuthenticationHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPanelAuthenticationHandler.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoaderClient.h; sourceTree = "<group>"; };
+               931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameLoaderClient.mm; sourceTree = "<group>"; };
                93185DB506679F42005D5E7E /* WebHTMLViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLViewInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                931A72D203265920008635CE /* WebBaseNetscapePluginViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBaseNetscapePluginViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                932399D8034CF7F6008635CE /* English */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; name = English; path = English.lproj/StringsNotToBeLocalized.txt; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                F5B36B400281DE87018635CB /* WebCoreSupport */ = {
                        isa = PBXGroup;
                        children = (
+                               9305892A070868B300E79D96 /* WebDashboardRegion.h */,
                                4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */,
                                4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */,
-                               51E4D3970A886B5E00ECEE2C /* WebIconDatabaseBridge.h */,
-                               51E4D3980A886B5E00ECEE2C /* WebIconDatabaseBridge.m */,
-                               65C7F42A0979DE640022E453 /* WebPageBridge.h */,
-                               65C7F42B0979DE640022E453 /* WebPageBridge.mm */,
                                F5AFB45E02B94DC8018635CA /* WebFrameBridge.h */,
                                F5AFB45F02B94DC8018635CA /* WebFrameBridge.mm */,
-                               9305892A070868B300E79D96 /* WebDashboardRegion.h */,
-                               9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */,
+                               931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */,
+                               931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */,
+                               51E4D3970A886B5E00ECEE2C /* WebIconDatabaseBridge.h */,
+                               51E4D3980A886B5E00ECEE2C /* WebIconDatabaseBridge.m */,
                                9345D4EA0365C5B2008635CE /* WebJavaScriptTextInputPanel.h */,
                                9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */,
+                               9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */,
                                84723BE3056D719E0044BFEA /* WebKeyGenerator.h */,
                                84723BE4056D719E0044BFEA /* WebKeyGenerator.m */,
+                               65C7F42A0979DE640022E453 /* WebPageBridge.h */,
+                               65C7F42B0979DE640022E453 /* WebPageBridge.mm */,
                                93EB178E09F88D510091F8FF /* WebSystemInterface.h */,
                                93EB178C09F88D460091F8FF /* WebSystemInterface.m */,
                                F5F7174C02885C5B018635CA /* WebViewFactory.h */,
                                1C8CB07A0AE9830C00B1F6E9 /* WebEditingDelegatePrivate.h in Headers */,
                                4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */,
                                1CA57D620AED6A470009BDD0 /* WebGraphicsExtras.h in Headers */,
+                               931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
                        projectRoot = "";
-                       shouldCheckCompatibility = 1;
                        targets = (
                                9398100A0824BF01008DF038 /* WebKit */,
                        );
                                658BA6FD0ADB39DE00AEB387 /* WebPolicyDeciderMac.m in Sources */,
                                4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */,
                                1CA57D630AED6A470009BDD0 /* WebGraphicsExtras.c in Sources */,
+                               931633EF0AEDFFAE0062B92D /* WebFrameLoaderClient.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 9a2fbe8eaf6746ce2d1cdf127808f36785440714..bb878045638b1c3bb825392aa58b39b9600d0273 100644 (file)
 
 #import "WebArchive.h"
 #import "WebArchiver.h"
-#import <WebCore/WebDataProtocol.h>
-#import <WebKit/WebDataSourceInternal.h>
+#import "WebDataSourceInternal.h"
 #import "WebDefaultResourceLoadDelegate.h"
 #import "WebDocument.h"
+#import "WebDocumentLoaderMac.h"
 #import "WebFrameBridge.h"
 #import "WebFrameInternal.h"
-#import <WebCore/WebFrameLoader.h>
 #import "WebFrameLoadDelegate.h"
+#import "WebFrameLoaderClient.h"
 #import "WebHTMLRepresentation.h"
 #import "WebKitErrorsPrivate.h"
 #import "WebKitLogging.h"
 #import "WebUnarchivingState.h"
 #import "WebViewInternal.h"
 #import <JavaScriptCore/Assertions.h>
+#import <WebCore/WebDataProtocol.h>
+#import <WebCore/WebFrameLoader.h>
 #import <WebKit/DOMHTML.h>
 #import <WebKit/DOMPrivate.h>
 #import <WebKitSystemInterface.h>
-#import "WebDocumentLoaderMac.h"
 
 using namespace WebCore;
 
@@ -409,7 +410,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     FrameLoader* frameLoader = _private->loader->frameLoader();
     if (!frameLoader)
         return nil;
-    return (WebFrame *)frameLoader->client();
+    return static_cast<WebFrameLoaderClient*>(frameLoader->client())->webFrame();
 }
 
 - (NSURLRequest *)initialRequest
index 2d72952425776c1e784e6871c26d55d24389ff81..dcc0c9e5a4ed9141c262176f00620b7d0bc465cc 100644 (file)
@@ -38,6 +38,7 @@
 #import "WebDownloadInternal.h"
 #import "WebFrameBridge.h"
 #import "WebFrameLoadDelegate.h"
+#import "WebFrameLoaderClient.h"
 #import "WebFrameViewInternal.h"
 #import "WebHTMLRepresentationPrivate.h"
 #import "WebHTMLViewInternal.h"
 #import "WebUIDelegate.h"
 #import "WebViewInternal.h"
 #import <WebCore/Element.h>
-#import <WebCore/Frame.h>
+#import <WebCore/FrameMac.h>
+#import <WebCore/FrameTree.h>
 #import <WebCore/WebDataProtocol.h>
 #import <WebCore/WebFormDataStream.h>
 #import <WebCore/WebFormState.h>
 #import <WebCore/WebFrameLoader.h>
-#import <WebCore/WebFrameLoaderClient.h>
 #import <WebCore/WebLoader.h>
 #import <WebKit/DOM.h>
 #import <WebKitSystemInterface.h>
@@ -125,9 +126,6 @@ NSString *WebPageCacheDocumentViewKey = @"WebPageCacheDocumentViewKey";
 - (WebHistoryItem *)_currentBackForwardListItemToResetTo;
 @end
 
-@interface WebFrame (WebFrameLoaderClient) <WebFrameLoaderClient>
-@end
-
 @interface NSView (WebFramePluginHosting)
 - (void)setWebFrame:(WebFrame *)webFrame;
 @end
@@ -222,6 +220,11 @@ static inline WebFrame *frame(WebCoreFrameBridge *bridge)
     return [(WebFrameBridge *)bridge webFrame];
 }
 
+static inline WebFrame *frame(Frame* f)
+{
+    return f ? [(WebFrameBridge *)Mac(f)->bridge() webFrame] : nil;
+}
+
 @implementation WebFrame (FrameTraversal)
 
 - (WebFrame *)_firstChildFrame
@@ -489,9 +492,9 @@ static inline WebFrame *frame(WebCoreFrameBridge *bridge)
         [self _saveScrollPositionAndViewStateToItem:_private->currentItem];
         // FIXME: form state might want to be saved here too
 
-        // We always call scrollToAnchorWithURL here, even if the URL doesn't have an
+        // We always call scrollToAnchor here, even if the URL doesn't have an
         // anchor fragment. This is so we'll keep the WebCore Frame's URL up-to-date.
-        [_private->bridge scrollToAnchorWithURL:[item URL]];
+        [_private->bridge _frame]->scrollToAnchor([item URL]);
     
         // must do this maintenance here, since we don't go through a real page reload
         [_private setCurrentItem:item];
@@ -829,7 +832,7 @@ static inline WebFrame *frame(WebCoreFrameBridge *bridge)
 {
     for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
         NSView <WebDocumentView> *documentView = [[frame frameView] documentView];
-        if (([documentView isKindOfClass:[WebHTMLView class]] && [_private->bridge containsPlugins]))
+        if (([documentView isKindOfClass:[WebHTMLView class]] && [_private->bridge _frame]->containsPlugins()))
             [frame reload];
     }
 }
@@ -884,7 +887,7 @@ static inline WebFrame *frame(WebCoreFrameBridge *bridge)
 
     ++WebFrameCount;
 
-    [bridge setFrameLoaderClient:self];
+    [self _frameLoader]->setClient(new WebFrameLoaderClient(self));
 
     return self;
 }
@@ -1056,7 +1059,8 @@ static inline WebFrame *frame(WebCoreFrameBridge *bridge)
 
 - (FrameLoader*)_frameLoader
 {
-    return [_private->bridge frameLoader];
+    Frame* frame = [_private->bridge _frame];
+    return frame ? frame->loader() : 0;
 }
 
 static inline WebDataSource *dataSource(DocumentLoader* loader)
@@ -1175,13 +1179,13 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
 
 - (WebDataSource *)provisionalDataSource
 {
-    WebCoreFrameLoader* frameLoader = [self _frameLoader];
+    FrameLoader* frameLoader = [self _frameLoader];
     return frameLoader ? dataSource(frameLoader->provisionalDocumentLoader()) : nil;
 }
 
 - (WebDataSource *)dataSource
 {
-    WebCoreFrameLoader* frameLoader = [self _frameLoader];
+    FrameLoader* frameLoader = [self _frameLoader];
     return frameLoader ? dataSource(frameLoader->documentLoader()) : nil;
 }
 
@@ -1254,7 +1258,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
 
 - (WebFrame *)parentFrame
 {
-    return [[frame([[self _bridge] parent]) retain] autorelease];
+    return [[frame([_private->bridge _frame]->tree()->parent()) retain] autorelease];
 }
 
 - (NSArray *)childFrames
@@ -2242,7 +2246,7 @@ static inline WebPolicyDecisionListener *decisionListener(WebPolicyDecider *deci
             }
         } else
             // Put the document into a null state, so it can be restored correctly.
-            [_private->bridge clear];
+            [_private->bridge _frame]->clear();
     } else
         LOG(PageCache, "NOT saving page to back/forward cache, %@\n", [[self dataSource] _URL]);
 }
index 7d1e496c4c8e7e8cda3eb8cd365469d2ccb953a6..a2d9e37527e8d237c0f7febfc457d7540d9c984f 100644 (file)
 #import "WebPolicyDelegatePrivate.h"
 #import <WebCore/FrameLoaderTypes.h>
 
+#ifdef __cplusplus
+#import <wtf/Forward.h>
+#endif
+
+@class WebCoreFrameBridge;
 @class WebDocumentLoader;
 @class WebInspector;
 @class WebFrameView;
 @class WebFrameBridge;
+@class WebPolicyDecider;
 
 #ifdef __cplusplus
+
 namespace WebCore {
     class DocumentLoader;
     class FrameLoader;
+    class WebResourceLoader;
+    struct LoadErrorResetToken;
 }
-typedef WebCore::DocumentLoader WebCoreDocumentLoader;
-typedef WebCore::FrameLoader WebCoreFrameLoader;
-#else
-@class WebCoreDocumentLoader;
-@class WebCoreFrameLoader;
+
 #endif
 
 @interface WebFrame (WebInternal)
@@ -78,8 +83,14 @@ typedef WebCore::FrameLoader WebCoreFrameLoader;
 - (void)_addInspector:(WebInspector *)inspector;
 - (void)_removeInspector:(WebInspector *)inspector;
 
-- (WebCoreFrameLoader*)_frameLoader;
-- (WebDataSource *)_dataSourceForDocumentLoader:(WebCoreDocumentLoader*)loader;
+#ifdef __cplusplus
+
+- (WebCore::FrameLoader*)_frameLoader;
+- (WebDataSource *)_dataSourceForDocumentLoader:(WebCore::DocumentLoader*)loader;
+
+- (void)_addDocumentLoader:(WebCore::DocumentLoader*)loader toUnarchiveState:(WebArchive *)archive;
+
+#endif
 
 - (NSURLRequest *)_webDataRequestForData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)URL unreachableURL:(NSURL *)unreachableURL;
 
@@ -116,10 +127,125 @@ typedef WebCore::FrameLoader WebCoreFrameLoader;
 - (void)_recursive_pauseNullEventsForAllNetscapePlugins;
 - (void)_recursive_resumeNullEventsForAllNetscapePlugins;
 
-- (void)_addDocumentLoader:(WebCoreDocumentLoader*)loader toUnarchiveState:(WebArchive *)archive;
+@end
+
+#ifdef __cplusplus
+
+@interface WebFrame (WebFrameLoaderClient)
+
+- (BOOL)_hasBackForwardList;
+- (void)_resetBackForwardList;
+- (void)_invalidateCurrentItemPageCache;
+- (BOOL)_provisionalItemIsTarget;
+- (BOOL)_loadProvisionalItemFromPageCache;
+- (BOOL)_privateBrowsingEnabled;
+- (void)_makeDocumentView;
+- (void)_forceLayout;
+- (void)_updateHistoryForCommit;
+- (void)_updateHistoryForReload;
+- (void)_updateHistoryForStandardLoad;
+- (void)_updateHistoryForBackForwardNavigation;
+- (void)_updateHistoryForInternalLoad;
+- (WebCore::LoadErrorResetToken*)_tokenForLoadErrorReset;
+- (void)_resetAfterLoadError:(WebCore::LoadErrorResetToken*)token;
+- (void)_doNotResetAfterLoadError:(WebCore::LoadErrorResetToken*)token;
+- (void)_dispatchDidHandleOnloadEventsForFrame;
+- (void)_dispatchDidReceiveServerRedirectForProvisionalLoadForFrame;
+- (id)_dispatchIdentifierForInitialRequest:(NSURLRequest *)clientRequest fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (NSURLRequest *)_dispatchResource:(id)identifier willSendRequest:(NSURLRequest *)clientRequest redirectResponse:(NSURLResponse *)redirectResponse fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchDidReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchDidCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)currentWebChallenge forResource:(id)identifier fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchResource:(id)identifier didReceiveResponse:(NSURLResponse *)r fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchResource:(id)identifier didReceiveContentLength:(int)lengthReceived fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchResource:(id)identifier didFinishLoadingFromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchResource:(id)identifier didFailLoadingWithError:error fromDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_dispatchDidCancelClientRedirectForFrame;
+- (void)_dispatchWillPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date;
+- (void)_dispatchDidChangeLocationWithinPageForFrame;
+- (void)_dispatchWillCloseFrame;
+- (void)_dispatchDidReceiveIcon:(NSImage *)icon;
+- (void)_dispatchDidStartProvisionalLoadForFrame;
+- (void)_dispatchDidReceiveTitle:(NSString *)title;
+- (void)_dispatchDidCommitLoadForFrame;
+- (void)_dispatchDidFailProvisionalLoadWithError:(NSError *)error;
+- (void)_dispatchDidFailLoadWithError:(NSError *)error;
+- (void)_dispatchDidFinishLoadForFrame;
+- (void)_dispatchDidFirstLayoutInFrame;
+- (WebCoreFrameBridge *)_dispatchCreateWebViewWithRequest:(NSURLRequest *)request;
+- (void)_dispatchShow;
+- (WebPolicyDecider *)_createPolicyDeciderWithTarget:(id)target action:(SEL)action;
+- (void)_dispatchDecidePolicyForMIMEType:(NSString *)MIMEType request:(NSURLRequest *)request decider:(WebPolicyDecider *)decider;
+- (void)_dispatchDecidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)frameName decider:(WebPolicyDecider *)decider;
+- (void)_dispatchDecidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request decider:(WebPolicyDecider *)decider;
+- (void)_dispatchUnableToImplementPolicyWithError:(NSError *)error;
+- (void)_dispatchSourceFrame:(WebCoreFrameBridge *)sourceFrame willSubmitForm:(DOMElement *)form withValues:(NSDictionary *)values submissionDecider:(WebPolicyDecider *)decider;
+- (void)_detachedFromParent1;
+- (void)_detachedFromParent2;
+- (void)_detachedFromParent3;
+- (void)_detachedFromParent4;
+- (void)_updateHistoryAfterClientRedirect;
+- (void)_loadedFromPageCache;
+- (void)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response proxy:(id)proxy;
+- (void)_setDocumentViewFromPageCache:(NSDictionary *)pageCache;
+- (void)_setCopiesOnScroll;
+- (void)_dispatchDidLoadMainResourceForDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_forceLayoutForNonHTML;
+- (void)_clearLoadingFromPageCacheForDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (BOOL)_isDocumentLoaderLoadingFromPageCache:(WebCore::DocumentLoader*)loader;
+- (void)_makeRepresentationForDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_revertToProvisionalStateForDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_setMainDocumentError:(NSError *)error forDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (void)_clearUnarchivingStateForLoader:(WebCore::DocumentLoader*)loader;
+- (void)_progressStarted;
+- (void)_progressCompleted;
+- (void)_incrementProgressForIdentifier:(id)identifier response:(NSURLResponse *)response;
+- (void)_incrementProgressForIdentifier:(id)identifier data:(NSData *)data;
+- (void)_completeProgressForIdentifier:(id)identifier;
+- (void)_setMainFrameDocumentReady:(BOOL)ready;
+- (void)_willChangeTitleForDocument:(WebCore::DocumentLoader*)loader;
+- (void)_didChangeTitleForDocument:(WebCore::DocumentLoader*)loader;
+- (void)_startDownloadWithRequest:(NSURLRequest *)request;
+- (void)_finishedLoadingDocument:(WebCore::DocumentLoader*)loader;
+- (void)_committedLoadWithDocumentLoader:(WebCore::DocumentLoader*)loader data:(NSData *)data;
+- (void)_documentLoader:(WebCore::DocumentLoader*)loader setMainDocumentError:(NSError *)error;
+- (void)_finalSetupForReplaceWithDocumentLoader:(WebCore::DocumentLoader*)loader;
+- (NSError *)_cancelledErrorWithRequest:(NSURLRequest *)request;
+- (NSError *)_cannotShowURLErrorWithRequest:(NSURLRequest *)request;
+- (NSError *)_interruptForPolicyChangeErrorWithRequest:(NSURLRequest *)request;
+- (NSError *)_cannotShowMIMETypeErrorWithResponse:(NSURLResponse *)response;
+- (NSError *)_fileDoesNotExistErrorWithResponse:(NSURLResponse *)response;
+- (BOOL)_shouldFallBackForError:(NSError *)error;
+- (BOOL)_hasWebView;
+- (BOOL)_hasFrameView;
+- (NSURL *)_mainFrameURL;
+- (BOOL)_canUseResourceForRequest:(NSURLRequest *)request;
+- (BOOL)_canUseResourceWithResponse:(NSURLResponse *)response;
+- (void)_deliverArchivedResourcesAfterDelay;
+- (BOOL)_willUseArchiveForRequest:(NSURLRequest *)r originalURL:(NSURL *)originalURL loader:(WebCore::WebResourceLoader*)loader;
+- (BOOL)_archiveLoadPendingForLoader:(WebCore::WebResourceLoader*)loader;
+- (void)_cancelPendingArchiveLoadForLoader:(WebCore::WebResourceLoader*)loader;
+- (void)_clearArchivedResources;
+- (void)_deliverArchivedResources;
+- (void)_setDefersCallbacks:(BOOL)defers;
+- (BOOL)_canHandleRequest:(NSURLRequest *)request;
+- (BOOL)_canShowMIMEType:(NSString *)MIMEType;
+- (BOOL)_representationExistsForURLScheme:(NSString *)URLScheme;
+- (NSString *)_generatedMIMETypeForURLScheme:(NSString *)URLScheme;
+- (NSDictionary *)_elementForEvent:(NSEvent *)event;
+- (void)_frameLoadCompleted;
+- (void)_restoreScrollPositionAndViewState;
+- (void)_setTitle:(NSString *)title forURL:(NSURL *)URL;
+- (PassRefPtr<WebCore::DocumentLoader>)_createDocumentLoaderWithRequest:(NSURLRequest *)request;
+- (void)_prepareForDataSourceReplacement;
+- (void)_didFinishLoad;
+- (void)_addHistoryItemForFragmentScroll;
+- (BOOL)_shouldTreatURLAsSameAsCurrent:(NSURL *)URL;
+- (void)_provisionalLoadStarted;
 
 @end
 
+#endif
+
 @interface NSObject (WebInternalFrameLoadDelegate)
 - (void)webFrame:(WebFrame *)webFrame didFinishLoadWithError:(NSError *)error;
 @end
index 24a340fa714b01ca6b0b8f2b1e0abcdbaba6e858..60a2d281fab2438d4d16178252e7bf6564c42185 100644 (file)
@@ -41,6 +41,7 @@
 #import "WebView.h"
 #import <Foundation/NSURLResponse.h>
 #import <JavaScriptCore/Assertions.h>
+#import <WebCore/FrameMac.h>
 #import <WebCore/WebDocumentLoader.h>
 
 @interface WebHTMLRepresentationPrivate : NSObject
         
         WebView *webView = [frame webView];
         if ([webView isEditable])
-            [_private->bridge applyEditingStyleToBodyElement];
+            [_private->bridge _frame]->applyEditingStyleToBodyElement();
     }
 }
 
index a41ab7fc2c8bfc3d8c81f2b7df013ee43bafa17c..b0732ab59dedcc909481de2e25a571e768aa7032 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import <WebKit/WebHTMLView.h>
-
+#import "WebHTMLView.h"
+
+#import "WebArchive.h"
+#import "WebArchiver.h"
+#import "WebBaseNetscapePluginViewInternal.h"
+#import "WebClipView.h"
+#import "WebDOMOperationsPrivate.h"
+#import "WebDataSourceInternal.h"
+#import "WebDefaultUIDelegate.h"
+#import "WebDocumentInternal.h"
+#import "WebEditingDelegate.h"
+#import "WebElementDictionary.h"
+#import "WebFrameBridge.h"
+#import "WebFrameInternal.h"
+#import "WebFramePrivate.h"
+#import "WebFrameViewInternal.h"
+#import "WebHTMLRepresentationPrivate.h"
+#import "WebHTMLViewInternal.h"
+#import "WebKitLogging.h"
+#import "WebKitNSStringExtras.h"
+#import "WebLocalizableStrings.h"
+#import "WebNSAttributedStringExtras.h"
+#import "WebNSEventExtras.h"
+#import "WebNSFileManagerExtras.h"
+#import "WebNSImageExtras.h"
+#import "WebNSObjectExtras.h"
+#import "WebNSPasteboardExtras.h"
+#import "WebNSPrintOperationExtras.h"
+#import "WebNSURLExtras.h"
+#import "WebNSViewExtras.h"
+#import "WebNetscapePluginEmbeddedView.h"
+#import "WebPluginController.h"
+#import "WebPreferences.h"
+#import "WebPreferencesPrivate.h"
+#import "WebResourcePrivate.h"
+#import "WebStringTruncator.h"
+#import "WebUIDelegatePrivate.h"
+#import "WebViewInternal.h"
+#import <AppKit/NSAccessibility.h>
 #import <ApplicationServices/ApplicationServices.h>
+#import <WebCore/FrameMac.h>
+#import <WebCore/WebCoreTextRenderer.h>
+#import <WebCore/WebDataProtocol.h>
 #import <WebKit/DOM.h>
 #import <WebKit/DOMExtensions.h>
 #import <WebKit/DOMPrivate.h>
-#import <WebKit/WebArchive.h>
-#import <WebKit/WebArchiver.h>
-#import <WebKit/WebBaseNetscapePluginViewInternal.h>
-#import <WebKit/WebFrameBridge.h>
-#import <WebKit/WebClipView.h>
-#import <WebCore/WebDataProtocol.h>
-#import <WebKit/WebDataSourceInternal.h>
-#import <WebKit/WebDefaultUIDelegate.h>
-#import <WebKit/WebDocumentInternal.h>
-#import <WebKit/WebDOMOperationsPrivate.h>
-#import <WebKit/WebEditingDelegate.h>
-#import <WebKit/WebElementDictionary.h>
-#import <WebKit/WebFramePrivate.h>
-#import <WebKit/WebFrameInternal.h>
-#import <WebKit/WebFrameViewInternal.h>
-#import <WebKit/WebHTMLViewInternal.h>
-#import <WebKit/WebHTMLRepresentationPrivate.h>
-#import <WebKit/WebKitLogging.h>
-#import <WebKit/WebKitNSStringExtras.h>
-#import <WebKit/WebLocalizableStrings.h>
-#import <WebKit/WebNetscapePluginEmbeddedView.h>
-#import <WebKit/WebNSAttributedStringExtras.h>
-#import <WebKit/WebNSEventExtras.h>
-#import <WebKit/WebNSFileManagerExtras.h>
-#import <WebKit/WebNSImageExtras.h>
-#import <WebKit/WebNSObjectExtras.h>
-#import <WebKit/WebNSPasteboardExtras.h>
-#import <WebKit/WebNSPrintOperationExtras.h>
-#import <WebKit/WebNSURLExtras.h>
-#import <WebKit/WebNSViewExtras.h>
-#import <WebKit/WebPluginController.h>
-#import <WebKit/WebPreferences.h>
-#import <WebKit/WebPreferencesPrivate.h>
-#import <WebKit/WebResourcePrivate.h>
-#import <WebKit/WebStringTruncator.h>
-#import <WebKit/WebUIDelegatePrivate.h>
-#import <WebKit/WebViewInternal.h>
 #import <WebKitSystemInterface.h>
-#import <WebCore/WebCoreTextRenderer.h>
-
-#import <AppKit/NSAccessibility.h>
-
-// Included so usage of _NSSoftLinkingGetFrameworkFuncPtr will compile
 #import <mach-o/dyld.h> 
 
+using namespace WebCore;
+
+extern "C" {
 
 // need to declare this because AppKit does not make it available as API or SPI
 extern NSString *NSMarkedClauseSegmentAttributeName; 
 extern NSString *NSTextInputReplacementRangeAttributeName; 
 
 // Kill ring calls. Would be better to use NSKillRing.h, but that's not available in SPI.
+
 void _NSInitializeKillRing(void);
 void _NSAppendToKillRing(NSString *);
 void _NSPrependToKillRing(NSString *);
@@ -92,6 +94,8 @@ void _NSNewKillRingSequence(void);
 void _NSSetKillRingToYankedState(void);
 void _NSResetKillRingOperationFlag(void);
 
+}
+
 @interface NSView (AppKitSecretsIKnowAbout)
 - (void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)isVisibleRect rectIsVisibleRectForView:(NSView *)visibleView topView:(BOOL)topView;
 - (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)needsLockFocus visRect:(NSRect)visRect;
@@ -176,11 +180,8 @@ static BOOL forceNSViewHitTest = NO;
 static BOOL forceWebHTMLViewHitTest = NO;
 
 // Used to avoid linking with ApplicationServices framework for _DCMDictionaryServiceWindowShow
-void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFrameworkName,
-                                        NSString *inFrameworkName,
-                                        const char *inFuncName,
-                                        const struct mach_header **ioCachedFrameworkImageHeaderPtr);
-
+extern "C" void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFrameworkName,
+    NSString *inFrameworkName, const char *inFuncName, const struct mach_header **);
 
 @interface WebHTMLView (WebTextSizing) <_WebDocumentTextSizing>
 @end
@@ -1699,21 +1700,23 @@ static WebHTMLView *lastHitView = nil;
     }
     
     // Soft link to dictionary-display function to avoid linking another framework (ApplicationServices/LangAnalysis)
-    static OSStatus (*__dictionaryServiceWindowShow)(id inWordString, NSRect inWordBoundary, UInt16 inLineDirection) = NULL;
-    static const struct mach_header *frameworkImageHeader = NULL;
-    static BOOL lookedForFunction = NO;
+    static bool lookedForFunction = false;
+    typedef OSStatus (*ServiceWindowShowFunction)(id inWordString, NSRect inWordBoundary, UInt16 inLineDirection);
+    static ServiceWindowShowFunction dictionaryServiceWindowShow;
     if (!lookedForFunction) {
-        __dictionaryServiceWindowShow = _NSSoftLinkingGetFrameworkFuncPtr(@"ApplicationServices", @"LangAnalysis", "_DCMDictionaryServiceWindowShow", &frameworkImageHeader);
-        lookedForFunction = YES;
+        const struct mach_header *frameworkImageHeader;
+        dictionaryServiceWindowShow = reinterpret_cast<ServiceWindowShowFunction>(
+            _NSSoftLinkingGetFrameworkFuncPtr(@"ApplicationServices", @"LangAnalysis", "_DCMDictionaryServiceWindowShow", &frameworkImageHeader));
+        lookedForFunction = true;
     }
-    if (!__dictionaryServiceWindowShow) {
+    if (!dictionaryServiceWindowShow) {
         LOG_ERROR("Couldn't find _DCMDictionaryServiceWindowShow"); 
         return;
     }
-    
+
     // FIXME: must check for right-to-left here
     NSWritingDirection writingDirection = NSWritingDirectionLeftToRight;
-    
+
     NSAttributedString *attrString = [self selectedAttributedString];
     // FIXME: the dictionary API expects the rect for the first line of selection. Passing
     // the rect for the entire selection, as we do here, positions the pop-up window near
@@ -1721,7 +1724,7 @@ static WebHTMLView *lastHitView = nil;
     NSRect rect = [self convertRect:[[self _bridge] visibleSelectionRect] toView:nil];
     rect.origin = [[self window] convertBaseToScreen:rect.origin];
     NSData *data = [attrString RTFFromRange:NSMakeRange(0, [attrString length]) documentAttributes:nil];
-    (void)__dictionaryServiceWindowShow(data, rect, (writingDirection == NSWritingDirectionRightToLeft) ? 1 : 0);
+    dictionaryServiceWindowShow(data, rect, (writingDirection == NSWritingDirectionRightToLeft) ? 1 : 0);
 }
 
 - (BOOL)_transparentBackground
@@ -2082,6 +2085,7 @@ static WebHTMLView *lastHitView = nil;
 {
     SEL action = [item action];
     WebFrameBridge *bridge = [self _bridge];
+    FrameMac* frame = [bridge _frame];
 
     if (action == @selector(changeSpelling:)
             || action == @selector(_changeSpellingFromMenu:)
@@ -2167,7 +2171,7 @@ static WebHTMLView *lastHitView = nil;
     if (action == @selector(changeBaseWritingDirection:)) {
         NSMenuItem *menuItem = (NSMenuItem *)item;
         if ([menuItem isKindOfClass:[NSMenuItem class]]) {
-            NSWritingDirection writingDirection = [item tag];
+            NSWritingDirection writingDirection = static_cast<NSWritingDirection>([item tag]);
             if (writingDirection == NSWritingDirectionNatural) {
                 [menuItem setState:NO];
                 return NO;
@@ -2217,10 +2221,10 @@ static WebHTMLView *lastHitView = nil;
         return [[self _webView] isEditable] && [self _canEditRichly];
     
     if (action == @selector(copy:))
-        return [bridge mayDHTMLCopy] || [self _canCopy];
+        return (frame && frame->mayDHTMLCopy()) || [self _canCopy];
     
     if (action == @selector(cut:))
-        return [bridge mayDHTMLCut] || [self _canCut];
+        return (frame && frame->mayDHTMLCut()) || [self _canCut];
     
     if (action == @selector(delete:))
         return [self _canDelete];
@@ -2231,10 +2235,10 @@ static WebHTMLView *lastHitView = nil;
         return [self _hasSelection];
     
     if (action == @selector(paste:) || action == @selector(pasteAsPlainText:))
-        return [bridge mayDHTMLPaste] || [self _canPaste];
+        return (frame && frame->mayDHTMLPaste()) || [self _canPaste];
     
     if (action == @selector(pasteAsRichText:))
-        return [bridge mayDHTMLPaste] || ([self _canPaste] && [[self _bridge] isSelectionRichlyEditable]);
+        return (frame && frame->mayDHTMLPaste()) || ([self _canPaste] && [[self _bridge] isSelectionRichlyEditable]);
     
     if (action == @selector(performFindPanelAction:))
         // FIXME: Not yet implemented.
@@ -2798,11 +2802,9 @@ static WebHTMLView *lastHitView = nil;
 - (void)scrollWheel:(NSEvent *)event
 {
     [self retain];
-    
-    if (![[self _bridge] sendScrollWheelEvent:event]) {
-        [[self nextResponder] scrollWheel:event];
-    }    
-    
+    FrameMac* frame = [[self _bridge] _frame];
+    if (!frame || !frame->wheelEvent(event))
+        [[self nextResponder] scrollWheel:event];    
     [self release];
 }
 
@@ -2823,11 +2825,14 @@ static WebHTMLView *lastHitView = nil;
     if (hitHTMLView != nil) {
         [hitHTMLView _setMouseDownEvent:event];
         [[hitHTMLView _bridge] setActivationEventNumber:[event eventNumber]];
-        BOOL result = [hitHTMLView _isSelectionEvent:event] ? [[hitHTMLView _bridge] eventMayStartDrag:event] : NO;
+        bool result = false;
+        if ([hitHTMLView _isSelectionEvent:event])
+            if (FrameMac* frame = [[hitHTMLView _bridge] _frame])
+                result = frame->eventMayStartDrag(event);
         [hitHTMLView _setMouseDownEvent:nil];
         return result;
-    } else
-        return [hitView acceptsFirstMouse:event];
+    }
+    return [hitView acceptsFirstMouse:event];
 }
 
 - (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)event
@@ -2835,12 +2840,14 @@ static WebHTMLView *lastHitView = nil;
     NSView *hitView = [self _hitViewForEvent:event];
     WebHTMLView *hitHTMLView = [hitView isKindOfClass:[self class]] ? (WebHTMLView *)hitView : nil;
     if (hitHTMLView != nil) {
-        [hitHTMLView _setMouseDownEvent:event];
-        BOOL result = [hitHTMLView _isSelectionEvent:event] ? [[hitHTMLView _bridge] eventMayStartDrag:event] : NO;
+        bool result = false;
+        if ([hitHTMLView _isSelectionEvent:event])
+            if (FrameMac* frame = [[hitHTMLView _bridge] _frame])
+                result = frame->eventMayStartDrag(event);
         [hitHTMLView _setMouseDownEvent:nil];
         return result;
-    } else
-        return [hitView shouldDelayWindowOrderingForEvent:event];
+    }
+    return [hitView shouldDelayWindowOrderingForEvent:event];
 }
 
 - (void)mouseDown:(NSEvent *)event
@@ -3763,7 +3770,7 @@ done:
 - (NSData *)_selectionStartFontAttributesAsRTF
 {
     NSAttributedString *string = [[NSAttributedString alloc] initWithString:@"x"
-        attributes:[[self _bridge] fontAttributesForSelectionStart]];
+        attributes:[[self _bridge] _frame]->fontAttributesForSelectionStart()];
     NSData *data = [string RTFFromRange:NSMakeRange(0, [string length]) documentAttributes:nil];
     [string release];
     return data;
@@ -4754,7 +4761,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     if (![self _canEdit])
         return;
     
-    NSWritingDirection writingDirection = [sender tag];
+    NSWritingDirection writingDirection = static_cast<NSWritingDirection>([sender tag]);
     
     // We disable the menu item that performs this action because we can't implement
     // NSWritingDirectionNatural's behavior using CSS.
@@ -4767,12 +4774,12 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
 - (void)indent:(id)sender
 {
-    [[self _bridge] indent];
+    [[self _bridge] _frame]->indent();
 }
 
 - (void)outdent:(id)sender
 {
-    [[self _bridge] outdent];
+    [[self _bridge] _frame]->outdent();
 }
 
 #if 0
@@ -4785,18 +4792,14 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 // It's probably simple to do the equivalent thing for WebKit.
 - (void)insertTable:(id)sender;
 
-// === key binding methods that NSTextView has that don't have standard key bindings
-
-// These could be important.
+// This could be important.
 - (void)toggleTraditionalCharacterShape:(id)sender;
 
 // I'm not sure what the equivalents of these in the web world are.
 - (void)insertLineSeparator:(id)sender;
 - (void)insertPageBreak:(id)sender;
 
-// === methods not present in NSTextView
-
-// These methods are not implemented in NSTextView yet, so perhaps there's no rush.
+// These methods are not implemented in NSTextView yet at the time of this writing.
 - (void)changeCaseOfLetter:(id)sender;
 - (void)transposeWords:(id)sender;
 
@@ -5092,7 +5095,8 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
 - (void)copy:(id)sender
 {
-    if ([[self _bridge] tryDHTMLCopy])
+    FrameMac* frame = [[self _bridge] _frame];
+    if (frame && frame->tryDHTMLCopy())
         return; // DHTML did the whole operation
     if (![self _canCopy]) {
         NSBeep();
@@ -5104,7 +5108,8 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 - (void)cut:(id)sender
 {
     WebFrameBridge *bridge = [self _bridge];
-    if ([bridge tryDHTMLCut])
+    FrameMac* frame = [bridge _frame];
+    if (frame && frame->tryDHTMLCut())
         return; // DHTML did the whole operation
     if (![self _canCut]) {
         NSBeep();
@@ -5119,11 +5124,13 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
 - (void)paste:(id)sender
 {
-    if ([[self _bridge] tryDHTMLPaste])
-        return;     // DHTML did the whole operation
+    WebFrameBridge *bridge = [self _bridge];
+    FrameMac* frame = [bridge _frame];
+    if (frame && frame->tryDHTMLPaste())
+        return; // DHTML did the whole operation
     if (![self _canPaste])
         return;
-    if ([[self _bridge] isSelectionRichlyEditable])
+    if ([bridge isSelectionRichlyEditable])
         [self _pasteWithPasteboard:[NSPasteboard generalPasteboard] allowPlainText:YES];
     else
         [self _pasteAsPlainTextWithPasteboard:[NSPasteboard generalPasteboard]];
index bf94fd82eb5cc41b37463aa0d6eb6095097e6039..68351668bfb65a4ecd2a3b43c77059a9475186ed 100644 (file)
@@ -85,6 +85,7 @@
 #import <CoreFoundation/CFSet.h>
 #import <Foundation/NSURLConnection.h>
 #import <JavaScriptCore/Assertions.h>
+#import <WebCore/FrameMac.h>
 #import <WebCore/WebCoreEncodings.h>
 #import <WebCore/WebCoreFrameBridge.h>
 #import <WebCore/WebCoreSettings.h>
@@ -1405,7 +1406,10 @@ static bool debugWidget = true;
 - (NSDictionary *)_dashboardRegions
 {
     // Only return regions from main frame.
-    NSMutableDictionary *regions = [[[self mainFrame] _bridge] dashboardRegions];
+    FrameMac* mainFrame = [[[self mainFrame] _bridge] _frame];
+    if (!mainFrame)
+        return nil;
+    NSMutableDictionary *regions = mainFrame->dashboardRegionsDictionary();
     [self _addScrollerDashboardRegions:regions];
     return regions;
 }
@@ -1503,7 +1507,9 @@ static bool debugWidget = true;
 
 - (void)setProhibitsMainFrameScrolling:(BOOL)prohibits
 {
-    [[[self mainFrame] _bridge] setProhibitsScrolling:YES];
+    FrameMac* mainFrame = [[[self mainFrame] _bridge] _frame];
+    if (mainFrame)
+        mainFrame->setProhibitsScrolling(prohibits);
 }
 
 - (BOOL)alwaysShowHorizontalScroller
@@ -1514,12 +1520,15 @@ static bool debugWidget = true;
 
 - (void)_setInViewSourceMode:(BOOL)flag
 {
-    [[[self mainFrame] _bridge] setInViewSourceMode:flag];
+    FrameMac* mainFrame = [[[self mainFrame] _bridge] _frame];
+    if (mainFrame)
+        mainFrame->setInViewSourceMode(flag);
 }
 
 - (BOOL)_inViewSourceMode
 {
-    return [[[self mainFrame] _bridge] inViewSourceMode];
+    FrameMac* mainFrame = [[[self mainFrame] _bridge] _frame];
+    return mainFrame && mainFrame->inViewSourceMode();
 }
 
 - (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths
@@ -3153,14 +3162,16 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
         _private->editable = flag;
         if (!_private->tabKeyCyclesThroughElementsChanged)
             _private->tabKeyCyclesThroughElements = !flag;
-        WebFrameBridge *bridge = [[self mainFrame] _bridge];
-        if (flag) {
-            [bridge applyEditingStyleToBodyElement];
-            // If the WebView is made editable and the selection is empty, set it to something.
-            if (![self selectedDOMRange])
-                [bridge setSelectionFromNone];
-        } else
-            [bridge removeEditingStyleFromBodyElement];
+        FrameMac* mainFrame = [[[self mainFrame] _bridge] _frame];
+        if (mainFrame) {
+            if (flag) {
+                mainFrame->applyEditingStyleToBodyElement();
+                // If the WebView is made editable and the selection is empty, set it to something.
+                if (![self selectedDOMRange])
+                    mainFrame->setSelectionFromNone();
+            } else
+                mainFrame->removeEditingStyleFromBodyElement();
+        }
     }
 }