Frame::tree should return a reference instead of a pointer
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Aug 2013 02:28:06 +0000 (02:28 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Aug 2013 02:28:06 +0000 (02:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=120259

Reviewed by Andreas Kling.

Source/WebCore:

* page/Frame.h:
(WebCore::Frame::tree): Return a reference instead of a pointer.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::childFrameGetter):
(WebCore::indexGetter):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::JSDOMWindow::setLocation):
* bindings/js/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
* dom/Document.cpp:
(WebCore::canAccessAncestor):
(WebCore::Document::adoptNode):
(WebCore::Document::canNavigate):
(WebCore::Document::findUnsafeParentScrollPropagationBoundary):
(WebCore::Document::notifySeamlessChildDocumentsOfStylesheetUpdate):
(WebCore::Document::openSearchDescriptionURL):
(WebCore::Document::setDesignMode):
(WebCore::Document::parentDocument):
(WebCore::Document::initSecurityContext):
(WebCore::Document::initContentSecurityPolicy):
(WebCore::Document::requestFullScreenForElement):
(WebCore::Document::webkitExitFullscreen):
(WebCore::Document::didRemoveTouchEventHandler):
* dom/TreeScope.cpp:
(WebCore::focusedFrameOwnerElement):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::CachedFrameBase):
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
* history/PageCache.cpp:
(WebCore::logCanCacheFrameDecision):
(WebCore::PageCache::canCachePageContainingThisFrame):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::hasFocus):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::findFramesWithUninstrumentedCanvases):
(WebCore::InspectorCanvasAgent::frameNavigated):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::documents):
* inspector/InspectorFileSystemAgent.cpp:
(WebCore::InspectorFileSystemAgent::assertScriptExecutionContextForOrigin):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::deleteCookie):
(WebCore::InspectorPageAgent::searchInResources):
(WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
(WebCore::InspectorPageAgent::buildObjectForFrame):
(WebCore::InspectorPageAgent::buildObjectForFrameTree):
* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::reportExecutionContextCreation):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::mainResource):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::createDecoderIfNeeded):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm):
(WebCore::FrameLoader::allChildrenAreComplete):
(WebCore::FrameLoader::allAncestorsAreComplete):
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::outgoingReferrer):
(WebCore::FrameLoader::updateFirstPartyForCookies):
(WebCore::FrameLoader::setFirstPartyForCookies):
(WebCore::FrameLoader::completed):
(WebCore::FrameLoader::started):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::stopAllLoaders):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::closeOldDataSources):
(WebCore::FrameLoader::prepareForCachedPageRestore):
(WebCore::FrameLoader::subframeIsLoading):
(WebCore::FrameLoader::subresourceCachePolicy):
(WebCore::FrameLoader::detachChildren):
(WebCore::FrameLoader::closeAndRemoveChild):
(WebCore::FrameLoader::checkLoadComplete):
(WebCore::FrameLoader::numPendingOrLoadingRequests):
(WebCore::FrameLoader::detachFromParent):
(WebCore::FrameLoader::shouldClose):
(WebCore::FrameLoader::handleBeforeUnloadEvent):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
(WebCore::FrameLoader::findFrameForNavigation):
(WebCore::FrameLoader::effectiveSandboxFlags):
(WebCore::createWindow):
* loader/HistoryController.cpp:
(WebCore::HistoryController::saveDocumentState):
(WebCore::HistoryController::saveDocumentAndScrollState):
(WebCore::HistoryController::restoreDocumentState):
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
(WebCore::HistoryController::recursiveUpdateForCommit):
(WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
(WebCore::HistoryController::initializeItem):
(WebCore::HistoryController::createItemTree):
(WebCore::HistoryController::recursiveSetProvisionalItem):
(WebCore::HistoryController::recursiveGoToItem):
(WebCore::HistoryController::currentFramesMatchItem):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::mustLockBackForwardList):
(WebCore::NavigationScheduler::scheduleFormSubmission):
* loader/ProgressTracker.cpp:
(WebCore::ProgressTracker::progressStarted):
(WebCore::ProgressTracker::progressCompleted):
(WebCore::ProgressTracker::isMainLoadProgressing):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::checkInsecureContent):
* loader/icon/IconController.cpp:
(WebCore::IconController::urlsForTypes):
(WebCore::IconController::startLoader):
* page/Chrome.cpp:
(WebCore::canRunModalIfDuringPageDismissal):
(WebCore::Chrome::windowScreenDidChange):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::length):
(WebCore::DOMWindow::name):
(WebCore::DOMWindow::setName):
(WebCore::DOMWindow::parent):
(WebCore::DOMWindow::top):
(WebCore::DOMWindow::open):
* page/EventHandler.cpp:
(WebCore::EventHandler::scrollRecursively):
(WebCore::EventHandler::logicalScrollRecursively):
(WebCore::EventHandler::handleMouseMoveEvent):
* page/FocusController.cpp:
(WebCore::FocusController::setContainingWindowIsVisible):
* page/Frame.cpp:
(WebCore::parentPageZoomFactor):
(WebCore::parentTextZoomFactor):
(WebCore::Frame::setPrinting):
(WebCore::Frame::shouldUsePrintingLayout):
(WebCore::Frame::dispatchVisibilityStateChangeEvent):
(WebCore::Frame::willDetachPage):
(WebCore::Frame::setPageAndTextZoomFactors):
(WebCore::Frame::deviceOrPageScaleFactorChanged):
(WebCore::Frame::notifyChromeClientWheelEventHandlerCountChanged):
(WebCore::Frame::isURLAllowed):
* page/FrameTree.cpp:
(WebCore::FrameTree::~FrameTree):
(WebCore::FrameTree::setName):
(WebCore::FrameTree::transferChild):
(WebCore::FrameTree::appendChild):
(WebCore::FrameTree::actuallyAppendChild):
(WebCore::FrameTree::removeChild):
(WebCore::FrameTree::uniqueChildName):
(WebCore::FrameTree::scopedChild):
(WebCore::FrameTree::scopedChildCount):
(WebCore::FrameTree::childCount):
(WebCore::FrameTree::child):
(WebCore::FrameTree::find):
(WebCore::FrameTree::isDescendantOf):
(WebCore::FrameTree::traverseNext):
(WebCore::FrameTree::traversePreviousWithWrap):
(WebCore::FrameTree::deepLastChild):
(WebCore::FrameTree::top):
(printFrames):
(showFrameTree):
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::hasCompositedContentIncludingDescendants):
(WebCore::FrameView::hasCompositingAncestor):
(WebCore::FrameView::flushCompositingStateIncludingSubframes):
(WebCore::FrameView::updateCanBlitOnScrollRecursively):
(WebCore::FrameView::setIsOverlapped):
(WebCore::FrameView::shouldUseLoadTimeDeferredRepaintDelay):
(WebCore::FrameView::updateLayerFlushThrottlingInAllFrames):
(WebCore::FrameView::serviceScriptedAnimations):
(WebCore::FrameView::updateBackgroundRecursively):
(WebCore::FrameView::parentFrameView):
(WebCore::FrameView::paintContentsForSnapshot):
(WebCore::FrameView::setTracksRepaints):
(WebCore::FrameView::notifyWidgetsInAllFrames):
* page/Location.cpp:
(WebCore::Location::ancestorOrigins):
* page/Page.cpp:
(WebCore::networkStateChanged):
(WebCore::Page::~Page):
(WebCore::Page::renderTreeSize):
(WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
(WebCore::Page::setNeedsRecalcStyleInAllFrames):
(WebCore::Page::refreshPlugins):
(WebCore::Page::takeAnyMediaCanStartListener):
(WebCore::incrementFrame):
(WebCore::Page::setDefersLoading):
(WebCore::Page::setMediaVolume):
(WebCore::Page::setDeviceScaleFactor):
(WebCore::Page::setShouldSuppressScrollbarAnimations):
(WebCore::Page::didMoveOnscreen):
(WebCore::Page::willMoveOffscreen):
(WebCore::Page::setIsInWindow):
(WebCore::Page::suspendScriptedAnimations):
(WebCore::Page::resumeScriptedAnimations):
(WebCore::Page::userStyleSheetLocationChanged):
(WebCore::Page::allVisitedStateChanged):
(WebCore::Page::visitedStateChanged):
(WebCore::Page::setDebugger):
(WebCore::Page::setMemoryCacheClientCallsEnabled):
(WebCore::Page::setMinimumTimerInterval):
(WebCore::Page::setTimerAlignmentInterval):
(WebCore::Page::dnsPrefetchingStateChanged):
(WebCore::Page::collectPluginViews):
(WebCore::Page::storageBlockingStateChanged):
(WebCore::Page::privateBrowsingStateChanged):
(WebCore::Page::checkSubframeCountConsistency):
(WebCore::Page::suspendActiveDOMObjectsAndAnimations):
(WebCore::Page::resumeActiveDOMObjectsAndAnimations):
(WebCore::Page::captionPreferencesChanged):
* page/PageGroup.cpp:
(WebCore::PageGroup::invalidateInjectedStyleSheetCacheInAllFrames):
* page/PageGroupLoadDeferrer.cpp:
(WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
(WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):
* page/PageThrottler.cpp:
(WebCore::PageThrottler::throttlePage):
(WebCore::PageThrottler::unthrottlePage):
* page/Settings.cpp:
(WebCore::setImageLoadingSettings):
(WebCore::Settings::setTextAutosizingFontScaleFactor):
* page/SpatialNavigation.cpp:
(WebCore::rectToAbsoluteCoordinates):
* page/animation/AnimationController.cpp:
(WebCore::AnimationControllerPrivate::suspendAnimations):
(WebCore::AnimationControllerPrivate::resumeAnimations):
* page/mac/PageMac.cpp:
(WebCore::Page::addSchedulePair):
(WebCore::Page::removeSchedulePair):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
(WebCore::ScrollingCoordinator::computeCurrentWheelEventHandlerCount):
* plugins/PluginView.cpp:
(WebCore::PluginView::performRequest):
(WebCore::PluginView::load):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::targetFrame):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::processSubtree):
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::currentScale):
(WebCore::SVGSVGElement::setCurrentScale):
* testing/Internals.cpp:
(WebCore::Internals::formControlStateOfPreviousHistoryItem):
(WebCore::Internals::setFormControlStateOfPreviousHistoryItem):
(WebCore::Internals::numberOfScrollableAreas):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::hasNoStyleInformation):
Use tree(). instead of tree()->.

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::closeURLRecursively):
(BlackBerry::WebKit::enableCrossSiteXHRRecursively):
(BlackBerry::WebKit::WebPagePrivate::setScreenOrientation):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::createFrame):
* WebKitSupport/DOMSupport.cpp:
(BlackBerry::WebKit::DOMSupport::convertPointToFrame):
(BlackBerry::WebKit::DOMSupport::incrementFrame):
Use tree(). instead of tree()->.

Source/WebKit/efl:

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::clearFrameName):
(DumpRenderTreeSupportEfl::frameChildren):
(DumpRenderTreeSupportEfl::frameParent):
* ewk/ewk_frame.cpp:
(_ewk_frame_children_iterator_next):
(ewk_frame_child_find):
(ewk_frame_name_get):
(ewk_frame_child_add):
* ewk/ewk_view.cpp:
(ewk_view_frame_create):
Use tree(). instead of tree()->.

Source/WebKit/gtk:

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::getFrameChildren):
(DumpRenderTreeSupportGtk::clearMainFrameName):
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::createFrame):
* webkit/webkitwebframe.cpp:
(webkit_web_frame_get_name):
(webkit_web_frame_get_parent):
(webkit_web_frame_find_frame):
* webkit/webkitwebview.cpp:
(webkit_web_view_set_highlight_text_matches):
Use tree(). instead of tree()->.

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::performRequest):
* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView resolvedURLStringForURL:target:]):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView loadPluginRequest:]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(applyAppleDictionaryApplicationQuirkNonInlinePart):
(WebFrameLoaderClient::prepareForDataSourceReplacement):
(WebFrameLoaderClient::createFrame):
* WebView/WebFrame.mm:
(+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]):
(-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]):
(-[WebFrame _unmarkAllBadGrammar]):
(-[WebFrame _unmarkAllMisspellings]):
(-[WebFrame _atMostOneFrameHasSelection]):
(-[WebFrame _findFrameWithSelection]):
(-[WebFrame _drawRect:contentsOnly:]):
(-[WebFrame _isDescendantOfFrame:]):
(-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]):
(-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]):
(-[WebFrame name]):
(-[WebFrame findFrameNamed:]):
(-[WebFrame parentFrame]):
(-[WebFrame childFrames]):
* WebView/WebView.mm:
(-[WebView _attachScriptDebuggerToAllFrames]):
(-[WebView _detachScriptDebuggerFromAllFrames]):
(-[WebView _clearMainFrameName]):
(-[WebView _isUsingAcceleratedCompositing]):
(-[WebView _isSoftwareRenderable]):
(-[WebView setHostWindow:]):
(incrementFrame):
Use tree(). instead of tree()->.

Source/WebKit/qt:

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::clearFrameName):
* WebCoreSupport/FrameLoaderClientQt.cpp:
(drtDescriptionSuitableForTestResult):
(WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
(WebCore::FrameLoaderClientQt::dispatchDidFinishDocumentLoad):
(WebCore::FrameLoaderClientQt::postProgressStartedNotification):
(WebCore::FrameLoaderClientQt::didPerformFirstNavigation):
(WebCore::FrameLoaderClientQt::createFrame):
* WebCoreSupport/QWebFrameAdapter.cpp:
(QWebFrameData::QWebFrameData):
(QWebFrameAdapter::load):
(QWebFrameAdapter::uniqueName):
(QWebFrameAdapter::childFrames):
* WebCoreSupport/QWebPageAdapter.cpp:
(QWebPageAdapter::findText):
Use tree(). instead of tree()->.

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::createFrame):
* WebFrame.cpp:
(WebFrame::name):
(WebFrame::findFrameNamed):
(WebFrame::parentFrame):
(EnumChildFrames::EnumChildFrames):
(EnumChildFrames::Next):
(EnumChildFrames::Skip):
(EnumChildFrames::Reset):
(WebFrame::isDescendantOfFrame):
(WebFrame::unmarkAllMisspellings):
(WebFrame::unmarkAllBadGrammar):
* WebView.cpp:
(WebView::initWithFrame):
(incrementFrame):
(WebView::clearMainFrameName):
Use tree(). instead of tree()->.

Source/WebKit/wince:

* WebView.cpp:
(WebView::createFrame):
Use tree(). instead of tree()->.

Source/WebKit2:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performJavaScriptURLRequest):
* WebProcess/Storage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::dispatchSessionStorageEvent):
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createFrame):
* WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
(WebKit::WebContextMenuClient::searchWithSpotlight):
* WebProcess/WebPage/FindController.cpp:
(WebKit::frameWithSelection):
(WebKit::FindController::rectsForTextMatches):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::init):
(WebKit::WebFrame::contentsAsString):
(WebKit::WebFrame::name):
(WebKit::WebFrame::childFrames):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::clearMainFrameName):
(WebKit::WebPage::setDrawsBackground):
(WebKit::WebPage::setDrawsTransparentBackground):
(WebKit::WebPage::setWindowResizerSize):
(WebKit::frameWithSelection):
(WebKit::WebPage::unmarkAllMisspellings):
(WebKit::WebPage::unmarkAllBadGrammar):
(WebKit::pageContainsAnyHorizontalScrollbars):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::forceRepaint):
Use tree(). instead of tree()->.

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

94 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/PageScriptDebugServer.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/history/CachedFrame.cpp
Source/WebCore/history/CachedPage.cpp
Source/WebCore/history/PageCache.cpp
Source/WebCore/html/HTMLDocument.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
Source/WebCore/inspector/InspectorCanvasAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorFileSystemAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/PageRuntimeAgent.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentWriter.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/HistoryController.cpp
Source/WebCore/loader/NavigationScheduler.cpp
Source/WebCore/loader/ProgressTracker.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/icon/IconController.cpp
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/page/FrameTree.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Location.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/PageGroup.cpp
Source/WebCore/page/PageGroupLoadDeferrer.cpp
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/page/PageThrottler.cpp
Source/WebCore/page/Settings.cpp
Source/WebCore/page/SpatialNavigation.cpp
Source/WebCore/page/animation/AnimationController.cpp
Source/WebCore/page/mac/PageMac.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/plugins/PluginView.cpp
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/TextAutosizer.cpp
Source/WebCore/storage/StorageEventDispatcher.cpp
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/ewk/ewk_frame.cpp
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
Source/WebKit/gtk/webkit/webkitwebframe.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
Source/WebKit/mac/Plugins/WebNetscapePluginView.mm
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp
Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/win/WebFrame.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Storage/StorageAreaMap.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm
Source/WebKit2/WebProcess/WebPage/FindController.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index 7b355b6..42164be 100644 (file)
@@ -1,3 +1,281 @@
+2013-08-24  Darin Adler  <darin@apple.com>
+
+        Frame::tree should return a reference instead of a pointer
+        https://bugs.webkit.org/show_bug.cgi?id=120259
+
+        Reviewed by Andreas Kling.
+
+        * page/Frame.h:
+        (WebCore::Frame::tree): Return a reference instead of a pointer.
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::childFrameGetter):
+        (WebCore::indexGetter):
+        (WebCore::JSDOMWindow::getOwnPropertySlot):
+        (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
+        (WebCore::JSDOMWindow::setLocation):
+        * bindings/js/PageScriptDebugServer.cpp:
+        (WebCore::PageScriptDebugServer::setJavaScriptPaused):
+        * dom/Document.cpp:
+        (WebCore::canAccessAncestor):
+        (WebCore::Document::adoptNode):
+        (WebCore::Document::canNavigate):
+        (WebCore::Document::findUnsafeParentScrollPropagationBoundary):
+        (WebCore::Document::notifySeamlessChildDocumentsOfStylesheetUpdate):
+        (WebCore::Document::openSearchDescriptionURL):
+        (WebCore::Document::setDesignMode):
+        (WebCore::Document::parentDocument):
+        (WebCore::Document::initSecurityContext):
+        (WebCore::Document::initContentSecurityPolicy):
+        (WebCore::Document::requestFullScreenForElement):
+        (WebCore::Document::webkitExitFullscreen):
+        (WebCore::Document::didRemoveTouchEventHandler):
+        * dom/TreeScope.cpp:
+        (WebCore::focusedFrameOwnerElement):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
+        * history/CachedFrame.cpp:
+        (WebCore::CachedFrameBase::CachedFrameBase):
+        (WebCore::CachedFrameBase::restore):
+        (WebCore::CachedFrame::CachedFrame):
+        * history/CachedPage.cpp:
+        (WebCore::CachedPage::restore):
+        * history/PageCache.cpp:
+        (WebCore::logCanCacheFrameDecision):
+        (WebCore::PageCache::canCachePageContainingThisFrame):
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::hasFocus):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
+        * inspector/InspectorApplicationCacheAgent.cpp:
+        (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
+        * inspector/InspectorCanvasAgent.cpp:
+        (WebCore::InspectorCanvasAgent::findFramesWithUninstrumentedCanvases):
+        (WebCore::InspectorCanvasAgent::frameNavigated):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::documents):
+        * inspector/InspectorFileSystemAgent.cpp:
+        (WebCore::InspectorFileSystemAgent::assertScriptExecutionContextForOrigin):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::getCookies):
+        (WebCore::InspectorPageAgent::deleteCookie):
+        (WebCore::InspectorPageAgent::searchInResources):
+        (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
+        (WebCore::InspectorPageAgent::buildObjectForFrame):
+        (WebCore::InspectorPageAgent::buildObjectForFrameTree):
+        * inspector/PageRuntimeAgent.cpp:
+        (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::willSendRequest):
+        (WebCore::DocumentLoader::mainResource):
+        * loader/DocumentWriter.cpp:
+        (WebCore::DocumentWriter::createDecoderIfNeeded):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::submitForm):
+        (WebCore::FrameLoader::allChildrenAreComplete):
+        (WebCore::FrameLoader::allAncestorsAreComplete):
+        (WebCore::FrameLoader::loadURLIntoChildFrame):
+        (WebCore::FrameLoader::outgoingReferrer):
+        (WebCore::FrameLoader::updateFirstPartyForCookies):
+        (WebCore::FrameLoader::setFirstPartyForCookies):
+        (WebCore::FrameLoader::completed):
+        (WebCore::FrameLoader::started):
+        (WebCore::FrameLoader::loadURL):
+        (WebCore::FrameLoader::loadWithDocumentLoader):
+        (WebCore::FrameLoader::stopAllLoaders):
+        (WebCore::FrameLoader::commitProvisionalLoad):
+        (WebCore::FrameLoader::closeOldDataSources):
+        (WebCore::FrameLoader::prepareForCachedPageRestore):
+        (WebCore::FrameLoader::subframeIsLoading):
+        (WebCore::FrameLoader::subresourceCachePolicy):
+        (WebCore::FrameLoader::detachChildren):
+        (WebCore::FrameLoader::closeAndRemoveChild):
+        (WebCore::FrameLoader::checkLoadComplete):
+        (WebCore::FrameLoader::numPendingOrLoadingRequests):
+        (WebCore::FrameLoader::detachFromParent):
+        (WebCore::FrameLoader::shouldClose):
+        (WebCore::FrameLoader::handleBeforeUnloadEvent):
+        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
+        (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
+        (WebCore::FrameLoader::findFrameForNavigation):
+        (WebCore::FrameLoader::effectiveSandboxFlags):
+        (WebCore::createWindow):
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::saveDocumentState):
+        (WebCore::HistoryController::saveDocumentAndScrollState):
+        (WebCore::HistoryController::restoreDocumentState):
+        (WebCore::HistoryController::goToItem):
+        (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
+        (WebCore::HistoryController::recursiveUpdateForCommit):
+        (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
+        (WebCore::HistoryController::initializeItem):
+        (WebCore::HistoryController::createItemTree):
+        (WebCore::HistoryController::recursiveSetProvisionalItem):
+        (WebCore::HistoryController::recursiveGoToItem):
+        (WebCore::HistoryController::currentFramesMatchItem):
+        * loader/NavigationScheduler.cpp:
+        (WebCore::NavigationScheduler::mustLockBackForwardList):
+        (WebCore::NavigationScheduler::scheduleFormSubmission):
+        * loader/ProgressTracker.cpp:
+        (WebCore::ProgressTracker::progressStarted):
+        (WebCore::ProgressTracker::progressCompleted):
+        (WebCore::ProgressTracker::isMainLoadProgressing):
+        * loader/appcache/ApplicationCacheGroup.cpp:
+        (WebCore::ApplicationCacheGroup::selectCache):
+        (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
+        * loader/archive/cf/LegacyWebArchive.cpp:
+        (WebCore::LegacyWebArchive::create):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::checkInsecureContent):
+        * loader/icon/IconController.cpp:
+        (WebCore::IconController::urlsForTypes):
+        (WebCore::IconController::startLoader):
+        * page/Chrome.cpp:
+        (WebCore::canRunModalIfDuringPageDismissal):
+        (WebCore::Chrome::windowScreenDidChange):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::length):
+        (WebCore::DOMWindow::name):
+        (WebCore::DOMWindow::setName):
+        (WebCore::DOMWindow::parent):
+        (WebCore::DOMWindow::top):
+        (WebCore::DOMWindow::open):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::scrollRecursively):
+        (WebCore::EventHandler::logicalScrollRecursively):
+        (WebCore::EventHandler::handleMouseMoveEvent):
+        * page/FocusController.cpp:
+        (WebCore::FocusController::setContainingWindowIsVisible):
+        * page/Frame.cpp:
+        (WebCore::parentPageZoomFactor):
+        (WebCore::parentTextZoomFactor):
+        (WebCore::Frame::setPrinting):
+        (WebCore::Frame::shouldUsePrintingLayout):
+        (WebCore::Frame::dispatchVisibilityStateChangeEvent):
+        (WebCore::Frame::willDetachPage):
+        (WebCore::Frame::setPageAndTextZoomFactors):
+        (WebCore::Frame::deviceOrPageScaleFactorChanged):
+        (WebCore::Frame::notifyChromeClientWheelEventHandlerCountChanged):
+        (WebCore::Frame::isURLAllowed):
+        * page/FrameTree.cpp:
+        (WebCore::FrameTree::~FrameTree):
+        (WebCore::FrameTree::setName):
+        (WebCore::FrameTree::transferChild):
+        (WebCore::FrameTree::appendChild):
+        (WebCore::FrameTree::actuallyAppendChild):
+        (WebCore::FrameTree::removeChild):
+        (WebCore::FrameTree::uniqueChildName):
+        (WebCore::FrameTree::scopedChild):
+        (WebCore::FrameTree::scopedChildCount):
+        (WebCore::FrameTree::childCount):
+        (WebCore::FrameTree::child):
+        (WebCore::FrameTree::find):
+        (WebCore::FrameTree::isDescendantOf):
+        (WebCore::FrameTree::traverseNext):
+        (WebCore::FrameTree::traversePreviousWithWrap):
+        (WebCore::FrameTree::deepLastChild):
+        (WebCore::FrameTree::top):
+        (printFrames):
+        (showFrameTree):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setFrameRect):
+        (WebCore::FrameView::hasCompositedContentIncludingDescendants):
+        (WebCore::FrameView::hasCompositingAncestor):
+        (WebCore::FrameView::flushCompositingStateIncludingSubframes):
+        (WebCore::FrameView::updateCanBlitOnScrollRecursively):
+        (WebCore::FrameView::setIsOverlapped):
+        (WebCore::FrameView::shouldUseLoadTimeDeferredRepaintDelay):
+        (WebCore::FrameView::updateLayerFlushThrottlingInAllFrames):
+        (WebCore::FrameView::serviceScriptedAnimations):
+        (WebCore::FrameView::updateBackgroundRecursively):
+        (WebCore::FrameView::parentFrameView):
+        (WebCore::FrameView::paintContentsForSnapshot):
+        (WebCore::FrameView::setTracksRepaints):
+        (WebCore::FrameView::notifyWidgetsInAllFrames):
+        * page/Location.cpp:
+        (WebCore::Location::ancestorOrigins):
+        * page/Page.cpp:
+        (WebCore::networkStateChanged):
+        (WebCore::Page::~Page):
+        (WebCore::Page::renderTreeSize):
+        (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
+        (WebCore::Page::setNeedsRecalcStyleInAllFrames):
+        (WebCore::Page::refreshPlugins):
+        (WebCore::Page::takeAnyMediaCanStartListener):
+        (WebCore::incrementFrame):
+        (WebCore::Page::setDefersLoading):
+        (WebCore::Page::setMediaVolume):
+        (WebCore::Page::setDeviceScaleFactor):
+        (WebCore::Page::setShouldSuppressScrollbarAnimations):
+        (WebCore::Page::didMoveOnscreen):
+        (WebCore::Page::willMoveOffscreen):
+        (WebCore::Page::setIsInWindow):
+        (WebCore::Page::suspendScriptedAnimations):
+        (WebCore::Page::resumeScriptedAnimations):
+        (WebCore::Page::userStyleSheetLocationChanged):
+        (WebCore::Page::allVisitedStateChanged):
+        (WebCore::Page::visitedStateChanged):
+        (WebCore::Page::setDebugger):
+        (WebCore::Page::setMemoryCacheClientCallsEnabled):
+        (WebCore::Page::setMinimumTimerInterval):
+        (WebCore::Page::setTimerAlignmentInterval):
+        (WebCore::Page::dnsPrefetchingStateChanged):
+        (WebCore::Page::collectPluginViews):
+        (WebCore::Page::storageBlockingStateChanged):
+        (WebCore::Page::privateBrowsingStateChanged):
+        (WebCore::Page::checkSubframeCountConsistency):
+        (WebCore::Page::suspendActiveDOMObjectsAndAnimations):
+        (WebCore::Page::resumeActiveDOMObjectsAndAnimations):
+        (WebCore::Page::captionPreferencesChanged):
+        * page/PageGroup.cpp:
+        (WebCore::PageGroup::invalidateInjectedStyleSheetCacheInAllFrames):
+        * page/PageGroupLoadDeferrer.cpp:
+        (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
+        (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
+        * page/PageSerializer.cpp:
+        (WebCore::PageSerializer::serializeFrame):
+        * page/PageThrottler.cpp:
+        (WebCore::PageThrottler::throttlePage):
+        (WebCore::PageThrottler::unthrottlePage):
+        * page/Settings.cpp:
+        (WebCore::setImageLoadingSettings):
+        (WebCore::Settings::setTextAutosizingFontScaleFactor):
+        * page/SpatialNavigation.cpp:
+        (WebCore::rectToAbsoluteCoordinates):
+        * page/animation/AnimationController.cpp:
+        (WebCore::AnimationControllerPrivate::suspendAnimations):
+        (WebCore::AnimationControllerPrivate::resumeAnimations):
+        * page/mac/PageMac.cpp:
+        (WebCore::Page::addSchedulePair):
+        (WebCore::Page::removeSchedulePair):
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
+        (WebCore::ScrollingCoordinator::computeCurrentWheelEventHandlerCount):
+        * plugins/PluginView.cpp:
+        (WebCore::PluginView::performRequest):
+        (WebCore::PluginView::load):
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::targetFrame):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers):
+        (WebCore::RenderLayerCompositor::updateCompositingLayers):
+        (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
+        * rendering/TextAutosizer.cpp:
+        (WebCore::TextAutosizer::processSubtree):
+        * storage/StorageEventDispatcher.cpp:
+        (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
+        (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::currentScale):
+        (WebCore::SVGSVGElement::setCurrentScale):
+        * testing/Internals.cpp:
+        (WebCore::Internals::formControlStateOfPreviousHistoryItem):
+        (WebCore::Internals::setFormControlStateOfPreviousHistoryItem):
+        (WebCore::Internals::numberOfScrollableAreas):
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::hasNoStyleInformation):
+        Use tree(). instead of tree()->.
+
 2013-08-24  Andreas Kling  <akling@apple.com>
 
         Merge Document::viewportSize() logic into RenderView::viewportSize().
index 0ce4afe..0e688a1 100644 (file)
@@ -78,12 +78,12 @@ JSValue nonCachingStaticFunctionGetter(ExecState* exec, JSValue, PropertyName pr
 
 static JSValue childFrameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
 {
-    return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->scopedChild(propertyNameToAtomicString(propertyName))->document()->domWindow());
+    return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))->document()->domWindow());
 }
 
 static JSValue indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
 {
-    return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->scopedChild(index)->document()->domWindow());
+    return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree().scopedChild(index)->document()->domWindow());
 }
 
 static JSValue namedItemGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
@@ -207,7 +207,7 @@ bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, Property
     // naming frames things that conflict with window properties that
     // are in Moz but not IE. Since we have some of these, we have to do
     // it the Moz way.
-    if (thisObject->impl()->frame()->tree()->scopedChild(propertyNameToAtomicString(propertyName))) {
+    if (thisObject->impl()->frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))) {
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, childFrameGetter);
         return true;
     }
@@ -230,7 +230,7 @@ bool JSDOMWindow::getOwnPropertySlot(JSObject* object, ExecState* exec, Property
 
     // allow window[1] or parent[1] etc. (#56983)
     unsigned i = propertyName.asIndex();
-    if (i < thisObject->impl()->frame()->tree()->scopedChildCount()) {
+    if (i < thisObject->impl()->frame()->tree().scopedChildCount()) {
         ASSERT(i != PropertyName::NotAnIndex);
         slot.setCustomIndex(thisObject, ReadOnly | DontDelete | DontEnum, i, indexGetter);
         return true;
@@ -284,7 +284,7 @@ bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, u
     // naming frames things that conflict with window properties that
     // are in Moz but not IE. Since we have some of these, we have to do
     // it the Moz way.
-    if (thisObject->impl()->frame()->tree()->scopedChild(propertyNameToAtomicString(propertyName))) {
+    if (thisObject->impl()->frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))) {
         slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, childFrameGetter);
         return true;
     }
@@ -306,7 +306,7 @@ bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, u
     // We need to test the correct priority order.
 
     // allow window[1] or parent[1] etc. (#56983)
-    if (index < thisObject->impl()->frame()->tree()->scopedChildCount()) {
+    if (index < thisObject->impl()->frame()->tree().scopedChildCount()) {
         ASSERT(index != PropertyName::NotAnIndex);
         slot.setCustomIndex(thisObject, ReadOnly | DontDelete | DontEnum, index, indexGetter);
         return true;
@@ -428,7 +428,7 @@ void JSDOMWindow::setLocation(ExecState* exec, JSValue value)
     // To avoid breaking old widgets, make "var location =" in a top-level frame create
     // a property named "location" instead of performing a navigation (<rdar://problem/5688039>).
     if (Frame* activeFrame = activeDOMWindow(exec)->frame()) {
-        if (activeFrame->settings().usesDashboardBackwardCompatibilityMode() && !activeFrame->tree()->parent()) {
+        if (activeFrame->settings().usesDashboardBackwardCompatibilityMode() && !activeFrame->tree().parent()) {
             if (BindingSecurity::shouldAllowAccessToDOMWindow(exec, impl()))
                 putDirect(exec->vm(), Identifier(exec, "location"), value);
             return;
index bd954e4..3189a76 100644 (file)
@@ -189,7 +189,7 @@ void PageScriptDebugServer::setJavaScriptPaused(Page* page, bool paused)
 
     page->setDefersLoading(paused);
 
-    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext())
         setJavaScriptPaused(frame, paused);
 }
 
index 3d2bf2e..cd2f6e0 100644 (file)
@@ -352,7 +352,7 @@ static bool canAccessAncestor(const SecurityOrigin* activeSecurityOrigin, Frame*
         return false;
 
     const bool isLocalActiveOrigin = activeSecurityOrigin->isLocal();
-    for (Frame* ancestorFrame = targetFrame; ancestorFrame; ancestorFrame = ancestorFrame->tree()->parent()) {
+    for (Frame* ancestorFrame = targetFrame; ancestorFrame; ancestorFrame = ancestorFrame->tree().parent()) {
         Document* ancestorDocument = ancestorFrame->document();
         // FIXME: Should be an ASSERT? Frames should alway have documents.
         if (!ancestorDocument)
@@ -1038,7 +1038,7 @@ PassRefPtr<Node> Document::adoptNode(PassRefPtr<Node> source, ExceptionCode& ec)
 
         if (source->isFrameOwnerElement()) {
             HTMLFrameOwnerElement* frameOwnerElement = toFrameOwnerElement(source.get());
-            if (frame() && frame()->tree()->isDescendantOf(frameOwnerElement->contentFrame())) {
+            if (frame() && frame()->tree().isDescendantOf(frameOwnerElement->contentFrame())) {
                 ec = HIERARCHY_REQUEST_ERR;
                 return 0;
             }
@@ -2674,15 +2674,15 @@ bool Document::canNavigate(Frame* targetFrame)
         return true;
 
     // Frame-busting is generally allowed, but blocked for sandboxed frames lacking the 'allow-top-navigation' flag.
-    if (!isSandboxed(SandboxTopNavigation) && targetFrame == m_frame->tree()->top())
+    if (!isSandboxed(SandboxTopNavigation) && targetFrame == m_frame->tree().top())
         return true;
 
     if (isSandboxed(SandboxNavigation)) {
-        if (targetFrame->tree()->isDescendantOf(m_frame))
+        if (targetFrame->tree().isDescendantOf(m_frame))
             return true;
 
         const char* reason = "The frame attempting navigation is sandboxed, and is therefore disallowed from navigating its ancestors.";
-        if (isSandboxed(SandboxTopNavigation) && targetFrame == m_frame->tree()->top())
+        if (isSandboxed(SandboxTopNavigation) && targetFrame == m_frame->tree().top())
             reason = "The frame attempting navigation of the top-level window is sandboxed, but the 'allow-top-navigation' flag is not set.";
 
         printNavigationErrorMessage(targetFrame, url(), reason);
@@ -2710,7 +2710,7 @@ bool Document::canNavigate(Frame* targetFrame)
     // some way related to the frame being navigate (e.g., by the "opener"
     // and/or "parent" relation). Requiring some sort of relation prevents a
     // document from navigating arbitrary, unrelated top-level frames.
-    if (!targetFrame->tree()->parent()) {
+    if (!targetFrame->tree().parent()) {
         if (targetFrame == m_frame->loader().opener())
             return true;
 
@@ -2728,13 +2728,13 @@ Frame* Document::findUnsafeParentScrollPropagationBoundary()
     if (!currentFrame)
         return 0;
 
-    Frame* ancestorFrame = currentFrame->tree()->parent();
+    Frame* ancestorFrame = currentFrame->tree().parent();
 
     while (ancestorFrame) {
         if (!ancestorFrame->document()->securityOrigin()->canAccess(securityOrigin()))
             return currentFrame;
         currentFrame = ancestorFrame;
-        ancestorFrame = ancestorFrame->tree()->parent();
+        ancestorFrame = ancestorFrame->tree().parent();
     }
     return 0;
 }
@@ -3171,7 +3171,7 @@ void Document::notifySeamlessChildDocumentsOfStylesheetUpdate() const
         return;
 
     // Seamless child frames are expected to notify their seamless children recursively, so we only do direct children.
-    for (Frame* child = frame()->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+    for (Frame* child = frame()->tree().firstChild(); child; child = child->tree().nextSibling()) {
         Document* childDocument = child->document();
         if (childDocument->shouldDisplaySeamlesslyWithParent()) {
             ASSERT(childDocument->seamlessParentIFrame()->document() == this);
@@ -4147,7 +4147,7 @@ KURL Document::openSearchDescriptionURL()
     static const char* const openSearchRelation = "search";
 
     // FIXME: Why do only top-level frames have openSearchDescriptionURLs?
-    if (!frame() || frame()->tree()->parent())
+    if (!frame() || frame()->tree().parent())
         return KURL();
 
     // FIXME: Why do we need to wait for FrameStateComplete?
@@ -4211,7 +4211,7 @@ void Document::setTransformSource(PassOwnPtr<TransformSource> source)
 void Document::setDesignMode(InheritedBool value)
 {
     m_designMode = value;
-    for (Frame* frame = m_frame; frame && frame->document(); frame = frame->tree()->traverseNext(m_frame))
+    for (Frame* frame = m_frame; frame && frame->document(); frame = frame->tree().traverseNext(m_frame))
         frame->document()->scheduleForcedStyleRecalc();
 }
 
@@ -4233,7 +4233,7 @@ Document* Document::parentDocument() const
 {
     if (!m_frame)
         return 0;
-    Frame* parent = m_frame->tree()->parent();
+    Frame* parent = m_frame->tree().parent();
     if (!parent)
         return 0;
     return parent->document();
@@ -4549,7 +4549,7 @@ void Document::initSecurityContext()
     // If we do not obtain a meaningful origin from the URL, then we try to
     // find one via the frame hierarchy.
 
-    Frame* ownerFrame = m_frame->tree()->parent();
+    Frame* ownerFrame = m_frame->tree().parent();
     if (!ownerFrame)
         ownerFrame = m_frame->loader().opener();
 
@@ -4576,10 +4576,10 @@ void Document::initSecurityContext()
 
 void Document::initContentSecurityPolicy()
 {
-    if (!m_frame->tree()->parent() || (!shouldInheritSecurityOriginFromOwner(m_url) && !isPluginDocument()))
+    if (!m_frame->tree().parent() || (!shouldInheritSecurityOriginFromOwner(m_url) && !isPluginDocument()))
         return;
 
-    contentSecurityPolicy()->copyStateFrom(m_frame->tree()->parent()->document()->contentSecurityPolicy());
+    contentSecurityPolicy()->copyStateFrom(m_frame->tree().parent()->document()->contentSecurityPolicy());
 }
 
 bool Document::isContextThread() const
@@ -4948,7 +4948,7 @@ void Document::requestFullScreenForElement(Element* element, unsigned short flag
 
         // A descendant browsing context's document has a non-empty fullscreen element stack.
         bool descendentHasNonEmptyStack = false;
-        for (Frame* descendant = frame() ? frame()->tree()->traverseNext() : 0; descendant; descendant = descendant->tree()->traverseNext()) {
+        for (Frame* descendant = frame() ? frame()->tree().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext()) {
             if (descendant->document()->webkitFullscreenElement()) {
                 descendentHasNonEmptyStack = true;
                 break;
@@ -5071,7 +5071,7 @@ void Document::webkitExitFullscreen()
     // element stack (if any), ordered so that the child of the doc is last and the document furthest
     // away from the doc is first.
     Deque<RefPtr<Document> > descendants;
-    for (Frame* descendant = frame() ? frame()->tree()->traverseNext() : 0; descendant; descendant = descendant->tree()->traverseNext()) {
+    for (Frame* descendant = frame() ? frame()->tree().traverseNext() : 0; descendant; descendant = descendant->tree().traverseNext()) {
         if (descendant->document()->webkitFullscreenElement())
             descendants.prepend(descendant->document());
     }
@@ -5568,7 +5568,7 @@ void Document::didRemoveTouchEventHandler(Node* handler)
 #endif
     if (m_touchEventTargets->size())
         return;
-    for (const Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (const Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->document() && frame->document()->hasTouchEventHandlers())
             return;
     }
index 4599c97..50604b2 100644 (file)
@@ -376,8 +376,8 @@ void TreeScope::adoptIfNeeded(Node* node)
 
 static Element* focusedFrameOwnerElement(Frame* focusedFrame, Frame* currentFrame)
 {
-    for (; focusedFrame; focusedFrame = focusedFrame->tree()->parent()) {
-        if (focusedFrame->tree()->parent() == currentFrame)
+    for (; focusedFrame; focusedFrame = focusedFrame->tree().parent()) {
+        if (focusedFrame->tree().parent() == currentFrame)
             return focusedFrame->ownerElement();
     }
     return 0;
index fec3d52..185f55a 100644 (file)
@@ -1591,7 +1591,7 @@ bool FrameSelection::contains(const LayoutPoint& point)
 void FrameSelection::selectFrameElementInParentIfFullySelected()
 {
     // Find the parent frame; if there is none, then we have nothing to do.
-    Frame* parent = m_frame->tree()->parent();
+    Frame* parent = m_frame->tree().parent();
     if (!parent)
         return;
     Page* page = m_frame->page();
index 9e6012b..3a3eb8d 100644 (file)
@@ -78,7 +78,7 @@ CachedFrameBase::CachedFrameBase(Frame* frame)
     , m_view(frame->view())
     , m_mousePressNode(frame->eventHandler().mousePressNode())
     , m_url(frame->document()->url())
-    , m_isMainFrame(!frame->tree()->parent())
+    , m_isMainFrame(!frame->tree().parent())
 #if USE(ACCELERATED_COMPOSITING)
     , m_isComposited(frame->view()->hasCompositedContent())
 #endif
@@ -127,7 +127,7 @@ void CachedFrameBase::restore()
 
     // Reconstruct the FrameTree
     for (unsigned i = 0; i < m_childFrames.size(); ++i)
-        frame.tree()->appendChild(&m_childFrames[i]->view()->frame());
+        frame.tree().appendChild(&m_childFrames[i]->view()->frame());
 
     // Open the child CachedFrames in their respective FrameLoaders.
     for (unsigned i = 0; i < m_childFrames.size(); ++i)
@@ -169,7 +169,7 @@ CachedFrame::CachedFrame(Frame* frame)
     frame->loader().stopLoading(UnloadEventPolicyUnloadAndPageHide);
 
     // Create the CachedFrames for all Frames in the FrameTree.
-    for (Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling())
         m_childFrames.append(CachedFrame::create(child));
 
     // Active DOM objects must be suspended before we cache the frame script data,
@@ -198,7 +198,7 @@ CachedFrame::CachedFrame(Frame* frame)
     // 1 - We reuse the main frame, so when it navigates to a new page load it needs to start with a blank FrameTree.
     // 2 - It's much easier to destroy a CachedFrame while it resides in the PageCache if it is disconnected from its parent.
     for (unsigned i = 0; i < m_childFrames.size(); ++i)
-        frame->tree()->removeChild(&m_childFrames[i]->view()->frame());
+        frame->tree().removeChild(&m_childFrames[i]->view()->frame());
 
     if (!m_isMainFrame)
         frame->page()->decrementSubframeCount();
index 61dbea4..37cf9fa 100644 (file)
@@ -89,7 +89,7 @@ void CachedPage::restore(Page* page)
         element->updateFocusAppearance(true);
 
     if (m_needStyleRecalcForVisitedLinks) {
-        for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
+        for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext())
             frame->document()->visitedLinkState().invalidateStyleForAllLinks();
     }
 
index 973b02b..9c512c9 100644 (file)
@@ -175,7 +175,7 @@ static unsigned logCanCacheFrameDecision(Frame* frame, int indentLevel)
     }
     HistogramSupport::histogramEnumeration("PageCache.FrameRejectReasonCount", reasonCount, 1 + NumberOfReasonsFramesCannotBeInPageCache);
 
-    for (Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling())
         rejectReasons |= logCanCacheFrameDecision(child, indentLevel + 1);
     
     PCLOG(rejectReasons ? " Frame CANNOT be cached" : " Frame CAN be cached");
@@ -303,7 +303,7 @@ PageCache::PageCache()
     
 bool PageCache::canCachePageContainingThisFrame(Frame* frame)
 {
-    for (Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+    for (Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
         if (!canCachePageContainingThisFrame(child))
             return false;
     }
index 95a5a99..e8e9e9c 100644 (file)
@@ -153,7 +153,7 @@ bool HTMLDocument::hasFocus()
     if (!page->focusController().isActive())
         return false;
     if (Frame* focusedFrame = page->focusController().focusedFrame()) {
-        if (focusedFrame->tree()->isDescendantOf(frame()))
+        if (focusedFrame->tree().isDescendantOf(frame()))
             return true;
     }
     return false;
index 2b3ea72..d70ee6f 100644 (file)
@@ -451,7 +451,7 @@ void HTMLPlugInImageElement::restartSimilarPlugIns()
     if (!document()->page())
         return;
 
-    for (Frame* frame = document()->page()->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = document()->page()->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (!frame->loader().subframeLoader()->containsPlugins())
             continue;
         
index 9736b95..a4d15fb 100644 (file)
@@ -109,7 +109,7 @@ void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString*, RefPtr
     result = TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest>::create();
 
     Frame* mainFrame = m_pageAgent->mainFrame();
-    for (Frame* frame = mainFrame; frame; frame = frame->tree()->traverseNext(mainFrame)) {
+    for (Frame* frame = mainFrame; frame; frame = frame->tree().traverseNext(mainFrame)) {
         DocumentLoader* documentLoader = frame->loader().documentLoader();
         if (!documentLoader)
             continue;
index 22cf3ed..6affe69 100644 (file)
@@ -266,7 +266,7 @@ void InspectorCanvasAgent::findFramesWithUninstrumentedCanvases()
 {
     m_framesWithUninstrumentedCanvases.clear();
 
-    for (Frame* frame = m_pageAgent->page()->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_pageAgent->page()->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (!frame->document())
             continue;
 
@@ -313,7 +313,7 @@ void InspectorCanvasAgent::frameNavigated(Frame* frame)
                 String frameId = m_pageAgent->frameId(frame);
                 m_frontend->traceLogsRemoved(&frameId, 0);
             }
-            frame = frame->tree()->traverseNext();
+            frame = frame->tree().traverseNext();
         }
     }
 }
index 9ef2e4d..bd3cb1a 100644 (file)
@@ -279,7 +279,7 @@ void InspectorDOMAgent::restore()
 Vector<Document*> InspectorDOMAgent::documents()
 {
     Vector<Document*> result;
-    for (Frame* frame = m_document->frame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_document->frame(); frame; frame = frame->tree().traverseNext()) {
         Document* document = frame->document();
         if (!document)
             continue;
index 9b8077d..6e288ad 100644 (file)
@@ -728,7 +728,7 @@ bool InspectorFileSystemAgent::assertEnabled(ErrorString* error)
 
 ScriptExecutionContext* InspectorFileSystemAgent::assertScriptExecutionContextForOrigin(ErrorString* error, SecurityOrigin* origin)
 {
-    for (Frame* frame = m_pageAgent->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_pageAgent->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->document() && frame->document()->securityOrigin()->isSameSchemeHostPort(origin))
             return frame->document();
     }
index 3eb01f5..a98f9a6 100644 (file)
@@ -583,7 +583,7 @@ void InspectorPageAgent::getCookies(ErrorString*, RefPtr<TypeBuilder::Array<Type
     // always return the same true/false value.
     bool rawCookiesImplemented = false;
 
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext(mainFrame())) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext(mainFrame())) {
         Document* document = frame->document();
         Vector<KURL> allURLs = allResourcesURLsForFrame(frame);
         for (Vector<KURL>::const_iterator it = allURLs.begin(); it != allURLs.end(); ++it) {
@@ -618,7 +618,7 @@ void InspectorPageAgent::getCookies(ErrorString*, RefPtr<TypeBuilder::Array<Type
 void InspectorPageAgent::deleteCookie(ErrorString*, const String& cookieName, const String& url)
 {
     KURL parsedURL(ParsedURLString, url);
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext(m_page->mainFrame()))
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext(m_page->mainFrame()))
         WebCore::deleteCookie(frame->document(), parsedURL, cookieName);
 }
 
@@ -700,7 +700,7 @@ void InspectorPageAgent::searchInResources(ErrorString*, const String& text, con
     bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false;
     RegularExpression regex = ContentSearchUtils::createSearchRegex(text, caseSensitive, isRegex);
 
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext(m_page->mainFrame())) {
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext(m_page->mainFrame())) {
         String content;
         Vector<CachedResource*> allResources = cachedResourcesForFrame(frame);
         for (Vector<CachedResource*>::const_iterator it = allResources.begin(); it != allResources.end(); ++it) {
@@ -961,7 +961,7 @@ String InspectorPageAgent::loaderId(DocumentLoader* loader)
 
 Frame* InspectorPageAgent::findFrameWithSecurityOrigin(const String& originRawString)
 {
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         RefPtr<SecurityOrigin> documentOrigin = frame->document()->securityOrigin();
         if (documentOrigin->toRawString() == originRawString)
             return frame;
@@ -1102,8 +1102,8 @@ PassRefPtr<TypeBuilder::Page::Frame> InspectorPageAgent::buildObjectForFrame(Fra
         .setUrl(frame->document()->url().string())
         .setMimeType(frame->loader().documentLoader()->responseMIMEType())
         .setSecurityOrigin(frame->document()->securityOrigin()->toRawString());
-    if (frame->tree()->parent())
-        frameObject->setParentId(frameId(frame->tree()->parent()));
+    if (frame->tree().parent())
+        frameObject->setParentId(frameId(frame->tree().parent()));
     if (frame->ownerElement()) {
         String name = frame->ownerElement()->getNameAttribute();
         if (name.isEmpty())
@@ -1141,7 +1141,7 @@ PassRefPtr<TypeBuilder::Page::FrameResourceTree> InspectorPageAgent::buildObject
     }
 
     RefPtr<TypeBuilder::Array<TypeBuilder::Page::FrameResourceTree> > childrenArray;
-    for (Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+    for (Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
         if (!childrenArray) {
             childrenArray = TypeBuilder::Array<TypeBuilder::Page::FrameResourceTree>::create();
             result->setChildFrames(childrenArray);
index 35a3539..c7db294 100644 (file)
@@ -160,7 +160,7 @@ void PageRuntimeAgent::unmuteConsole()
 void PageRuntimeAgent::reportExecutionContextCreation()
 {
     Vector<std::pair<ScriptState*, SecurityOrigin*> > isolatedContexts;
-    for (Frame* frame = m_inspectedPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_inspectedPage->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (!frame->script().canExecuteScripts(NotAboutToExecuteScript))
             continue;
         String frameId = m_pageAgent->frameId(frame);
index 9649cc6..8df25ae 100644 (file)
@@ -504,7 +504,7 @@ void DocumentLoader::willSendRequest(ResourceRequest& newRequest, const Resource
     if (newRequest.cachePolicy() == UseProtocolCachePolicy && isPostOrRedirectAfterPost(newRequest, redirectResponse))
         newRequest.setCachePolicy(ReloadIgnoringCacheData);
 
-    Frame* top = m_frame->tree()->top();
+    Frame* top = m_frame->tree().top();
     if (top != m_frame) {
         if (!frameLoader()->mixedContentChecker()->canDisplayInsecureContent(top->document()->securityOrigin(), newRequest.url())) {
             cancelMainResourceLoad(frameLoader()->cancelledError(newRequest));
@@ -1047,7 +1047,7 @@ PassRefPtr<ArchiveResource> DocumentLoader::mainResource() const
     if (!data)
         data = SharedBuffer::create();
         
-    return ArchiveResource::create(data, r.url(), r.mimeType(), r.textEncodingName(), frame()->tree()->uniqueName());
+    return ArchiveResource::create(data, r.url(), r.mimeType(), r.textEncodingName(), frame()->tree().uniqueName());
 }
 
 PassRefPtr<ArchiveResource> DocumentLoader::subresource(const KURL& url) const
index 192fe11..4631c78 100644 (file)
@@ -172,7 +172,7 @@ TextResourceDecoder* DocumentWriter::createDecoderIfNeeded()
         m_decoder = TextResourceDecoder::create(m_mimeType,
             m_frame->settings().defaultTextEncodingName(),
             m_frame->settings().usesEncodingDetector());
-        Frame* parentFrame = m_frame->tree()->parent();
+        Frame* parentFrame = m_frame->tree().parent();
         // Set the hint encoding to the parent frame encoding only if
         // the parent and the current frames share the security origin.
         // We impose this condition because somebody can make a child frame
index f1167ca..28d0b62 100644 (file)
@@ -381,7 +381,7 @@ void FrameLoader::submitForm(PassRefPtr<FormSubmission> submission)
     // than replacing this frame's content, so this check is flawed. On the other hand, the check is hardly
     // needed any more now that we reset m_submittedFormURL on each mouse or key down event.
 
-    if (m_frame.tree()->isDescendantOf(targetFrame)) {
+    if (m_frame.tree().isDescendantOf(targetFrame)) {
         if (m_submittedFormURL == submission->requestURL())
             return;
         m_submittedFormURL = submission->requestURL();
@@ -739,7 +739,7 @@ void FrameLoader::loadDone()
 
 bool FrameLoader::allChildrenAreComplete() const
 {
-    for (Frame* child = m_frame.tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+    for (Frame* child = m_frame.tree().firstChild(); child; child = child->tree().nextSibling()) {
         if (!child->loader().m_isComplete)
             return false;
     }
@@ -748,7 +748,7 @@ bool FrameLoader::allChildrenAreComplete() const
 
 bool FrameLoader::allAncestorsAreComplete() const
 {
-    for (Frame* ancestor = &m_frame; ancestor; ancestor = ancestor->tree()->parent()) {
+    for (Frame* ancestor = &m_frame; ancestor; ancestor = ancestor->tree().parent()) {
         if (!ancestor->loader().m_isComplete)
             return false;
     }
@@ -853,7 +853,7 @@ void FrameLoader::loadURLIntoChildFrame(const KURL& url, const String& referer,
     ASSERT(childFrame);
 
 #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
-    RefPtr<Archive> subframeArchive = activeDocumentLoader()->popArchiveForSubframe(childFrame->tree()->uniqueName(), url);    
+    RefPtr<Archive> subframeArchive = activeDocumentLoader()->popArchiveForSubframe(childFrame->tree().uniqueName(), url);
     if (subframeArchive) {
         childFrame->loader().loadArchive(subframeArchive.release());
         return;
@@ -865,7 +865,7 @@ void FrameLoader::loadURLIntoChildFrame(const KURL& url, const String& referer,
     // of this child frame with whatever was there at that point.
     if (parentItem && parentItem->children().size() && isBackForwardLoadType(loadType()) 
         && !m_frame.document()->loadEventFinished()) {
-        HistoryItem* childItem = parentItem->childItemWithTarget(childFrame->tree()->uniqueName());
+        HistoryItem* childItem = parentItem->childItemWithTarget(childFrame->tree().uniqueName());
         if (childItem) {
             childFrame->loader().m_requestedHistoryItem = childItem;
             childFrame->loader().loadDifferentDocumentItem(childItem, loadType(), MayAttemptCacheOnlyLoadForFormSubmissionItem);
@@ -938,7 +938,7 @@ String FrameLoader::outgoingReferrer() const
     // for why we walk the parent chain for srcdoc documents.
     Frame* frame = &m_frame;
     while (frame->document()->isSrcdocDocument()) {
-        frame = frame->tree()->parent();
+        frame = frame->tree().parent();
         // Srcdoc documents cannot be top-level documents, by definition,
         // because they need to be contained in iframes with the srcdoc.
         ASSERT(frame);
@@ -1003,15 +1003,15 @@ void FrameLoader::resetMultipleFormSubmissionProtection()
 
 void FrameLoader::updateFirstPartyForCookies()
 {
-    if (m_frame.tree()->parent())
-        setFirstPartyForCookies(m_frame.tree()->parent()->document()->firstPartyForCookies());
+    if (m_frame.tree().parent())
+        setFirstPartyForCookies(m_frame.tree().parent()->document()->firstPartyForCookies());
     else
         setFirstPartyForCookies(m_frame.document()->url());
 }
 
 void FrameLoader::setFirstPartyForCookies(const KURL& url)
 {
-    for (Frame* frame = &m_frame; frame; frame = frame->tree()->traverseNext(&m_frame))
+    for (Frame* frame = &m_frame; frame; frame = frame->tree().traverseNext(&m_frame))
         frame->document()->setFirstPartyForCookies(url);
 }
 
@@ -1091,10 +1091,10 @@ void FrameLoader::completed()
 {
     RefPtr<Frame> protect(&m_frame);
 
-    for (Frame* descendant = m_frame.tree()->traverseNext(&m_frame); descendant; descendant = descendant->tree()->traverseNext(&m_frame))
+    for (Frame* descendant = m_frame.tree().traverseNext(&m_frame); descendant; descendant = descendant->tree().traverseNext(&m_frame))
         descendant->navigationScheduler().startTimer();
 
-    if (Frame* parent = m_frame.tree()->parent())
+    if (Frame* parent = m_frame.tree().parent())
         parent->loader().checkCompleted();
 
     if (m_frame.view())
@@ -1106,7 +1106,7 @@ void FrameLoader::started()
 {
     if (m_frame.page())
         m_activityAssertion = m_frame.page()->createActivityToken();
-    for (Frame* frame = &m_frame; frame; frame = frame->tree()->parent())
+    for (Frame* frame = &m_frame; frame; frame = frame->tree().parent())
         frame->loader().m_isComplete = false;
 }
 
@@ -1213,8 +1213,8 @@ void FrameLoader::loadURL(const KURL& newURL, const String& referrer, const Stri
         addHTTPOriginIfNeeded(request, referrerOrigin->toString());
     }
 #if ENABLE(CACHE_PARTITIONING)
-    if (m_frame.tree()->top() != &m_frame)
-        request.setCachePartition(m_frame.tree()->top()->document()->securityOrigin()->cachePartition());
+    if (m_frame.tree().top() != &m_frame)
+        request.setCachePartition(m_frame.tree().top()->document()->securityOrigin()->cachePartition());
 #endif
     addExtraFieldsToRequest(request, newLoadType, true);
     if (newLoadType == FrameLoadTypeReload || newLoadType == FrameLoadTypeReloadFromOrigin)
@@ -1396,7 +1396,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
         policyChecker()->checkNavigationPolicy(loader->request(), oldDocumentLoader.get(), formState,
             callContinueFragmentScrollAfterNavigationPolicy, this);
     } else {
-        if (Frame* parent = m_frame.tree()->parent())
+        if (Frame* parent = m_frame.tree().parent())
             loader->setOverrideEncoding(parent->loader().documentLoader()->overrideEncoding());
 
         policyChecker()->stopCheck();
@@ -1573,7 +1573,7 @@ void FrameLoader::stopAllLoaders(ClearProvisionalItemPolicy clearProvisionalItem
     if (clearProvisionalItemPolicy == ShouldClearProvisionalItem)
         history().setProvisionalItem(0);
 
-    for (RefPtr<Frame> child = m_frame.tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (RefPtr<Frame> child = m_frame.tree().firstChild(); child; child = child->tree().nextSibling())
         child->loader().stopAllLoaders(clearProvisionalItemPolicy);
     if (m_provisionalDocumentLoader)
         m_provisionalDocumentLoader->stopLoading();
@@ -1702,7 +1702,7 @@ void FrameLoader::commitProvisionalLoad()
     RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader;
     RefPtr<Frame> protect(&m_frame);
 
-    LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame.tree()->uniqueName().string().utf8().data(),
+    LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame.tree().uniqueName().string().utf8().data(),
         m_frame.document() ? m_frame.document()->url().stringCenterEllipsizedToLength().utf8().data() : "",
         pdl ? pdl->url().stringCenterEllipsizedToLength().utf8().data() : "<no provisional DocumentLoader>");
 
@@ -1711,7 +1711,7 @@ void FrameLoader::commitProvisionalLoad()
     // Check to see if we need to cache the page we are navigating away from into the back/forward cache.
     // We are doing this here because we know for sure that a new page is about to be loaded.
     HistoryItem* item = history().currentItem();
-    if (!m_frame.tree()->parent() && pageCache()->canCache(m_frame.page()) && !item->isInPageCache())
+    if (!m_frame.tree().parent() && pageCache()->canCache(m_frame.page()) && !item->isInPageCache())
         pageCache()->add(item, m_frame.page());
 
     if (m_loadType != FrameLoadTypeReplace)
@@ -1756,7 +1756,7 @@ void FrameLoader::commitProvisionalLoad()
         didOpenURL();
     }
 
-    LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame.tree()->uniqueName().string().utf8().data(),
+    LOG(Loading, "WebCoreLoading %s: Finished committing provisional load to URL %s", m_frame.tree().uniqueName().string().utf8().data(),
         m_frame.document() ? m_frame.document()->url().stringCenterEllipsizedToLength().utf8().data() : "");
 
     if (m_loadType == FrameLoadTypeStandard && m_documentLoader->isClientRedirect())
@@ -1946,7 +1946,7 @@ void FrameLoader::closeOldDataSources()
     // FIXME: Is it important for this traversal to be postorder instead of preorder?
     // 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())
+    for (Frame* child = m_frame.tree().firstChild(); child; child = child->tree().nextSibling())
         child->loader().closeOldDataSources();
     
     if (m_documentLoader)
@@ -1957,7 +1957,7 @@ void FrameLoader::closeOldDataSources()
 
 void FrameLoader::prepareForCachedPageRestore()
 {
-    ASSERT(!m_frame.tree()->parent());
+    ASSERT(!m_frame.tree().parent());
     ASSERT(m_frame.page());
     ASSERT(m_frame.page()->mainFrame() == &m_frame);
 
@@ -2044,7 +2044,7 @@ void FrameLoader::setReplacing()
 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()) {
+    for (Frame* child = m_frame.tree().lastChild(); child; child = child->tree().previousSibling()) {
         FrameLoader& childLoader = child->loader();
         DocumentLoader* documentLoader = childLoader.documentLoader();
         if (documentLoader && documentLoader->isLoadingInAPISense())
@@ -2077,7 +2077,7 @@ CachePolicy FrameLoader::subresourceCachePolicy() const
     if (m_loadType == FrameLoadTypeReloadFromOrigin)
         return CachePolicyReload;
 
-    if (Frame* parentFrame = m_frame.tree()->parent()) {
+    if (Frame* parentFrame = m_frame.tree().parent()) {
         CachePolicy parentCachePolicy = parentFrame->loader().subresourceCachePolicy();
         if (parentCachePolicy != CachePolicyVerify)
             return parentCachePolicy;
@@ -2320,8 +2320,8 @@ void FrameLoader::detachChildren()
 {
     typedef Vector<RefPtr<Frame> > FrameVector;
     FrameVector childrenToDetach;
-    childrenToDetach.reserveCapacity(m_frame.tree()->childCount());
-    for (Frame* child = m_frame.tree()->lastChild(); child; child = child->tree()->previousSibling())
+    childrenToDetach.reserveCapacity(m_frame.tree().childCount());
+    for (Frame* child = m_frame.tree().lastChild(); child; child = child->tree().previousSibling())
         childrenToDetach.append(child);
     FrameVector::iterator end = childrenToDetach.end();
     for (FrameVector::iterator it = childrenToDetach.begin(); it != end; ++it)
@@ -2330,7 +2330,7 @@ void FrameLoader::detachChildren()
 
 void FrameLoader::closeAndRemoveChild(Frame* child)
 {
-    child->tree()->detachFromParent();
+    child->tree().detachFromParent();
 
     child->setView(0);
     if (child->ownerElement() && child->page())
@@ -2338,7 +2338,7 @@ void FrameLoader::closeAndRemoveChild(Frame* child)
     child->willDetachPage();
     child->detachFromPage();
 
-    m_frame.tree()->removeChild(child);
+    m_frame.tree().removeChild(child);
 }
 
 // Called every time a resource is completely loaded or an error is received.
@@ -2352,7 +2352,7 @@ void FrameLoader::checkLoadComplete()
     // is currently needed in order to null out the previous history item for all frames.
     if (Page* page = m_frame.page()) {
         Vector<RefPtr<Frame>, 10> frames;
-        for (RefPtr<Frame> frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
+        for (RefPtr<Frame> frame = page->mainFrame(); frame; frame = frame->tree().traverseNext())
             frames.append(frame);
         // To process children before their parents, iterate the vector backwards.
         for (size_t i = frames.size(); i; --i)
@@ -2366,7 +2366,7 @@ int FrameLoader::numPendingOrLoadingRequests(bool recurse) const
         return m_frame.document()->cachedResourceLoader()->requestCount();
 
     int count = 0;
-    for (Frame* frame = &m_frame; frame; frame = frame->tree()->traverseNext(&m_frame))
+    for (Frame* frame = &m_frame; frame; frame = frame->tree().traverseNext(&m_frame))
         count += frame->document()->cachedResourceLoader()->requestCount();
     return count;
 }
@@ -2411,7 +2411,7 @@ void FrameLoader::detachFromParent()
 
     m_progressTracker.clear();
 
-    if (Frame* parent = m_frame.tree()->parent()) {
+    if (Frame* parent = m_frame.tree().parent()) {
         parent->loader().closeAndRemoveChild(&m_frame);
         parent->loader().scheduleCheckCompleted();
     } else {
@@ -2724,7 +2724,7 @@ bool FrameLoader::shouldClose()
     // Store all references to each subframe in advance since beforeunload's event handler may modify frame
     Vector<RefPtr<Frame> > targetFrames;
     targetFrames.append(&m_frame);
-    for (Frame* child = m_frame.tree()->firstChild(); child; child = child->tree()->traverseNext(&m_frame))
+    for (Frame* child = m_frame.tree().firstChild(); child; child = child->tree().traverseNext(&m_frame))
         targetFrames.append(child);
 
     bool shouldClose = false;
@@ -2733,7 +2733,7 @@ bool FrameLoader::shouldClose()
         size_t i;
 
         for (i = 0; i < targetFrames.size(); i++) {
-            if (!targetFrames[i]->tree()->isDescendantOf(&m_frame))
+            if (!targetFrames[i]->tree().isDescendantOf(&m_frame))
                 continue;
             if (!targetFrames[i]->loader().handleBeforeUnloadEvent(page->chrome(), this))
                 break;
@@ -2786,7 +2786,7 @@ bool FrameLoader::handleBeforeUnloadEvent(Chrome& chrome, FrameLoader* frameLoad
     // We should only display the beforeunload dialog for an iframe if its SecurityOrigin matches all
     // ancestor frame SecurityOrigins up through the navigating FrameLoader.
     if (frameLoaderBeingNavigated != this) {
-        Frame* parentFrame = m_frame.tree()->parent();
+        Frame* parentFrame = m_frame.tree().parent();
         while (parentFrame) {
             Document* parentDocument = parentFrame->document();
             if (!parentDocument)
@@ -2799,7 +2799,7 @@ bool FrameLoader::handleBeforeUnloadEvent(Chrome& chrome, FrameLoader* frameLoad
             if (&parentFrame->loader() == frameLoaderBeingNavigated)
                 break;
             
-            parentFrame = parentFrame->tree()->parent();
+            parentFrame = parentFrame->tree().parent();
         }
         
         // The navigatingFrameLoader should always be in our ancestory.
@@ -2903,7 +2903,7 @@ void FrameLoader::continueLoadAfterNewWindowPolicy(const ResourceRequest& reques
         return;
 
     if (frameName != "_blank")
-        mainFrame->tree()->setName(frameName);
+        mainFrame->tree().setName(frameName);
 
     mainFrame->page()->setOpenedByDOM();
     mainFrame->loader().m_client.dispatchShow();
@@ -2981,7 +2981,7 @@ bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con
 {
     FeatureObserver::observe(m_frame.document(), FeatureObserver::XFrameOptions);
 
-    Frame* topFrame = m_frame.tree()->top();
+    Frame* topFrame = m_frame.tree().top();
     if (&m_frame == topFrame)
         return false;
 
@@ -2993,7 +2993,7 @@ bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con
         RefPtr<SecurityOrigin> origin = SecurityOrigin::create(url);
         if (!origin->isSameSchemeHostPort(topFrame->document()->securityOrigin()))
             return true;
-        for (Frame* frame = m_frame.tree()->parent(); frame; frame = frame->tree()->parent()) {
+        for (Frame* frame = m_frame.tree().parent(); frame; frame = frame->tree().parent()) {
             if (!origin->isSameSchemeHostPort(frame->document()->securityOrigin())) {
                 FeatureObserver::observe(m_frame.document(), FeatureObserver::XFrameOptionsSameOriginWithBadAncestorChain);
                 break;
@@ -3068,7 +3068,7 @@ void FrameLoader::checkDidPerformFirstNavigation()
 
 Frame* FrameLoader::findFrameForNavigation(const AtomicString& name, Document* activeDocument)
 {
-    Frame* frame = m_frame.tree()->find(name);
+    Frame* frame = m_frame.tree().find(name);
 
     // From http://www.whatwg.org/specs/web-apps/current-work/#seamlessLinks:
     //
@@ -3080,7 +3080,7 @@ Frame* FrameLoader::findFrameForNavigation(const AtomicString& name, Document* a
     // browsing context flag set, and continue these steps as if that
     // browsing context was the one that was going to be navigated instead.
     if (frame == &m_frame && name != "_self" && m_frame.document()->shouldDisplaySeamlesslyWithParent()) {
-        for (Frame* ancestor = &m_frame; ancestor; ancestor = ancestor->tree()->parent()) {
+        for (Frame* ancestor = &m_frame; ancestor; ancestor = ancestor->tree().parent()) {
             if (!ancestor->document()->shouldDisplaySeamlesslyWithParent()) {
                 frame = ancestor;
                 break;
@@ -3289,7 +3289,7 @@ void FrameLoader::dispatchGlobalObjectAvailableInAllWorlds()
 SandboxFlags FrameLoader::effectiveSandboxFlags() const
 {
     SandboxFlags flags = m_forcedSandboxFlags;
-    if (Frame* parentFrame = m_frame.tree()->parent())
+    if (Frame* parentFrame = m_frame.tree().parent())
         flags |= parentFrame->document()->sandboxFlags();
     if (HTMLFrameOwnerElement* ownerElement = m_frame.ownerElement())
         flags |= ownerElement->sandboxFlags();
@@ -3431,7 +3431,7 @@ PassRefPtr<Frame> createWindow(Frame* openerFrame, Frame* lookupFrame, const Fra
     frame->loader().forceSandboxFlags(openerFrame->document()->sandboxFlags());
 
     if (request.frameName() != "_blank")
-        frame->tree()->setName(request.frameName());
+        frame->tree().setName(request.frameName());
 
     page->chrome().setToolbarsVisible(features.toolBarVisible || features.locationBarVisible);
     page->chrome().setStatusbarVisible(features.statusBarVisible);
index 7413d85..f7513db 100644 (file)
@@ -179,7 +179,7 @@ void HistoryController::saveDocumentState()
     ASSERT(document);
     
     if (item->isCurrentDocument(document) && document->attached()) {
-        LOG(Loading, "WebCoreLoading %s: saving form state to %p", m_frame.tree()->uniqueName().string().utf8().data(), item);
+        LOG(Loading, "WebCoreLoading %s: saving form state to %p", m_frame.tree().uniqueName().string().utf8().data(), item);
         item->setDocumentState(document->formElementsState());
     }
 }
@@ -188,7 +188,7 @@ void HistoryController::saveDocumentState()
 // history item.
 void HistoryController::saveDocumentAndScrollState()
 {
-    for (Frame* frame = &m_frame; frame; frame = frame->tree()->traverseNext(&m_frame)) {
+    for (Frame* frame = &m_frame; frame; frame = frame->tree().traverseNext(&m_frame)) {
         frame->loader().history().saveDocumentState();
         frame->loader().history().saveScrollPositionAndViewStateToItem(frame->loader().history().currentItem());
     }
@@ -218,7 +218,7 @@ void HistoryController::restoreDocumentState()
     if (m_frame.loader().documentLoader()->isClientRedirect())
         return;
 
-    LOG(Loading, "WebCoreLoading %s: restoring form state from %p", m_frame.tree()->uniqueName().string().utf8().data(), m_currentItem.get());
+    LOG(Loading, "WebCoreLoading %s: restoring form state from %p", m_frame.tree().uniqueName().string().utf8().data(), m_currentItem.get());
     m_frame.document()->setStateForNewFormElements(m_currentItem->documentState());
 }
 
@@ -257,7 +257,7 @@ bool HistoryController::shouldStopLoadingForHistoryItem(HistoryItem* targetItem)
 // This includes recursion to handle loading into framesets properly
 void HistoryController::goToItem(HistoryItem* targetItem, FrameLoadType type)
 {
-    ASSERT(!m_frame.tree()->parent());
+    ASSERT(!m_frame.tree().parent());
     
     // shouldGoToHistoryItem is a private delegate method. This is needed to fix:
     // <rdar://problem/3951283> can view pages from the back/forward cache that should be disallowed by Parental Controls
@@ -387,7 +387,7 @@ void HistoryController::updateForRedirectWithLockedBackForwardList()
     const KURL& historyURL = m_frame.loader().documentLoader()->urlForHistory();
 
     if (m_frame.loader().documentLoader()->isClientRedirect()) {
-        if (!m_currentItem && !m_frame.tree()->parent()) {
+        if (!m_currentItem && !m_frame.tree().parent()) {
             if (!historyURL.isEmpty()) {
                 updateBackForwardListClippedAtTarget(true);
                 if (!needPrivacy) {
@@ -403,7 +403,7 @@ void HistoryController::updateForRedirectWithLockedBackForwardList()
         // The client redirect replaces the current history item.
         updateCurrentItem();
     } else {
-        Frame* parentFrame = m_frame.tree()->parent();
+        Frame* parentFrame = m_frame.tree().parent();
         if (parentFrame && parentFrame->loader().history().currentItem())
             parentFrame->loader().history().currentItem()->setChildItem(createItem());
     }
@@ -514,7 +514,7 @@ void HistoryController::recursiveUpdateForCommit()
     }
 
     // Iterate over the rest of the tree
-    for (Frame* child = m_frame.tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (Frame* child = m_frame.tree().firstChild(); child; child = child->tree().nextSibling())
         child->loader().history().recursiveUpdateForCommit();
 }
 
@@ -558,7 +558,7 @@ void HistoryController::recursiveUpdateForSameDocumentNavigation()
     m_provisionalItem = 0;
 
     // Iterate over the rest of the tree.
-    for (Frame* child = m_frame.tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (Frame* child = m_frame.tree().firstChild(); child; child = child->tree().nextSibling())
         child->loader().history().recursiveUpdateForSameDocumentNavigation();
 }
 
@@ -626,12 +626,12 @@ void HistoryController::initializeItem(HistoryItem* item)
     if (originalURL.isEmpty())
         originalURL = blankURL();
     
-    Frame* parentFrame = m_frame.tree()->parent();
-    String parent = parentFrame ? parentFrame->tree()->uniqueName() : "";
+    Frame* parentFrame = m_frame.tree().parent();
+    String parent = parentFrame ? parentFrame->tree().uniqueName() : "";
     StringWithDirection title = documentLoader->title();
 
     item->setURL(url);
-    item->setTarget(m_frame.tree()->uniqueName());
+    item->setTarget(m_frame.tree().uniqueName());
     item->setParent(parent);
     // FIXME: should store title directionality in history as well.
     item->setTitle(title.string());
@@ -677,7 +677,7 @@ PassRefPtr<HistoryItem> HistoryController::createItemTree(Frame& targetFrame, bo
             bfItem->setDocumentSequenceNumber(m_previousItem->documentSequenceNumber());
         }
 
-        for (Frame* child = m_frame.tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+        for (Frame* child = m_frame.tree().firstChild(); child; child = child->tree().nextSibling()) {
             FrameLoader& childLoader = child->loader();
             bool hasChildLoaded = childLoader.frameHasLoaded();
 
@@ -715,7 +715,7 @@ void HistoryController::recursiveSetProvisionalItem(HistoryItem* item, HistoryIt
             String childFrameName = childItems[i]->target();
             HistoryItem* fromChildItem = fromItem->childItemWithTarget(childFrameName);
             ASSERT(fromChildItem);
-            Frame* childFrame = m_frame.tree()->child(childFrameName);
+            Frame* childFrame = m_frame.tree().child(childFrameName);
             ASSERT(childFrame);
             childFrame->loader().history().recursiveSetProvisionalItem(childItems[i].get(), fromChildItem, type);
         }
@@ -737,7 +737,7 @@ void HistoryController::recursiveGoToItem(HistoryItem* item, HistoryItem* fromIt
             String childFrameName = childItems[i]->target();
             HistoryItem* fromChildItem = fromItem->childItemWithTarget(childFrameName);
             ASSERT(fromChildItem);
-            Frame* childFrame = m_frame.tree()->child(childFrameName);
+            Frame* childFrame = m_frame.tree().child(childFrameName);
             ASSERT(childFrame);
             childFrame->loader().history().recursiveGoToItem(childItems[i].get(), fromChildItem, type);
         }
@@ -766,16 +766,16 @@ bool HistoryController::itemsAreClones(HistoryItem* item1, HistoryItem* item2) c
 // Helper method that determines whether the current frame tree matches given history item's.
 bool HistoryController::currentFramesMatchItem(HistoryItem* item) const
 {
-    if ((!m_frame.tree()->uniqueName().isEmpty() || !item->target().isEmpty()) && m_frame.tree()->uniqueName() != item->target())
+    if ((!m_frame.tree().uniqueName().isEmpty() || !item->target().isEmpty()) && m_frame.tree().uniqueName() != item->target())
         return false;
         
     const HistoryItemVector& childItems = item->children();
-    if (childItems.size() != m_frame.tree()->childCount())
+    if (childItems.size() != m_frame.tree().childCount())
         return false;
     
     unsigned size = childItems.size();
     for (unsigned i = 0; i < size; ++i) {
-        if (!m_frame.tree()->child(childItems[i]->target()))
+        if (!m_frame.tree().child(childItems[i]->target()))
             return false;
     }
     
index 8d08401..ce2fca1 100644 (file)
@@ -328,7 +328,7 @@ bool NavigationScheduler::mustLockBackForwardList(Frame* targetFrame)
     // Navigation of a subframe during loading of an ancestor frame does not create a new back/forward item.
     // The definition of "during load" is any time before all handlers for the load event have been run.
     // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motivation for this.
-    for (Frame* ancestor = targetFrame->tree()->parent(); ancestor; ancestor = ancestor->tree()->parent()) {
+    for (Frame* ancestor = targetFrame->tree().parent(); ancestor; ancestor = ancestor->tree().parent()) {
         Document* document = ancestor->document();
         if (!ancestor->loader().isComplete() || (document && document->processingLoadEvent()))
             return true;
@@ -378,7 +378,7 @@ void NavigationScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> subm
     // See https://bugs.webkit.org/show_bug.cgi?id=32383 for the original motivation for this.
     bool lockBackForwardList = mustLockBackForwardList(m_frame)
         || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript
-            && m_frame->tree()->parent() && !ScriptController::processingUserGesture());
+            && m_frame->tree().parent() && !ScriptController::processingUserGesture());
 
     schedule(adoptPtr(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad)));
 }
index 178d52e..0b99a43 100644 (file)
@@ -121,7 +121,7 @@ void ProgressTracker::reset()
 
 void ProgressTracker::progressStarted(Frame* frame)
 {
-    LOG(Progress, "Progress started (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree()->uniqueName().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
+    LOG(Progress, "Progress started (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree().uniqueName().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
 
     frame->loader().client().willChangeEstimatedProgress();
     
@@ -143,7 +143,7 @@ void ProgressTracker::progressStarted(Frame* frame)
 
 void ProgressTracker::progressCompleted(Frame* frame)
 {
-    LOG(Progress, "Progress completed (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree()->uniqueName().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
+    LOG(Progress, "Progress completed (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree().uniqueName().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
     
     if (m_numProgressTrackedFrames <= 0)
         return;
@@ -288,7 +288,7 @@ bool ProgressTracker::isMainLoadProgressing() const
     if (!m_originatingProgressFrame)
         return false;
     // See if the load originated from a subframe.
-    if (m_originatingProgressFrame->tree()->parent())
+    if (m_originatingProgressFrame->tree().parent())
         return false;
     return m_progressValue && m_progressValue < finalProgressValue && m_heartbeatsWithNoProgress < loadStalledHeartbeatCount;
 }
index 13952d8..83df60b 100644 (file)
@@ -141,7 +141,7 @@ void ApplicationCacheGroup::selectCache(Frame* frame, const KURL& passedManifest
     if (!frame->settings().offlineWebApplicationCacheEnabled())
         return;
 
-    if (!frame->document()->securityOrigin()->canAccessApplicationCache(frame->tree()->top()->document()->securityOrigin()))
+    if (!frame->document()->securityOrigin()->canAccessApplicationCache(frame->tree().top()->document()->securityOrigin()))
         return;
     
     DocumentLoader* documentLoader = frame->loader().documentLoader();
@@ -217,7 +217,7 @@ void ApplicationCacheGroup::selectCacheWithoutManifestURL(Frame* frame)
     if (!frame->settings().offlineWebApplicationCacheEnabled())
         return;
 
-    if (!frame->document()->securityOrigin()->canAccessApplicationCache(frame->tree()->top()->document()->securityOrigin()))
+    if (!frame->document()->securityOrigin()->canAccessApplicationCache(frame->tree().top()->document()->securityOrigin()))
         return;
 
     DocumentLoader* documentLoader = frame->loader().documentLoader();
index 0c41955..56b063c 100644 (file)
@@ -461,9 +461,9 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(Frame* frame)
         
     Vector<PassRefPtr<LegacyWebArchive> > subframeArchives;
     
-    unsigned children = frame->tree()->childCount();
+    unsigned children = frame->tree().childCount();
     for (unsigned i = 0; i < children; ++i) {
-        RefPtr<LegacyWebArchive> childFrameArchive = create(frame->tree()->child(i));
+        RefPtr<LegacyWebArchive> childFrameArchive = create(frame->tree().child(i));
         if (childFrameArchive)
             subframeArchives.append(childFrameArchive.release());
     }
@@ -511,7 +511,7 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString
     if (responseURL.isNull())
         responseURL = KURL(ParsedURLString, emptyString());
         
-    PassRefPtr<ArchiveResource> mainResource = ArchiveResource::create(utf8Buffer(markupString), responseURL, response.mimeType(), "UTF-8", frame->tree()->uniqueName());
+    RefPtr<ArchiveResource> mainResource = ArchiveResource::create(utf8Buffer(markupString), responseURL, response.mimeType(), "UTF-8", frame->tree().uniqueName());
 
     Vector<PassRefPtr<LegacyWebArchive> > subframeArchives;
     Vector<PassRefPtr<ArchiveResource> > subresources;
@@ -531,7 +531,7 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString
             if (subframeArchive)
                 subframeArchives.append(subframeArchive);
             else
-                LOG_ERROR("Unabled to archive subframe %s", childFrame->tree()->uniqueName().string().utf8().data());
+                LOG_ERROR("Unabled to archive subframe %s", childFrame->tree().uniqueName().string().utf8().data());
         } else {
             ListHashSet<KURL> subresourceURLs;
             node->getSubresourceURLs(subresourceURLs);
@@ -582,7 +582,7 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString
         }
     }
 
-    return create(mainResource, subresources, subframeArchives);
+    return create(mainResource.release(), subresources, subframeArchives);
 }
 
 PassRefPtr<LegacyWebArchive> LegacyWebArchive::createFromSelection(Frame* frame)
index c4c5770..18348fa 100644 (file)
@@ -286,7 +286,7 @@ bool CachedResourceLoader::checkInsecureContent(CachedResource::Type type, const
     case CachedResource::FontResource: {
         // These resources can corrupt only the frame's pixels.
         if (Frame* f = frame()) {
-            Frame* top = f->tree()->top();
+            Frame* top = f->tree().top();
             if (!top->loader().mixedContentChecker()->canDisplayInsecureContent(top->document()->securityOrigin(), url))
                 return false;
         }
index 42f80bc..bc7b9c5 100644 (file)
@@ -82,7 +82,7 @@ IconURL IconController::iconURL(IconType iconType) const
 IconURLs IconController::urlsForTypes(int iconTypesMask)
 {
     IconURLs iconURLs;
-    if (m_frame->tree() && m_frame->tree()->parent())
+    if (m_frame->tree().parent())
         return iconURLs;
         
     if (iconTypesMask & Favicon && !appendToIconURLs(Favicon, &iconURLs))
@@ -136,7 +136,7 @@ void IconController::startLoader()
     if (!iconDatabase().isEnabled())
         return;
 
-    ASSERT(!m_frame->tree()->parent());
+    ASSERT(!m_frame->tree().parent());
     if (!documentCanHaveIcon(m_frame->document()->url()))
         return;
 
index cbfb15f..14899ea 100644 (file)
@@ -212,7 +212,7 @@ bool Chrome::canRunModal() const
 
 static bool canRunModalIfDuringPageDismissal(Page* page, ChromeClient::DialogType dialog, const String& message)
 {
-    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         FrameLoader::PageDismissalType dismissal = frame->loader().pageDismissalEventBeingDispatched();
         if (dismissal != FrameLoader::NoDismissal)
             return page->chrome().client().shouldRunModalDialogDuringPageDismissal(dialog, message, dismissal);
@@ -542,7 +542,7 @@ void Chrome::windowScreenDidChange(PlatformDisplayID displayID)
 
     m_displayID = displayID;
 
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->document())
             frame->document()->windowScreenDidChange(displayID);
     }
index 8f5aa7c..c02e775 100644 (file)
@@ -1253,7 +1253,7 @@ unsigned DOMWindow::length() const
     if (!isCurrentlyDisplayedInFrame())
         return 0;
 
-    return m_frame->tree()->scopedChildCount();
+    return m_frame->tree().scopedChildCount();
 }
 
 String DOMWindow::name() const
@@ -1261,7 +1261,7 @@ String DOMWindow::name() const
     if (!m_frame)
         return String();
 
-    return m_frame->tree()->name();
+    return m_frame->tree().name();
 }
 
 void DOMWindow::setName(const String& string)
@@ -1269,7 +1269,7 @@ void DOMWindow::setName(const String& string)
     if (!m_frame)
         return;
 
-    m_frame->tree()->setName(string);
+    m_frame->tree().setName(string);
     m_frame->loader().client().didChangeName(string);
 }
 
@@ -1328,7 +1328,7 @@ DOMWindow* DOMWindow::parent() const
     if (!m_frame)
         return 0;
 
-    Frame* parent = m_frame->tree()->parent();
+    Frame* parent = m_frame->tree().parent();
     if (parent)
         return parent->document()->domWindow();
 
@@ -1344,7 +1344,7 @@ DOMWindow* DOMWindow::top() const
     if (!page)
         return 0;
 
-    return m_frame->tree()->top()->document()->domWindow();
+    return m_frame->tree().top()->document()->domWindow();
 }
 
 Document* DOMWindow::document() const
@@ -1954,7 +1954,7 @@ PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicStrin
     if (!firstWindow->allowPopUp()) {
         // Because FrameTree::find() returns true for empty strings, we must check for empty frame names.
         // Otherwise, illegitimate window.open() calls with no name will pass right through the popup blocker.
-        if (frameName.isEmpty() || !m_frame->tree()->find(frameName))
+        if (frameName.isEmpty() || !m_frame->tree().find(frameName))
             return 0;
     }
 
@@ -1962,9 +1962,9 @@ PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicStrin
     // In those cases, we schedule a location change right now and return early.
     Frame* targetFrame = 0;
     if (frameName == "_top")
-        targetFrame = m_frame->tree()->top();
+        targetFrame = m_frame->tree().top();
     else if (frameName == "_parent") {
-        if (Frame* parent = m_frame->tree()->parent())
+        if (Frame* parent = m_frame->tree().parent())
             targetFrame = parent;
         else
             targetFrame = m_frame;
index 45dfbee..9b2cf6c 100644 (file)
@@ -1132,7 +1132,7 @@ bool EventHandler::scrollRecursively(ScrollDirection direction, ScrollGranularit
     FrameView* view = frame->view();
     if (view && view->scroll(direction, granularity))
         return true;
-    frame = frame->tree()->parent();
+    frame = frame->tree().parent();
     if (!frame)
         return false;
     return frame->eventHandler().scrollRecursively(direction, granularity, m_frame->ownerElement());
@@ -1160,7 +1160,7 @@ bool EventHandler::logicalScrollRecursively(ScrollLogicalDirection direction, Sc
     if (scrolled)
         return true;
     
-    frame = frame->tree()->parent();
+    frame = frame->tree().parent();
     if (!frame)
         return false;
 
@@ -1804,7 +1804,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
     RefPtr<Frame> newSubframe = m_capturingMouseEventsNode.get() ? subframeForTargetNode(m_capturingMouseEventsNode.get()) : subframeForHitTestResult(mev);
  
     // We want mouseouts to happen first, from the inside out.  First send a move event to the last subframe so that it will fire mouseouts.
-    if (m_lastMouseMoveEventSubframe && m_lastMouseMoveEventSubframe->tree()->isDescendantOf(m_frame) && m_lastMouseMoveEventSubframe != newSubframe)
+    if (m_lastMouseMoveEventSubframe && m_lastMouseMoveEventSubframe->tree().isDescendantOf(m_frame) && m_lastMouseMoveEventSubframe != newSubframe)
         passMouseMoveEventToSubframe(mev, m_lastMouseMoveEventSubframe.get());
 
     if (newSubframe) {
index 6f60d6b..1886dbd 100644 (file)
@@ -687,7 +687,7 @@ void FocusController::setContainingWindowIsVisible(bool containingWindowIsVisibl
 
     contentAreaDidShowOrHide(view, containingWindowIsVisible);
 
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         FrameView* frameView = frame->view();
         if (!frameView)
             continue;
index 1446950..319caf3 100644 (file)
@@ -136,7 +136,7 @@ static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement)
 
 static inline float parentPageZoomFactor(Frame* frame)
 {
-    Frame* parent = frame->tree()->parent();
+    Frame* parent = frame->tree().parent();
     if (!parent)
         return 1;
     return parent->pageZoomFactor();
@@ -144,7 +144,7 @@ static inline float parentPageZoomFactor(Frame* frame)
 
 static inline float parentTextZoomFactor(Frame* frame)
 {
-    Frame* parent = frame->tree()->parent();
+    Frame* parent = frame->tree().parent();
     if (!parent)
         return 1;
     return parent->textZoomFactor();
@@ -521,7 +521,7 @@ void Frame::setPrinting(bool printing, const FloatSize& pageSize, const FloatSiz
     }
 
     // Subframes of the one we're printing don't lay out to the page size.
-    for (RefPtr<Frame> child = tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (RefPtr<Frame> child = tree().firstChild(); child; child = child->tree().nextSibling())
         child->setPrinting(printing, FloatSize(), FloatSize(), 0, shouldAdjustViewSize);
 }
 
@@ -529,7 +529,7 @@ bool Frame::shouldUsePrintingLayout() const
 {
     // Only top frame being printed should be fit to page size.
     // Subframes should be constrained by parents only.
-    return m_doc->printing() && (!tree()->parent() || !tree()->parent()->m_doc->printing());
+    return m_doc->printing() && (!tree().parent() || !tree().parent()->m_doc->printing());
 }
 
 FloatSize Frame::resizePageRectsKeepingRatio(const FloatSize& originalSize, const FloatSize& expectedSize)
@@ -647,7 +647,7 @@ void Frame::dispatchVisibilityStateChangeEvent()
         m_doc->dispatchVisibilityStateChangeEvent();
 
     Vector<RefPtr<Frame> > childFrames;
-    for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (Frame* child = tree().firstChild(); child; child = child->tree().nextSibling())
         childFrames.append(child);
 
     for (size_t i = 0; i < childFrames.size(); ++i)
@@ -657,7 +657,7 @@ void Frame::dispatchVisibilityStateChangeEvent()
 
 void Frame::willDetachPage()
 {
-    if (Frame* parent = tree()->parent())
+    if (Frame* parent = tree().parent())
         parent->loader().checkLoadComplete();
 
     HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end();
@@ -926,7 +926,7 @@ void Frame::setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor
 
     document->recalcStyle(Style::Force);
 
-    for (RefPtr<Frame> child = tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (RefPtr<Frame> child = tree().firstChild(); child; child = child->tree().nextSibling())
         child->setPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor);
 
     if (FrameView* view = this->view()) {
@@ -988,7 +988,7 @@ void Frame::resumeActiveDOMObjectsAndAnimations()
 #if USE(ACCELERATED_COMPOSITING)
 void Frame::deviceOrPageScaleFactorChanged()
 {
-    for (RefPtr<Frame> child = tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (RefPtr<Frame> child = tree().firstChild(); child; child = child->tree().nextSibling())
         child->deviceOrPageScaleFactorChanged();
 
     if (RenderView* root = contentRenderer())
@@ -1001,7 +1001,7 @@ void Frame::notifyChromeClientWheelEventHandlerCountChanged() const
     ASSERT(m_page && m_page->mainFrame() == this);
 
     unsigned count = 0;
-    for (const Frame* frame = this; frame; frame = frame->tree()->traverseNext()) {
+    for (const Frame* frame = this; frame; frame = frame->tree().traverseNext()) {
         if (frame->document())
             count += frame->document()->wheelEventHandlerCount();
     }
@@ -1016,7 +1016,7 @@ bool Frame::isURLAllowed(const KURL& url) const
     if (m_page->subframeCount() >= Page::maxNumberOfFrames)
         return false;
     bool foundSelfReference = false;
-    for (const Frame* frame = this; frame; frame = frame->tree()->parent()) {
+    for (const Frame* frame = this; frame; frame = frame->tree().parent()) {
         if (equalIgnoringFragmentIdentifier(frame->document()->url(), url)) {
             if (foundSelfReference)
                 return false;
index 497b7fe..e17f941 100644 (file)
@@ -119,7 +119,7 @@ namespace WebCore {
         FrameLoader& loader() const;
         NavigationScheduler& navigationScheduler() const;
         FrameSelection& selection() const;
-        FrameTree* tree() const;
+        FrameTree& tree() const;
         AnimationController& animation() const;
         ScriptController& script();
         
@@ -316,9 +316,9 @@ namespace WebCore {
         m_inViewSourceMode = mode;
     }
 
-    inline FrameTree* Frame::tree() const
+    inline FrameTree& Frame::tree() const
     {
-        return &m_treeNode;
+        return m_treeNode;
     }
 
     inline Page* Frame::page() const
index 1e0afe1..9bd3143 100644 (file)
@@ -38,7 +38,7 @@ namespace WebCore {
 
 FrameTree::~FrameTree()
 {
-    for (Frame* child = firstChild(); child; child = child->tree()->nextSibling())
+    for (Frame* child = firstChild(); child; child = child->tree().nextSibling())
         child->setView(0);
 }
 
@@ -50,7 +50,7 @@ void FrameTree::setName(const AtomicString& name)
         return;
     }
     m_uniqueName = AtomicString(); // Remove our old frame name so it's not considered in uniqueChildName.
-    m_uniqueName = parent()->tree()->uniqueChildName(name);
+    m_uniqueName = parent()->tree().uniqueChildName(name);
 }
 
 void FrameTree::clearName()
@@ -66,18 +66,18 @@ Frame* FrameTree::parent() const
 
 bool FrameTree::transferChild(PassRefPtr<Frame> child)
 {
-    Frame* oldParent = child->tree()->parent();
+    Frame* oldParent = child->tree().parent();
     if (oldParent == m_thisFrame)
         return false; // |child| is already a child of m_thisFrame.
 
     if (oldParent)
-        oldParent->tree()->removeChild(child.get());
+        oldParent->tree().removeChild(child.get());
 
     ASSERT(child->page() == m_thisFrame->page());
-    child->tree()->m_parent = m_thisFrame;
+    child->tree().m_parent = m_thisFrame;
 
     // We need to ensure that the child still has a unique frame name with respect to its new parent.
-    child->tree()->setName(child->tree()->m_name);
+    child->tree().setName(child->tree().m_name);
 
     actuallyAppendChild(child); // Note, on return |child| is null.
     return true;
@@ -86,43 +86,43 @@ bool FrameTree::transferChild(PassRefPtr<Frame> child)
 void FrameTree::appendChild(PassRefPtr<Frame> child)
 {
     ASSERT(child->page() == m_thisFrame->page());
-    child->tree()->m_parent = m_thisFrame;
+    child->tree().m_parent = m_thisFrame;
     actuallyAppendChild(child); // Note, on return |child| is null.
 }
 
 void FrameTree::actuallyAppendChild(PassRefPtr<Frame> child)
 {
-    ASSERT(child->tree()->m_parent == m_thisFrame);
+    ASSERT(child->tree().m_parent == m_thisFrame);
     Frame* oldLast = m_lastChild;
     m_lastChild = child.get();
 
     if (oldLast) {
-        child->tree()->m_previousSibling = oldLast;
-        oldLast->tree()->m_nextSibling = child;
+        child->tree().m_previousSibling = oldLast;
+        oldLast->tree().m_nextSibling = child;
     } else
         m_firstChild = child;
 
     m_scopedChildCount = invalidCount;
 
-    ASSERT(!m_lastChild->tree()->m_nextSibling);
+    ASSERT(!m_lastChild->tree().m_nextSibling);
 }
 
 void FrameTree::removeChild(Frame* child)
 {
-    child->tree()->m_parent = 0;
+    child->tree().m_parent = 0;
 
     // Slightly tricky way to prevent deleting the child until we are done with it, w/o
     // extra refs. These swaps leave the child in a circular list by itself. Clearing its
     // previous and next will then finally deref it.
 
-    RefPtr<Frame>& newLocationForNext = m_firstChild == child ? m_firstChild : child->tree()->m_previousSibling->tree()->m_nextSibling;
-    Frame*& newLocationForPrevious = m_lastChild == child ? m_lastChild : child->tree()->m_nextSibling->tree()->m_previousSibling;
-    swap(newLocationForNext, child->tree()->m_nextSibling);
+    RefPtr<Frame>& newLocationForNext = m_firstChild == child ? m_firstChild : child->tree().m_previousSibling->tree().m_nextSibling;
+    Frame*& newLocationForPrevious = m_lastChild == child ? m_lastChild : child->tree().m_nextSibling->tree().m_previousSibling;
+    swap(newLocationForNext, child->tree().m_nextSibling);
     // For some inexplicable reason, the following line does not compile without the explicit std:: namespace
-    std::swap(newLocationForPrevious, child->tree()->m_previousSibling);
+    std::swap(newLocationForPrevious, child->tree().m_previousSibling);
 
-    child->tree()->m_previousSibling = 0;
-    child->tree()->m_nextSibling = 0;
+    child->tree().m_previousSibling = 0;
+    child->tree().m_nextSibling = 0;
 
     m_scopedChildCount = invalidCount;
 }
@@ -146,21 +146,21 @@ AtomicString FrameTree::uniqueChildName(const AtomicString& requestedName) const
     // Find the nearest parent that has a frame with a path in it.
     Vector<Frame*, 16> chain;
     Frame* frame;
-    for (frame = m_thisFrame; frame; frame = frame->tree()->parent()) {
-        if (frame->tree()->uniqueName().startsWith(framePathPrefix))
+    for (frame = m_thisFrame; frame; frame = frame->tree().parent()) {
+        if (frame->tree().uniqueName().startsWith(framePathPrefix))
             break;
         chain.append(frame);
     }
     StringBuilder name;
     name.append(framePathPrefix);
     if (frame) {
-        name.append(frame->tree()->uniqueName().string().substring(framePathPrefixLength,
-            frame->tree()->uniqueName().length() - framePathPrefixLength - framePathSuffixLength));
+        name.append(frame->tree().uniqueName().string().substring(framePathPrefixLength,
+            frame->tree().uniqueName().length() - framePathPrefixLength - framePathSuffixLength));
     }
     for (int i = chain.size() - 1; i >= 0; --i) {
         frame = chain[i];
         name.append('/');
-        name.append(frame->tree()->uniqueName());
+        name.append(frame->tree().uniqueName());
     }
 
     name.appendLiteral("/<!--frame");
@@ -176,7 +176,7 @@ inline Frame* FrameTree::scopedChild(unsigned index, TreeScope* scope) const
         return 0;
 
     unsigned scopedIndex = 0;
-    for (Frame* result = firstChild(); result; result = result->tree()->nextSibling()) {
+    for (Frame* result = firstChild(); result; result = result->tree().nextSibling()) {
         if (result->inScope(scope)) {
             if (scopedIndex == index)
                 return result;
@@ -192,8 +192,8 @@ inline Frame* FrameTree::scopedChild(const AtomicString& name, TreeScope* scope)
     if (!scope)
         return 0;
 
-    for (Frame* child = firstChild(); child; child = child->tree()->nextSibling())
-        if (child->tree()->uniqueName() == name && child->inScope(scope))
+    for (Frame* child = firstChild(); child; child = child->tree().nextSibling())
+        if (child->tree().uniqueName() == name && child->inScope(scope))
             return child;
     return 0;
 }
@@ -204,7 +204,7 @@ inline unsigned FrameTree::scopedChildCount(TreeScope* scope) const
         return 0;
 
     unsigned scopedCount = 0;
-    for (Frame* result = firstChild(); result; result = result->tree()->nextSibling()) {
+    for (Frame* result = firstChild(); result; result = result->tree().nextSibling()) {
         if (result->inScope(scope))
             scopedCount++;
     }
@@ -232,7 +232,7 @@ unsigned FrameTree::scopedChildCount() const
 unsigned FrameTree::childCount() const
 {
     unsigned count = 0;
-    for (Frame* result = firstChild(); result; result = result->tree()->nextSibling())
+    for (Frame* result = firstChild(); result; result = result->tree().nextSibling())
         ++count;
     return count;
 }
@@ -241,14 +241,14 @@ Frame* FrameTree::child(unsigned index) const
 {
     Frame* result = firstChild();
     for (unsigned i = 0; result && i != index; ++i)
-        result = result->tree()->nextSibling();
+        result = result->tree().nextSibling();
     return result;
 }
 
 Frame* FrameTree::child(const AtomicString& name) const
 {
-    for (Frame* child = firstChild(); child; child = child->tree()->nextSibling())
-        if (child->tree()->uniqueName() == name)
+    for (Frame* child = firstChild(); child; child = child->tree().nextSibling())
+        if (child->tree().uniqueName() == name)
             return child;
     return 0;
 }
@@ -269,8 +269,8 @@ Frame* FrameTree::find(const AtomicString& name) const
         return 0;
 
     // Search subtree starting with this frame first.
-    for (Frame* frame = m_thisFrame; frame; frame = frame->tree()->traverseNext(m_thisFrame))
-        if (frame->tree()->uniqueName() == name)
+    for (Frame* frame = m_thisFrame; frame; frame = frame->tree().traverseNext(m_thisFrame))
+        if (frame->tree().uniqueName() == name)
             return frame;
 
     // Search the entire tree for this page next.
@@ -280,8 +280,8 @@ Frame* FrameTree::find(const AtomicString& name) const
     if (!page)
         return 0;
 
-    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
-        if (frame->tree()->uniqueName() == name)
+    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext())
+        if (frame->tree().uniqueName() == name)
             return frame;
 
     // Search the entire tree of each of the other pages in this namespace.
@@ -291,8 +291,8 @@ Frame* FrameTree::find(const AtomicString& name) const
     for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) {
         Page* otherPage = *it;
         if (otherPage != page) {
-            for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
-                if (frame->tree()->uniqueName() == name)
+            for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+                if (frame->tree().uniqueName() == name)
                     return frame;
             }
         }
@@ -309,7 +309,7 @@ bool FrameTree::isDescendantOf(const Frame* ancestor) const
     if (m_thisFrame->page() != ancestor->page())
         return false;
 
-    for (Frame* frame = m_thisFrame; frame; frame = frame->tree()->parent())
+    for (Frame* frame = m_thisFrame; frame; frame = frame->tree().parent())
         if (frame == ancestor)
             return true;
     return false;
@@ -319,7 +319,7 @@ Frame* FrameTree::traverseNext(const Frame* stayWithin) const
 {
     Frame* child = firstChild();
     if (child) {
-        ASSERT(!stayWithin || child->tree()->isDescendantOf(stayWithin));
+        ASSERT(!stayWithin || child->tree().isDescendantOf(stayWithin));
         return child;
     }
 
@@ -328,20 +328,20 @@ Frame* FrameTree::traverseNext(const Frame* stayWithin) const
 
     Frame* sibling = nextSibling();
     if (sibling) {
-        ASSERT(!stayWithin || sibling->tree()->isDescendantOf(stayWithin));
+        ASSERT(!stayWithin || sibling->tree().isDescendantOf(stayWithin));
         return sibling;
     }
 
     Frame* frame = m_thisFrame;
-    while (!sibling && (!stayWithin || frame->tree()->parent() != stayWithin)) {
-        frame = frame->tree()->parent();
+    while (!sibling && (!stayWithin || frame->tree().parent() != stayWithin)) {
+        frame = frame->tree().parent();
         if (!frame)
             return 0;
-        sibling = frame->tree()->nextSibling();
+        sibling = frame->tree().nextSibling();
     }
 
     if (frame) {
-        ASSERT(!stayWithin || !sibling || sibling->tree()->isDescendantOf(stayWithin));
+        ASSERT(!stayWithin || !sibling || sibling->tree().isDescendantOf(stayWithin));
         return sibling;
     }
 
@@ -364,7 +364,7 @@ Frame* FrameTree::traversePreviousWithWrap(bool wrap) const
     // FIXME: besides the wrap feature, this is just the traversePreviousNode algorithm
 
     if (Frame* prevSibling = previousSibling())
-        return prevSibling->tree()->deepLastChild();
+        return prevSibling->tree().deepLastChild();
     if (Frame* parentFrame = parent())
         return parentFrame;
     
@@ -379,7 +379,7 @@ Frame* FrameTree::traversePreviousWithWrap(bool wrap) const
 Frame* FrameTree::deepLastChild() const
 {
     Frame* result = m_thisFrame;
-    for (Frame* last = lastChild(); last; last = last->tree()->lastChild())
+    for (Frame* last = lastChild(); last; last = last->tree().lastChild())
         result = last;
 
     return result;
@@ -388,7 +388,7 @@ Frame* FrameTree::deepLastChild() const
 Frame* FrameTree::top() const
 {
     Frame* frame = m_thisFrame;
-    for (Frame* parent = m_thisFrame; parent; parent = parent->tree()->parent())
+    for (Frame* parent = m_thisFrame; parent; parent = parent->tree().parent())
         frame = parent;
     return frame;
 }
@@ -422,7 +422,7 @@ static void printFrames(const WebCore::Frame* frame, const WebCore::Frame* targe
     printIndent(indent);
     printf("  uri=%s\n\n", frame->document()->documentURI().utf8().data());
 
-    for (WebCore::Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (WebCore::Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling())
         printFrames(child, targetFrame, indent + 1);
 }
 
@@ -433,7 +433,7 @@ void showFrameTree(const WebCore::Frame* frame)
         return;
     }
 
-    printFrames(frame->tree()->top(), frame, 0);
+    printFrames(frame->tree().top(), frame, 0);
 }
 
 #endif
index 39ed8d5..c7d7a98 100644 (file)
@@ -449,7 +449,7 @@ void FrameView::setFrameRect(const IntRect& newRect)
     if (newRect.width() != oldRect.width()) {
         Page* page = frame().page();
         if (isMainFrameView() && page->settings().textAutosizingEnabled()) {
-            for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
+            for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext())
                 frame().document()->textAutosizer()->recalculateMultipliers();
         }
     }
@@ -955,7 +955,7 @@ bool FrameView::hasCompositedContent() const
 bool FrameView::hasCompositedContentIncludingDescendants() const
 {
 #if USE(ACCELERATED_COMPOSITING)
-    for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
+    for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
         RenderView* renderView = frame->contentRenderer();
         if (RenderLayerCompositor* compositor = renderView ? &renderView->compositor() : 0) {
             if (compositor->inCompositingMode())
@@ -972,7 +972,7 @@ bool FrameView::hasCompositedContentIncludingDescendants() const
 bool FrameView::hasCompositingAncestor() const
 {
 #if USE(ACCELERATED_COMPOSITING)
-    for (Frame* frame = this->frame().tree()->parent(); frame; frame = frame->tree()->parent()) {
+    for (Frame* frame = this->frame().tree().parent(); frame; frame = frame->tree().parent()) {
         if (FrameView* view = frame->view()) {
             if (view->hasCompositedContent())
                 return true;
@@ -1012,7 +1012,7 @@ bool FrameView::flushCompositingStateIncludingSubframes()
 #if USE(ACCELERATED_COMPOSITING)
     bool allFramesFlushed = flushCompositingStateForThisFrame(&frame());
     
-    for (Frame* child = frame().tree()->firstChild(); child; child = child->tree()->traverseNext(&frame())) {
+    for (Frame* child = frame().tree().firstChild(); child; child = child->tree().traverseNext(&frame())) {
         bool flushed = child->view()->flushCompositingStateForThisFrame(&frame());
         allFramesFlushed &= flushed;
     }
@@ -1481,7 +1481,7 @@ bool FrameView::useSlowRepaintsIfNotOverlapped() const
 
 void FrameView::updateCanBlitOnScrollRecursively()
 {
-    for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
+    for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
         if (FrameView* view = frame->view())
             view->setCanBlitOnScroll(!view->useSlowRepaints());
     }
@@ -1778,7 +1778,7 @@ void FrameView::setIsOverlapped(bool isOverlapped)
     if (hasCompositedContentIncludingDescendants()) {
         // Overlap can affect compositing tests, so if it changes, we need to trigger
         // a layer update in the parent document.
-        if (Frame* parentFrame = frame().tree()->parent()) {
+        if (Frame* parentFrame = frame().tree().parent()) {
             if (RenderView* parentView = parentFrame->contentRenderer()) {
                 RenderLayerCompositor& compositor = parentView->compositor();
                 compositor.setCompositingLayersNeedRebuild();
@@ -1789,7 +1789,7 @@ void FrameView::setIsOverlapped(bool isOverlapped)
         if (RenderLayerCompositor::allowsIndependentlyCompositedFrames(this)) {
             // We also need to trigger reevaluation for this and all descendant frames,
             // since a frame uses compositing if any ancestor is compositing.
-            for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
+            for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
                 if (RenderView* view = frame->contentRenderer()) {
                     RenderLayerCompositor& compositor = view->compositor();
                     compositor.setCompositingLayersNeedRebuild();
@@ -2280,7 +2280,7 @@ void FrameView::doDeferredRepaints()
 bool FrameView::shouldUseLoadTimeDeferredRepaintDelay() const
 {
     // Don't defer after the initial load of the page has been completed.
-    if (frame().tree()->top()->loader().isComplete())
+    if (frame().tree().top()->loader().isComplete())
         return false;
     Document* document = frame().document();
     if (!document)
@@ -2345,7 +2345,7 @@ void FrameView::updateLayerFlushThrottlingInAllFrames()
 {
 #if USE(ACCELERATED_COMPOSITING)
     bool isMainLoadProgressing = frame().page()->progress().isMainLoadProgressing();
-    for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
+    for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
         if (RenderView* renderView = frame->contentRenderer())
             renderView->compositor().setLayerFlushThrottlingEnabled(isMainLoadProgressing);
     }
@@ -2504,13 +2504,13 @@ void FrameView::unscheduleRelayout()
 #if ENABLE(REQUEST_ANIMATION_FRAME)
 void FrameView::serviceScriptedAnimations(double monotonicAnimationStartTime)
 {
-    for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext()) {
         frame->view()->serviceScrollAnimations();
         frame->animation().serviceAnimations();
     }
 
     Vector<RefPtr<Document> > documents;
-    for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext())
         documents.append(frame->document());
 
     for (size_t i = 0; i < documents.size(); ++i)
@@ -2550,7 +2550,7 @@ void FrameView::setBaseBackgroundColor(const Color& backgroundColor)
 
 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, bool transparent)
 {
-    for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
+    for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
         if (FrameView* view = frame->view()) {
             view->setTransparent(transparent);
             view->setBaseBackgroundColor(backgroundColor);
@@ -3385,7 +3385,7 @@ FrameView* FrameView::parentFrameView() const
     if (!parent())
         return 0;
 
-    if (Frame* parentFrame = frame().tree()->parent())
+    if (Frame* parentFrame = frame().tree().parent())
         return parentFrame->view();
 
     return 0;
@@ -3623,7 +3623,7 @@ void FrameView::paintContentsForSnapshot(GraphicsContext* context, const IntRect
     // in the render tree only. This will allow us to restore the selection from the DOM
     // after we paint the snapshot.
     if (shouldPaintSelection == ExcludeSelection) {
-        for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
+        for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
             if (RenderView* root = frame->contentRenderer())
                 root->clearSelection();
         }
@@ -3639,7 +3639,7 @@ void FrameView::paintContentsForSnapshot(GraphicsContext* context, const IntRect
 
     // Restore selection.
     if (shouldPaintSelection == ExcludeSelection) {
-        for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get()))
+        for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get()))
             frame->selection().updateAppearance();
     }
 
@@ -4016,7 +4016,7 @@ void FrameView::setTracksRepaints(bool trackRepaints)
     }
 
 #if USE(ACCELERATED_COMPOSITING)
-    for (Frame* frame = m_frame->tree()->top(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_frame->tree().top(); frame; frame = frame->tree().traverseNext()) {
         if (RenderView* renderView = frame->contentRenderer())
             renderView->compositor().setTracksRepaints(trackRepaints);
     }
@@ -4145,7 +4145,7 @@ bool FrameView::isFlippedDocument() const
 
 void FrameView::notifyWidgetsInAllFrames(WidgetNotification notification)
 {
-    for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext(m_frame.get())) {
+    for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
         if (RenderView* root = frame->contentRenderer())
             root->notifyWidgets(notification);
     }
index 7067643..d843478 100644 (file)
@@ -129,7 +129,7 @@ PassRefPtr<DOMStringList> Location::ancestorOrigins() const
     RefPtr<DOMStringList> origins = DOMStringList::create();
     if (!m_frame)
         return origins.release();
-    for (Frame* frame = m_frame->tree()->parent(); frame; frame = frame->tree()->parent())
+    for (Frame* frame = m_frame->tree().parent(); frame; frame = frame->tree().parent())
         origins->append(frame->document()->securityOrigin()->toString());
     return origins.release();
 }
index 6b1cfbb..6dd7f05 100644 (file)
@@ -103,7 +103,7 @@ static void networkStateChanged(bool isOnLine)
     // Get all the frames of all the pages in all the page groups
     HashSet<Page*>::iterator end = allPages->end();
     for (HashSet<Page*>::iterator it = allPages->begin(); it != end; ++it) {
-        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext())
+        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().traverseNext())
             frames.append(frame);
         InspectorInstrumentation::networkStateChanged(*it);
     }
@@ -212,7 +212,7 @@ Page::~Page()
     setGroupName(String());
     allPages->remove(this);
     
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         frame->willDetachPage();
         frame->detachFromPage();
     }
@@ -242,7 +242,7 @@ Page::~Page()
 ArenaSize Page::renderTreeSize() const
 {
     ArenaSize total(0, 0);
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (!frame->document())
             continue;
         if (RenderArena* arena = frame->document()->renderArena()) {
@@ -473,7 +473,7 @@ void Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment()
         return;
     HashSet<Page*>::iterator end = allPages->end();
     for (HashSet<Page*>::iterator it = allPages->begin(); it != end; ++it)
-        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().traverseNext()) {
             // If a change in the global environment has occurred, we need to
             // make sure all the properties a recomputed, therefore we invalidate
             // the properties cache.
@@ -485,7 +485,7 @@ void Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment()
 
 void Page::setNeedsRecalcStyleInAllFrames()
 {
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->document()->styleResolverChanged(DeferRecalcStyle);
 }
 
@@ -509,7 +509,7 @@ void Page::refreshPlugins(bool reload)
         if (!reload)
             continue;
         
-        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().traverseNext()) {
             if (frame->loader().subframeLoader()->containsPlugins())
                 framesNeedingReload.append(frame);
         }
@@ -528,7 +528,7 @@ PluginData* Page::pluginData() const
 
 inline MediaCanStartListener* Page::takeAnyMediaCanStartListener()
 {
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (MediaCanStartListener* listener = frame->document()->takeAnyMediaCanStartListener())
             return listener;
     }
@@ -553,8 +553,8 @@ void Page::setCanStartMedia(bool canStartMedia)
 static Frame* incrementFrame(Frame* curr, bool forward, bool wrapFlag)
 {
     return forward
-        ? curr->tree()->traverseNextWithWrap(wrapFlag)
-        : curr->tree()->traversePreviousWithWrap(wrapFlag);
+        ? curr->tree().traverseNextWithWrap(wrapFlag)
+        : curr->tree().traversePreviousWithWrap(wrapFlag);
 }
 
 bool Page::findString(const String& target, TextCaseSensitivity caseSensitivity, FindDirection direction, bool shouldWrap)
@@ -726,7 +726,7 @@ void Page::setDefersLoading(bool defers)
     }
 
     m_defersLoading = defers;
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->loader().setDefersLoading(defers);
 }
 
@@ -754,7 +754,7 @@ void Page::setMediaVolume(float volume)
         return;
 
     m_mediaVolume = volume;
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         frame->document()->mediaVolumeDidChange();
     }
 }
@@ -815,7 +815,7 @@ void Page::setDeviceScaleFactor(float scaleFactor)
     pageCache()->markPagesForDeviceScaleChanged(this);
 #endif
 
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->editor().deviceScaleFactorChanged();
 
     pageCache()->markPagesForFullStyleRecalc(this);
@@ -841,7 +841,7 @@ void Page::setShouldSuppressScrollbarAnimations(bool suppressAnimations)
 
     view->finishCurrentScrollAnimations();
     
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         FrameView* frameView = frame->view();
         if (!frameView)
             continue;
@@ -916,7 +916,7 @@ void Page::didMoveOnscreen()
 {
     m_isOnscreen = true;
 
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (FrameView* frameView = frame->view())
             frameView->didMoveOnscreen();
     }
@@ -928,7 +928,7 @@ void Page::willMoveOffscreen()
 {
     m_isOnscreen = false;
 
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (FrameView* frameView = frame->view())
             frameView->willMoveOffscreen();
     }
@@ -943,7 +943,7 @@ void Page::setIsInWindow(bool isInWindow)
 
     m_isInWindow = isInWindow;
 
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (FrameView* frameView = frame->view())
             frameView->setIsInWindow(isInWindow);
     }
@@ -952,7 +952,7 @@ void Page::setIsInWindow(bool isInWindow)
 void Page::suspendScriptedAnimations()
 {
     m_scriptedAnimationsSuspended = true;
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->document())
             frame->document()->suspendScriptedAnimationControllerCallbacks();
     }
@@ -961,7 +961,7 @@ void Page::suspendScriptedAnimations()
 void Page::resumeScriptedAnimations()
 {
     m_scriptedAnimationsSuspended = false;
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->document())
             frame->document()->resumeScriptedAnimationControllerCallbacks();
     }
@@ -998,7 +998,7 @@ void Page::userStyleSheetLocationChanged()
             m_userStyleSheet = String::fromUTF8(styleSheetAsUTF8.data(), styleSheetAsUTF8.size());
     }
 
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->document())
             frame->document()->styleSheetCollection()->updatePageUserSheet();
     }
@@ -1071,7 +1071,7 @@ void Page::allVisitedStateChanged(PageGroup* group)
         Page* page = *it;
         if (page->m_group != group)
             continue;
-        for (Frame* frame = page->m_mainFrame.get(); frame; frame = frame->tree()->traverseNext())
+        for (Frame* frame = page->m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
             frame->document()->visitedLinkState().invalidateStyleForAllLinks();
     }
 }
@@ -1087,7 +1087,7 @@ void Page::visitedStateChanged(PageGroup* group, LinkHash linkHash)
         Page* page = *it;
         if (page->m_group != group)
             continue;
-        for (Frame* frame = page->m_mainFrame.get(); frame; frame = frame->tree()->traverseNext())
+        for (Frame* frame = page->m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
             frame->document()->visitedLinkState().invalidateStyleForLink(linkHash);
     }
 }
@@ -1108,7 +1108,7 @@ void Page::setDebugger(JSC::Debugger* debugger)
 
     m_debugger = debugger;
 
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
         frame->script().attachDebugger(m_debugger);
 }
 
@@ -1152,7 +1152,7 @@ void Page::setMemoryCacheClientCallsEnabled(bool enabled)
     if (!enabled)
         return;
 
-    for (RefPtr<Frame> frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (RefPtr<Frame> frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->loader().tellClientAboutPastMemoryCacheLoads();
 }
 
@@ -1160,7 +1160,7 @@ void Page::setMinimumTimerInterval(double minimumTimerInterval)
 {
     double oldTimerInterval = m_minimumTimerInterval;
     m_minimumTimerInterval = minimumTimerInterval;
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNextWithWrap(false)) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNextWithWrap(false)) {
         if (frame->document())
             frame->document()->adjustMinimumTimerInterval(oldTimerInterval);
     }
@@ -1177,7 +1177,7 @@ void Page::setTimerAlignmentInterval(double interval)
         return;
 
     m_timerAlignmentInterval = interval;
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNextWithWrap(false)) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNextWithWrap(false)) {
         if (frame->document())
             frame->document()->didChangeTimerAlignmentInterval();
     }
@@ -1190,13 +1190,13 @@ double Page::timerAlignmentInterval() const
 
 void Page::dnsPrefetchingStateChanged()
 {
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->document()->initDNSPrefetch();
 }
 
 void Page::collectPluginViews(Vector<RefPtr<PluginViewBase>, 32>& pluginViewBases)
 {
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
         FrameView* view = frame->view();
         if (!view)
             return;
@@ -1215,7 +1215,7 @@ void Page::collectPluginViews(Vector<RefPtr<PluginViewBase>, 32>& pluginViewBase
 
 void Page::storageBlockingStateChanged()
 {
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->document()->storageBlockingStateDidChange();
 
     // Collect the PluginViews in to a vector to ensure that action the plug-in takes
@@ -1231,7 +1231,7 @@ void Page::privateBrowsingStateChanged()
 {
     bool privateBrowsingEnabled = m_settings->privateBrowsingEnabled();
 
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->document()->privateBrowsingStateDidChange();
 
     // Collect the PluginViews in to a vector to ensure that action the plug-in takes
@@ -1249,7 +1249,7 @@ void Page::checkSubframeCountConsistency() const
     ASSERT(m_subframeCount >= 0);
 
     int subframeCount = 0;
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         ++subframeCount;
 
     ASSERT(m_subframeCount + 1 == subframeCount);
@@ -1476,13 +1476,13 @@ void Page::addRelevantUnpaintedObject(RenderObject* object, const LayoutRect& ob
 
 void Page::suspendActiveDOMObjectsAndAnimations()
 {
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->suspendActiveDOMObjectsAndAnimations();
 }
 
 void Page::resumeActiveDOMObjectsAndAnimations()
 {
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->resumeActiveDOMObjectsAndAnimations();
 }
 
@@ -1559,7 +1559,7 @@ void Page::hiddenPageCSSAnimationSuspensionStateChanged()
 #if ENABLE(VIDEO_TRACK)
 void Page::captionPreferencesChanged()
 {
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->document()->captionPreferencesChanged();
 }
 #endif
index 47cdd1a..f5441da 100644 (file)
@@ -403,7 +403,7 @@ void PageGroup::invalidateInjectedStyleSheetCacheInAllFrames()
     // Clear our cached sheets and have them just reparse.
     HashSet<Page*>::const_iterator end = m_pages.end();
     for (HashSet<Page*>::const_iterator it = m_pages.begin(); it != end; ++it) {
-        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().traverseNext()) {
             frame->document()->styleSheetCollection()->invalidateInjectedStyleSheetCache();
             frame->document()->styleResolverChanged(DeferRecalcStyle);
         }
index 936e5c8..1f9d340 100644 (file)
@@ -46,7 +46,7 @@ PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf)
 
                 // This code is not logically part of load deferring, but we do not want JS code executed beneath modal
                 // windows or sheets, which is exactly when PageGroupLoadDeferrer is used.
-                for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext())
+                for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree().traverseNext())
                     frame->document()->suspendScheduledTasks(ActiveDOMObject::WillDeferLoading);
             }
         }
@@ -64,7 +64,7 @@ PageGroupLoadDeferrer::~PageGroupLoadDeferrer()
         if (Page* page = m_deferredFrames[i]->page()) {
             page->setDefersLoading(false);
 
-            for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
+            for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext())
                 frame->document()->resumeScheduledTasks(ActiveDOMObject::WillDeferLoading);
         }
     }
index 4dfa651..976787b 100644 (file)
@@ -249,7 +249,7 @@ void PageSerializer::serializeFrame(Frame* frame)
         }
     }
 
-    for (Frame* childFrame = frame->tree()->firstChild(); childFrame; childFrame = childFrame->tree()->nextSibling())
+    for (Frame* childFrame = frame->tree().firstChild(); childFrame; childFrame = childFrame->tree().nextSibling())
         serializeFrame(childFrame);
 }
 
index 68f73cb..92ccaf3 100644 (file)
@@ -61,7 +61,7 @@ void PageThrottler::throttlePage()
 
     m_page->chrome().client().decrementActivePageCount();
 
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->document())
             frame->document()->scriptedAnimationControllerSetThrottled(true);
     }
@@ -80,7 +80,7 @@ void PageThrottler::unthrottlePage()
     if (oldState == PageThrottledState)
         m_page->chrome().client().incrementActivePageCount();
     
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->document())
             frame->document()->scriptedAnimationControllerSetThrottled(false);
     }
index 20387f5..54d1a32 100644 (file)
@@ -52,7 +52,7 @@ namespace WebCore {
 
 static void setImageLoadingSettings(Page* page)
 {
-    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         frame->document()->cachedResourceLoader()->setImagesEnabled(page->settings().areImagesEnabled());
         frame->document()->cachedResourceLoader()->setAutoLoadImages(page->settings().loadsImagesAutomatically());
     }
@@ -321,7 +321,7 @@ void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor)
     m_textAutosizingFontScaleFactor = fontScaleFactor;
 
     // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::resize, or whether there is only one document per Settings instance?
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext())
         frame->document()->textAutosizer()->recalculateMultipliers();
 
     m_page->setNeedsRecalcStyleInAllFrames();
index 915c5d4..08a3878 100644 (file)
@@ -506,7 +506,7 @@ bool canScrollInDirection(const Frame* frame, FocusDirection direction)
 static LayoutRect rectToAbsoluteCoordinates(Frame* initialFrame, const LayoutRect& initialRect)
 {
     LayoutRect rect = initialRect;
-    for (Frame* frame = initialFrame; frame; frame = frame->tree()->parent()) {
+    for (Frame* frame = initialFrame; frame; frame = frame->tree().parent()) {
         if (Element* element = frame->ownerElement()) {
             do {
                 rect.move(element->offsetLeft(), element->offsetTop());
index 2094ac9..f01a1ae 100644 (file)
@@ -269,7 +269,7 @@ void AnimationControllerPrivate::suspendAnimations()
     suspendAnimationsForDocument(m_frame->document());
 
     // Traverse subframes
-    for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling())
         child->animation().suspendAnimations();
 
     m_isSuspended = true;
@@ -283,7 +283,7 @@ void AnimationControllerPrivate::resumeAnimations()
     resumeAnimationsForDocument(m_frame->document());
 
     // Traverse subframes
-    for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
+    for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling())
         child->animation().resumeAnimations();
 
     m_isSuspended = false;
index ea12672..fbd9edf 100644 (file)
@@ -43,7 +43,7 @@ void Page::addSchedulePair(PassRefPtr<SchedulePair> prpPair)
         m_scheduledRunLoopPairs = adoptPtr(new SchedulePairHashSet);
     m_scheduledRunLoopPairs->add(pair);
 
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
         if (DocumentLoader* documentLoader = frame->loader().documentLoader())
             documentLoader->schedule(pair.get());
         if (DocumentLoader* documentLoader = frame->loader().provisionalDocumentLoader())
@@ -62,7 +62,7 @@ void Page::removeSchedulePair(PassRefPtr<SchedulePair> prpPair)
     RefPtr<SchedulePair> pair = prpPair;
     m_scheduledRunLoopPairs->remove(pair);
 
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
         if (DocumentLoader* documentLoader = frame->loader().documentLoader())
             documentLoader->unschedule(pair.get());
         if (DocumentLoader* documentLoader = frame->loader().provisionalDocumentLoader())
index ee3aaea..d420266 100644 (file)
@@ -151,9 +151,8 @@ Region ScrollingCoordinator::computeNonFastScrollableRegion(const Frame* frame,
         }
     }
 
-    FrameTree* tree = frame->tree();
-    for (Frame* subFrame = tree->firstChild(); subFrame; subFrame = subFrame->tree()->nextSibling())
-        nonFastScrollableRegion.unite(computeNonFastScrollableRegion(subFrame, offset));
+    for (Frame* subframe = frame->tree().firstChild(); subframe; subframe = subframe->tree().nextSibling())
+        nonFastScrollableRegion.unite(computeNonFastScrollableRegion(subframe, offset));
 
     return nonFastScrollableRegion;
 }
@@ -235,7 +234,7 @@ unsigned ScrollingCoordinator::computeCurrentWheelEventHandlerCount()
 {
     unsigned wheelEventHandlerCount = 0;
 
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->document())
             wheelEventHandlerCount += frame->document()->wheelEventHandlerCount();
     }
index 55be2a2..7101f59 100644 (file)
@@ -422,7 +422,7 @@ void PluginView::performRequest(PluginRequest* request)
     // don't let a plugin start any loads if it is no longer part of a document that is being 
     // displayed unless the loads are in the same frame as the plugin.
     const String& targetFrameName = request->frameLoadRequest().frameName();
-    if (m_parentFrame->loader().documentLoader() != m_parentFrame->loader().activeDocumentLoader() && (targetFrameName.isNull() || m_parentFrame->tree()->find(targetFrameName) != m_parentFrame))
+    if (m_parentFrame->loader().documentLoader() != m_parentFrame->loader().activeDocumentLoader() && (targetFrameName.isNull() || m_parentFrame->tree().find(targetFrameName) != m_parentFrame))
         return;
 
     KURL requestURL = request->frameLoadRequest().resourceRequest().url();
@@ -460,7 +460,7 @@ void PluginView::performRequest(PluginRequest* request)
 
     // Targeted JavaScript requests are only allowed on the frame that contains the JavaScript plugin
     // and this has been made sure in ::load.
-    ASSERT(targetFrameName.isEmpty() || m_parentFrame->tree()->find(targetFrameName) == m_parentFrame);
+    ASSERT(targetFrameName.isEmpty() || m_parentFrame->tree().find(targetFrameName) == m_parentFrame);
     
     // Executing a script can cause the plugin view to be destroyed, so we keep a reference to it.
     RefPtr<PluginView> protector(this);
@@ -528,7 +528,7 @@ NPError PluginView::load(const FrameLoadRequest& frameLoadRequest, bool sendNoti
             return NPERR_GENERIC_ERROR;
 
         // For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
-        if (!targetFrameName.isNull() && m_parentFrame->tree()->find(targetFrameName) != m_parentFrame)
+        if (!targetFrameName.isNull() && m_parentFrame->tree().find(targetFrameName) != m_parentFrame)
             return NPERR_INVALID_PARAM;
     } else if (!m_parentFrame->document()->securityOrigin()->canDisplay(url))
         return NPERR_GENERIC_ERROR;
index 8c5dfca..77397c9 100644 (file)
@@ -173,7 +173,7 @@ Frame* HitTestResult::targetFrame() const
     if (!frame)
         return 0;
 
-    return frame->tree()->find(m_innerURLElement->target());
+    return frame->tree().find(m_innerURLElement->target());
 }
 
 bool HitTestResult::isSelected() const
index f0cf9ec..879f20f 100644 (file)
@@ -463,7 +463,7 @@ void RenderLayerCompositor::layerTiledBackingUsageChanged(const GraphicsLayer*,
 
 RenderLayerCompositor* RenderLayerCompositor::enclosingCompositorFlushingLayers() const
 {
-    for (Frame* frame = &m_renderView.frameView().frame(); frame; frame = frame->tree()->parent()) {
+    for (Frame* frame = &m_renderView.frameView().frame(); frame; frame = frame->tree().parent()) {
         RenderLayerCompositor* compositor = frame->contentRenderer() ? &frame->contentRenderer()->compositor() : 0;
         if (compositor->isFlushingLayers())
             return compositor;
@@ -572,7 +572,7 @@ void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
 
         Frame& frame = m_renderView.frameView().frame();
         bool isMainFrame = !m_renderView.document()->ownerElement();
-        LOG(Compositing, "\nUpdate %d of %s.\n", m_rootLayerUpdateCount, isMainFrame ? "main frame" : frame.tree()->uniqueName().string().utf8().data());
+        LOG(Compositing, "\nUpdate %d of %s.\n", m_rootLayerUpdateCount, isMainFrame ? "main frame" : frame.tree().uniqueName().string().utf8().data());
     }
 #endif
 
@@ -2978,7 +2978,7 @@ void RenderLayerCompositor::notifyIFramesOfCompositingChange()
 {
     Frame& frame = m_renderView.frameView().frame();
 
-    for (Frame* child = frame.tree()->firstChild(); child; child = child->tree()->traverseNext(&frame)) {
+    for (Frame* child = frame.tree().firstChild(); child; child = child->tree().traverseNext(&frame)) {
         if (child->document() && child->document()->ownerElement())
             child->document()->ownerElement()->scheduleSetNeedsStyleRecalc(SyntheticStyleChange);
     }
index 903398c..4a3b7f6 100644 (file)
@@ -122,7 +122,7 @@ bool TextAutosizer::processSubtree(RenderObject* layoutRoot)
     // Largest area of block that can be visible at once (assuming the main
     // frame doesn't get scaled to less than overview scale), in CSS pixels.
     windowInfo.minLayoutSize = mainFrame->view()->layoutSize();
-    for (Frame* frame = m_document->frame(); frame; frame = frame->tree()->parent()) {
+    for (Frame* frame = m_document->frame(); frame; frame = frame->tree().parent()) {
         if (!frame->view()->isInChildFrameWithFrameFlattening())
             windowInfo.minLayoutSize = windowInfo.minLayoutSize.shrunkTo(frame->view()->layoutSize());
     }
index 35fb89e..c1f7c64 100644 (file)
@@ -47,7 +47,7 @@ void StorageEventDispatcher::dispatchSessionStorageEvents(const String& key, con
     Vector<RefPtr<Frame> > frames;
 
     // Send events only to our page.
-    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin))
             frames.append(frame);
     }
@@ -66,7 +66,7 @@ void StorageEventDispatcher::dispatchLocalStorageEvents(const String& key, const
     // Send events to every page.
     const HashSet<Page*>& pages = page->group().pages();
     for (HashSet<Page*>::const_iterator it = pages.begin(), end = pages.end(); it != end; ++it) {
-        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().traverseNext()) {
             if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin))
                 frames.append(frame);
         }
index 551cc60..ca7ba33 100644 (file)
@@ -188,13 +188,10 @@ float SVGSVGElement::currentScale() const
     if (!frame)
         return 1;
 
-    FrameTree* frameTree = frame->tree();
-    ASSERT(frameTree);
-
     // The behaviour of currentScale() is undefined, when we're dealing with non-standalone SVG documents.
     // If the svg is embedded, the scaling is handled by the host renderer, so when asking from inside
     // the SVG document, a scale value of 1 seems reasonable, as it doesn't know anything about the parent scale.
-    return frameTree->parent() ? 1 : frame->pageZoomFactor();
+    return frame->tree().parent() ? 1 : frame->pageZoomFactor();
 }
 
 void SVGSVGElement::setCurrentScale(float scale)
@@ -206,13 +203,10 @@ void SVGSVGElement::setCurrentScale(float scale)
     if (!frame)
         return;
 
-    FrameTree* frameTree = frame->tree();
-    ASSERT(frameTree);
-
     // The behaviour of setCurrentScale() is undefined, when we're dealing with non-standalone SVG documents.
     // We choose the ignore this call, it's pretty useless to support calling setCurrentScale() from within
     // an embedded SVG document, for the same reasons as in currentScale() - needs resolution by SVG WG.
-    if (frameTree->parent())
+    if (frame->tree().parent())
         return;
 
     frame->setPageZoomFactor(scale);
index fbdd623..76a1e83 100644 (file)
@@ -705,7 +705,7 @@ Vector<String> Internals::formControlStateOfPreviousHistoryItem(ExceptionCode& e
         ec = INVALID_ACCESS_ERR;
         return Vector<String>();
     }
-    String uniqueName = frame()->tree()->uniqueName();
+    String uniqueName = frame()->tree().uniqueName();
     if (mainItem->target() != uniqueName && !mainItem->childItemWithTarget(uniqueName)) {
         ec = INVALID_ACCESS_ERR;
         return Vector<String>();
@@ -720,7 +720,7 @@ void Internals::setFormControlStateOfPreviousHistoryItem(const Vector<String>& s
         ec = INVALID_ACCESS_ERR;
         return;
     }
-    String uniqueName = frame()->tree()->uniqueName();
+    String uniqueName = frame()->tree().uniqueName();
     if (mainItem->target() == uniqueName)
         mainItem->setDocumentState(state);
     else if (HistoryItem* subItem = mainItem->childItemWithTarget(uniqueName))
@@ -1578,7 +1578,7 @@ unsigned Internals::numberOfScrollableAreas(Document* document, ExceptionCode&)
     if (frame->view()->scrollableAreas())
         count += frame->view()->scrollableAreas()->size();
 
-    for (Frame* child = frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+    for (Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
         if (child->view() && child->view()->scrollableAreas())
             count += child->view()->scrollableAreas()->size();
     }
index acf69b9..1047264 100644 (file)
@@ -90,7 +90,7 @@ static inline bool hasNoStyleInformation(Document* document)
     if (!document->frame()->page()->settings().developerExtrasEnabled())
         return false;
 
-    if (document->frame()->tree()->parent())
+    if (document->frame()->tree().parent())
         return false; // This document is not in a top frame
 
     return true;
index 9208459..4ae29da 100644 (file)
@@ -943,7 +943,7 @@ static void closeURLRecursively(Frame* frame)
 
     Vector<RefPtr<Frame>, 10> childFrames;
 
-    for (RefPtr<Frame> childFrame = frame->tree()->firstChild(); childFrame; childFrame = childFrame->tree()->nextSibling())
+    for (RefPtr<Frame> childFrame = frame->tree().firstChild(); childFrame; childFrame = childFrame->tree().nextSibling())
         childFrames.append(childFrame);
 
     unsigned size = childFrames.size();
@@ -974,7 +974,7 @@ static void enableCrossSiteXHRRecursively(Frame* frame)
     frame->document()->securityOrigin()->grantUniversalAccess();
 
     Vector<RefPtr<Frame>, 10> childFrames;
-    for (RefPtr<Frame> childFrame = frame->tree()->firstChild(); childFrame; childFrame = childFrame->tree()->nextSibling())
+    for (RefPtr<Frame> childFrame = frame->tree().firstChild(); childFrame; childFrame = childFrame->tree().nextSibling())
         childFrames.append(childFrame);
 
     unsigned size = childFrames.size();
@@ -3521,7 +3521,7 @@ void WebPagePrivate::setScreenOrientation(int orientation)
 #if ENABLE(ORIENTATION_EVENTS)
     if (m_mainFrame->orientation() == orientation)
         return;
-    for (RefPtr<Frame> frame = m_mainFrame; frame; frame = frame->tree()->traverseNext())
+    for (RefPtr<Frame> frame = m_mainFrame; frame; frame = frame->tree().traverseNext())
         frame->sendOrientationChangeEvent(orientation);
 #endif
 }
index e18f17c..9046987 100644 (file)
@@ -1,3 +1,21 @@
+2013-08-24  Darin Adler  <darin@apple.com>
+
+        Frame::tree should return a reference instead of a pointer
+        https://bugs.webkit.org/show_bug.cgi?id=120259
+
+        Reviewed by Andreas Kling.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::closeURLRecursively):
+        (BlackBerry::WebKit::enableCrossSiteXHRRecursively):
+        (BlackBerry::WebKit::WebPagePrivate::setScreenOrientation):
+        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+        (WebCore::FrameLoaderClientBlackBerry::createFrame):
+        * WebKitSupport/DOMSupport.cpp:
+        (BlackBerry::WebKit::DOMSupport::convertPointToFrame):
+        (BlackBerry::WebKit::DOMSupport::incrementFrame):
+        Use tree(). instead of tree()->.
+
 2013-08-20  Pratik Solanki  <psolanki@apple.com>
 
         <https://webkit.org/b/120029> Document::markers() should return a reference
index 0eb21fb..8385880 100644 (file)
@@ -800,16 +800,16 @@ PassRefPtr<Frame> FrameLoaderClientBlackBerry::createFrame(const KURL& url, cons
     if (marginHeight != -1)
         frameView->setMarginHeight(marginHeight);
 
-    childFrame->tree()->setName(name);
-    m_frame->tree()->appendChild(childFrame);
+    childFrame->tree().setName(name);
+    m_frame->tree().appendChild(childFrame);
     childFrame->init();
 
-    if (!childFrame->tree()->parent())
+    if (!childFrame->tree().parent())
         return 0;
 
     m_frame->loader().loadURLIntoChildFrame(url, referrer, childFrame.get());
 
-    if (!childFrame->tree()->parent())
+    if (!childFrame->tree().parent())
         return 0;
 
     return childFrame.release();
index 312229d..a58055c 100644 (file)
@@ -459,9 +459,8 @@ IntPoint convertPointToFrame(const Frame* sourceFrame, const Frame* targetFrame,
         return point;
 
     ASSERT(sourceFrame->view() && targetFrame->view());
-    ASSERT(targetFrame->tree());
 
-    Frame* targetFrameParent = targetFrame->tree()->parent();
+    Frame* targetFrameParent = targetFrame->tree().parent();
     IntRect targetFrameRect = targetFrame->view()->frameRect();
     IntPoint targetPoint = point;
 
@@ -569,8 +568,8 @@ VisibleSelection visibleSelectionForFocusedBlock(Element* element)
 Frame* incrementFrame(Frame* curr, bool forward, bool wrapFlag)
 {
     return forward
-        ? curr->tree()->traverseNextWithWrap(wrapFlag)
-        : curr->tree()->traversePreviousWithWrap(wrapFlag);
+        ? curr->tree().traverseNextWithWrap(wrapFlag)
+        : curr->tree().traversePreviousWithWrap(wrapFlag);
 }
 
 PassRefPtr<Range> trimWhitespaceFromRange(PassRefPtr<Range> range)
index 1e3d6d1..ce83ad2 100644 (file)
@@ -1,3 +1,23 @@
+2013-08-24  Darin Adler  <darin@apple.com>
+
+        Frame::tree should return a reference instead of a pointer
+        https://bugs.webkit.org/show_bug.cgi?id=120259
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::clearFrameName):
+        (DumpRenderTreeSupportEfl::frameChildren):
+        (DumpRenderTreeSupportEfl::frameParent):
+        * ewk/ewk_frame.cpp:
+        (_ewk_frame_children_iterator_next):
+        (ewk_frame_child_find):
+        (ewk_frame_name_get):
+        (ewk_frame_child_add):
+        * ewk/ewk_view.cpp:
+        (ewk_view_frame_create):
+        Use tree(). instead of tree()->.
+
 2013-08-22  Andreas Kling  <akling@apple.com>
 
         EFL build juice.
index 4414a87..b3ded88 100644 (file)
@@ -112,7 +112,7 @@ void DumpRenderTreeSupportEfl::clearFrameName(Evas_Object* ewkFrame)
 {
     DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame);
 
-    frame->tree()->clearName();
+    frame->tree().clearName();
 }
 
 void DumpRenderTreeSupportEfl::clearOpener(Evas_Object* ewkFrame)
@@ -135,8 +135,8 @@ Eina_List* DumpRenderTreeSupportEfl::frameChildren(const Evas_Object* ewkFrame)
 
     Eina_List* childFrames = 0;
 
-    for (unsigned index = 0; index < frame->tree()->childCount(); index++) {
-        WebCore::Frame *childFrame = frame->tree()->child(index);
+    for (unsigned index = 0; index < frame->tree().childCount(); index++) {
+        WebCore::Frame *childFrame = frame->tree().child(index);
         WebCore::FrameLoaderClientEfl& client = static_cast<WebCore::FrameLoaderClientEfl&>(childFrame->loader().client());
 
         childFrames = eina_list_append(childFrames, client.webFrame());
@@ -149,7 +149,7 @@ WebCore::Frame* DumpRenderTreeSupportEfl::frameParent(const Evas_Object* ewkFram
 {
     DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, 0);
 
-    return frame->tree()->parent();
+    return frame->tree().parent();
 }
 
 void DumpRenderTreeSupportEfl::layoutFrame(Evas_Object* ewkFrame)
index 1139131..7a6e797 100644 (file)
@@ -161,11 +161,8 @@ static Eina_Bool _ewk_frame_children_iterator_next(Eina_Iterator_Ewk_Frame* iter
     EWK_FRAME_SD_GET_OR_RETURN(iterator->object, smartData, false);
     EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false);
 
-    WebCore::FrameTree* tree = smartData->frame->tree(); // check if it's still valid
-    EINA_SAFETY_ON_NULL_RETURN_VAL(tree, false);
-
-    if (iterator->currentIndex < tree->childCount()) {
-        *data = EWKPrivate::kitFrame(tree->child(iterator->currentIndex++));
+    if (iterator->currentIndex < smartData->frame->tree().childCount()) {
+        *data = EWKPrivate::kitFrame(smartData->frame->tree().child(iterator->currentIndex++));
         return true;
     }
 
@@ -332,7 +329,7 @@ Evas_Object* ewk_frame_child_find(Evas_Object* ewkFrame, const char* name)
     EINA_SAFETY_ON_NULL_RETURN_VAL(name, 0);
     EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, 0);
     WTF::String frameName = WTF::String::fromUTF8(name);
-    return EWKPrivate::kitFrame(smartData->frame->tree()->find(WTF::AtomicString(frameName)));
+    return EWKPrivate::kitFrame(smartData->frame->tree().find(WTF::AtomicString(frameName)));
 }
 
 Eina_Bool ewk_frame_uri_set(Evas_Object* ewkFrame, const char* uri)
@@ -366,7 +363,7 @@ const char* ewk_frame_name_get(const Evas_Object* ewkFrame)
         return 0;
     }
 
-    const WTF::String frameName = smartData->frame->tree()->uniqueName();
+    const WTF::String frameName = smartData->frame->tree().uniqueName();
 
     if ((smartData->name) && (smartData->name == frameName))
         return smartData->name;
@@ -1141,11 +1138,8 @@ bool ewk_frame_child_add(Evas_Object* ewkFrame, WTF::PassRefPtr<WebCore::Frame>
     }
 
     coreFrame = child.get();
-    if (coreFrame->tree())
-        coreFrame->tree()->setName(name);
-    else
-        ERR("no tree for child object");
-    smartData->frame->tree()->appendChild(child);
+    coreFrame->tree().setName(name);
+    smartData->frame->tree().appendChild(child);
 
     if (!ewk_frame_init(frame, smartData->view, coreFrame)) {
         evas_object_del(frame);
@@ -1167,7 +1161,7 @@ bool ewk_frame_child_add(Evas_Object* ewkFrame, WTF::PassRefPtr<WebCore::Frame>
 
     // The frame's onload handler may have removed it from the document.
     // See fast/dom/null-page-show-modal-dialog-crash.html for an example.
-    if (!coreFrame->tree()->parent()) {
+    if (!coreFrame->tree().parent()) {
         evas_object_del(frame);
         return true;
     }
index add5d0d..23040bf 100644 (file)
@@ -3682,7 +3682,7 @@ WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object* ewkView, Evas
     }
 
     // The creation of the frame may have removed itself already.
-    if (!coreFrame->page() || !coreFrame->tree() || !coreFrame->tree()->parent())
+    if (!coreFrame->page() || !coreFrame->tree().parent())
         return 0;
 
     smartData->changed.frame_rect = true;
index 3ac36fa..653d2ff 100644 (file)
@@ -1,3 +1,23 @@
+2013-08-24  Darin Adler  <darin@apple.com>
+
+        Frame::tree should return a reference instead of a pointer
+        https://bugs.webkit.org/show_bug.cgi?id=120259
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+        (DumpRenderTreeSupportGtk::getFrameChildren):
+        (DumpRenderTreeSupportGtk::clearMainFrameName):
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::createFrame):
+        * webkit/webkitwebframe.cpp:
+        (webkit_web_frame_get_name):
+        (webkit_web_frame_get_parent):
+        (webkit_web_frame_find_frame):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_set_highlight_text_matches):
+        Use tree(). instead of tree()->.
+
 2013-08-21  Zan Dobersek  <zdobersek@igalia.com>
 
         <https://webkit.org/b/119836> [GTK] ChromeClient::paint is susceptible to system time changes
index 8b06921..572749a 100644 (file)
@@ -127,7 +127,7 @@ GSList* DumpRenderTreeSupportGtk::getFrameChildren(WebKitWebFrame* frame)
         return 0;
 
     GSList* children = 0;
-    for (Frame* child = coreFrame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+    for (Frame* child = coreFrame->tree().firstChild(); child; child = child->tree().nextSibling()) {
         WebKitWebFrame* kitFrame = kit(child);
         if (kitFrame)
           children = g_slist_append(children, kitFrame);
@@ -232,7 +232,7 @@ void DumpRenderTreeSupportGtk::clearMainFrameName(WebKitWebFrame* frame)
 {
     g_return_if_fail(WEBKIT_IS_WEB_FRAME(frame));
 
-    core(frame)->tree()->clearName();
+    core(frame)->tree().clearName();
 }
 
 AtkObject* DumpRenderTreeSupportGtk::getRootAccessibleElement(WebKitWebFrame* frame)
index e2b02bf..9997986 100644 (file)
@@ -532,8 +532,8 @@ PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String&
     RefPtr<Frame> childFrame = Frame::create(page, ownerElement, new FrameLoaderClient(kitFrame));
     framePrivate->coreFrame = childFrame.get();
 
-    childFrame->tree()->setName(name);
-    parentFrame->tree()->appendChild(childFrame);
+    childFrame->tree().setName(name);
+    parentFrame->tree().appendChild(childFrame);
     childFrame->init();
 
     // The creation of the frame may have run arbitrary JavaScript that removed it from the page already.
@@ -545,7 +545,7 @@ PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String&
     parentFrame->loader().loadURLIntoChildFrame(url, referrer, childFrame.get());
 
     // The frame's onload handler may have removed it from the document.
-    if (!childFrame->tree()->parent())
+    if (!childFrame->tree().parent())
         return 0;
 
     return childFrame.release();
index acd7a69..f0d2abd 100644 (file)
@@ -630,7 +630,7 @@ const gchar* webkit_web_frame_get_name(WebKitWebFrame* frame)
         return "";
 
     WebKitWebFramePrivate* priv = frame->priv;
-    CString frameName = coreFrame->tree()->uniqueName().string().utf8();
+    CString frameName = coreFrame->tree().uniqueName().string().utf8();
     if (!g_strcmp0(frameName.data(), priv->name))
         return priv->name;
 
@@ -655,7 +655,7 @@ WebKitWebFrame* webkit_web_frame_get_parent(WebKitWebFrame* frame)
     if (!coreFrame)
         return 0;
 
-    return kit(coreFrame->tree()->parent());
+    return kit(coreFrame->tree().parent());
 }
 
 /**
@@ -828,7 +828,7 @@ WebKitWebFrame* webkit_web_frame_find_frame(WebKitWebFrame* frame, const gchar*
         return 0;
 
     String nameString = String::fromUTF8(name);
-    return kit(coreFrame->tree()->find(AtomicString(nameString)));
+    return kit(coreFrame->tree().find(AtomicString(nameString)));
 }
 
 /**
index c49a648..1a94633 100644 (file)
@@ -4394,7 +4394,7 @@ void webkit_web_view_set_highlight_text_matches(WebKitWebView* webView, gboolean
     Frame *frame = core(webView)->mainFrame();
     do {
         frame->editor().setMarkedTextMatchesAreHighlighted(shouldHighlight);
-        frame = frame->tree()->traverseNextWithWrap(false);
+        frame = frame->tree().traverseNextWithWrap(false);
     } while (frame);
 }
 
index 899abd3..d40e1bf 100644 (file)
@@ -1,3 +1,45 @@
+2013-08-24  Darin Adler  <darin@apple.com>
+
+        Frame::tree should return a reference instead of a pointer
+        https://bugs.webkit.org/show_bug.cgi?id=120259
+
+        Reviewed by Andreas Kling.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::performRequest):
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (-[WebBaseNetscapePluginView resolvedURLStringForURL:target:]):
+        * Plugins/WebNetscapePluginView.mm:
+        (-[WebNetscapePluginView loadPluginRequest:]):
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (applyAppleDictionaryApplicationQuirkNonInlinePart):
+        (WebFrameLoaderClient::prepareForDataSourceReplacement):
+        (WebFrameLoaderClient::createFrame):
+        * WebView/WebFrame.mm:
+        (+[WebFrame _createFrameWithPage:frameName:frameView:ownerElement:]):
+        (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]):
+        (-[WebFrame _unmarkAllBadGrammar]):
+        (-[WebFrame _unmarkAllMisspellings]):
+        (-[WebFrame _atMostOneFrameHasSelection]):
+        (-[WebFrame _findFrameWithSelection]):
+        (-[WebFrame _drawRect:contentsOnly:]):
+        (-[WebFrame _isDescendantOfFrame:]):
+        (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]):
+        (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]):
+        (-[WebFrame name]):
+        (-[WebFrame findFrameNamed:]):
+        (-[WebFrame parentFrame]):
+        (-[WebFrame childFrames]):
+        * WebView/WebView.mm:
+        (-[WebView _attachScriptDebuggerToAllFrames]):
+        (-[WebView _detachScriptDebuggerFromAllFrames]):
+        (-[WebView _clearMainFrameName]):
+        (-[WebView _isUsingAcceleratedCompositing]):
+        (-[WebView _isSoftwareRenderable]):
+        (-[WebView setHostWindow:]):
+        (incrementFrame):
+        Use tree(). instead of tree()->.
+
 2013-08-23  Beth Dakin  <bdakin@apple.com>
 
         REGRESSION (r132545): Some PDFs generated by WebKit are blank when viewed in 
index c33cb51..8c19524 100644 (file)
@@ -664,7 +664,7 @@ void NetscapePluginInstanceProxy::performRequest(PluginRequest* pluginRequest)
             }
             
             frame = [newWebView mainFrame];
-            core(frame)->tree()->setName(frameName);
+            core(frame)->tree().setName(frameName);
             [[newWebView _UIDelegateForwarder] webViewShow:newWebView];
         }
     }
index ea6b397..41c6d40 100644 (file)
@@ -840,7 +840,7 @@ using namespace WebCore;
     if (!frame)
         return CString();
 
-    Frame* targetFrame = frame->tree()->find(String::fromUTF8(target));
+    Frame* targetFrame = frame->tree().find(String::fromUTF8(target));
     if (!targetFrame)
         return CString();
     
index 7aa8197..0cf066c 100644 (file)
@@ -1679,7 +1679,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
             }
             
             frame = [newWebView mainFrame];
-            core(frame)->tree()->setName(frameName);
+            core(frame)->tree().setName(frameName);
             [[newWebView _UIDelegateForwarder] webViewShow:newWebView];
         }
     }
index 778d731..23bcae6 100644 (file)
@@ -178,7 +178,7 @@ static void applyAppleDictionaryApplicationQuirkNonInlinePart(WebFrameLoaderClie
     Frame* frame = core(client->webFrame());
     if (!frame)
         return;
-    if (frame->tree()->parent())
+    if (frame->tree().parent())
         return;
     Document* document = frame->document();
     if (!document)
@@ -1158,7 +1158,7 @@ void WebFrameLoaderClient::didFinishLoad()
 void WebFrameLoaderClient::prepareForDataSourceReplacement()
 {
     if (![m_webFrame.get() _dataSource]) {
-        ASSERT(!core(m_webFrame.get())->tree()->childCount());
+        ASSERT(!core(m_webFrame.get())->tree().childCount());
         return;
     }
     
@@ -1413,7 +1413,7 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
     core(m_webFrame.get())->loader().loadURLIntoChildFrame(url, referrer, result.get());
 
     // The frame's onload handler may have removed it from the document.
-    if (!result->tree()->parent())
+    if (!result->tree().parent())
         return 0;
 
     return result.release();
index 45e4e46..0c418b0 100644 (file)
@@ -268,10 +268,10 @@ WebView *getWebView(WebFrame *webFrame)
     [frame release];
     frame->_private->coreFrame = coreFrame.get();
 
-    coreFrame->tree()->setName(name);
+    coreFrame->tree().setName(name);
     if (ownerElement) {
         ASSERT(ownerElement->document()->frame());
-        ownerElement->document()->frame()->tree()->appendChild(coreFrame.get());
+        ownerElement->document()->frame()->tree().appendChild(coreFrame.get());
     }
 
     coreFrame->init();
@@ -362,7 +362,7 @@ WebView *getWebView(WebFrame *webFrame)
     NSColor *backgroundColor = [webView backgroundColor];
 
     Frame* coreFrame = _private->coreFrame;
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame)) {
         // Don't call setDrawsBackground:YES here because it may be NO because of a load
         // in progress; WebFrameLoaderClient keeps it set to NO during the load process.
         WebFrame *webFrame = kit(frame);
@@ -391,7 +391,7 @@ WebView *getWebView(WebFrame *webFrame)
 - (void)_unmarkAllBadGrammar
 {
     Frame* coreFrame = _private->coreFrame;
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame)) {
         if (Document* document = frame->document())
             document->markers().removeMarkers(DocumentMarker::Grammar);
     }
@@ -400,7 +400,7 @@ WebView *getWebView(WebFrame *webFrame)
 - (void)_unmarkAllMisspellings
 {
     Frame* coreFrame = _private->coreFrame;
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame)) {
         if (Document* document = frame->document())
             document->markers().removeMarkers(DocumentMarker::Spelling);
     }
@@ -434,7 +434,7 @@ WebView *getWebView(WebFrame *webFrame)
     // FIXME: 4186050 is one known case that makes this debug check fail.
     BOOL found = NO;
     Frame* coreFrame = _private->coreFrame;
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame))
         if ([kit(frame) _hasSelection]) {
             if (found)
                 return NO;
@@ -447,7 +447,7 @@ WebView *getWebView(WebFrame *webFrame)
 - (WebFrame *)_findFrameWithSelection
 {
     Frame* coreFrame = _private->coreFrame;
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame)) {
         WebFrame *webFrame = kit(frame);
         if ([webFrame _hasSelection])
             return webFrame;
@@ -541,7 +541,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     FrameView* view = _private->coreFrame->view();
     
     bool shouldFlatten = false;
-    if (Frame* parentFrame = _private->coreFrame->tree()->parent()) {
+    if (Frame* parentFrame = _private->coreFrame->tree().parent()) {
         // For subframes, we need to inherit the paint behavior from our parent
         FrameView* parentView = parentFrame ? parentFrame->view() : 0;
         if (parentView)
@@ -844,7 +844,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
 - (BOOL)_isDescendantOfFrame:(WebFrame *)ancestor
 {
     Frame* coreFrame = _private->coreFrame;
-    return coreFrame && coreFrame->tree()->isDescendantOf(core(ancestor));
+    return coreFrame && coreFrame->tree().isDescendantOf(core(ancestor));
 }
 
 - (void)_setShouldCreateRenderers:(BOOL)shouldCreateRenderers
@@ -919,7 +919,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
 - (void)_recursive_resumeNullEventsForAllNetscapePlugins
 {
     Frame* coreFrame = core(self);
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame)) {
         NSView <WebDocumentView> *documentView = [[kit(frame) frameView] documentView];
         if ([documentView isKindOfClass:[WebHTMLView class]])
             [(WebHTMLView *)documentView _resumeNullEventsForAllNetscapePlugins];
@@ -929,7 +929,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
 - (void)_recursive_pauseNullEventsForAllNetscapePlugins
 {
     Frame* coreFrame = core(self);
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame)) {
         NSView <WebDocumentView> *documentView = [[kit(frame) frameView] documentView];
         if ([documentView isKindOfClass:[WebHTMLView class]])
             [(WebHTMLView *)documentView _pauseNullEventsForAllNetscapePlugins];
@@ -1283,7 +1283,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     Frame* coreFrame = _private->coreFrame;
     if (!coreFrame)
         return nil;
-    return coreFrame->tree()->uniqueName();
+    return coreFrame->tree().uniqueName();
 }
 
 - (WebFrameView *)frameView
@@ -1459,7 +1459,7 @@ static NSURL *createUniqueWebDataURL()
     Frame* coreFrame = _private->coreFrame;
     if (!coreFrame)
         return nil;
-    return kit(coreFrame->tree()->find(name));
+    return kit(coreFrame->tree().find(name));
 }
 
 - (WebFrame *)parentFrame
@@ -1467,7 +1467,7 @@ static NSURL *createUniqueWebDataURL()
     Frame* coreFrame = _private->coreFrame;
     if (!coreFrame)
         return nil;
-    return [[kit(coreFrame->tree()->parent()) retain] autorelease];
+    return [[kit(coreFrame->tree().parent()) retain] autorelease];
 }
 
 - (NSArray *)childFrames
@@ -1475,8 +1475,8 @@ static NSURL *createUniqueWebDataURL()
     Frame* coreFrame = _private->coreFrame;
     if (!coreFrame)
         return [NSArray array];
-    NSMutableArray *children = [NSMutableArray arrayWithCapacity:coreFrame->tree()->childCount()];
-    for (Frame* child = coreFrame->tree()->firstChild(); child; child = child->tree()->nextSibling())
+    NSMutableArray *children = [NSMutableArray arrayWithCapacity:coreFrame->tree().childCount()];
+    for (Frame* child = coreFrame->tree().firstChild(); child; child = child->tree().nextSibling())
         [children addObject:kit(child)];
     return children;
 }
index d9bbb15..6796272 100644 (file)
@@ -2332,13 +2332,13 @@ static inline IMP getMethod(id o, SEL s)
 
 - (void)_attachScriptDebuggerToAllFrames
 {
-    for (Frame* frame = [self _mainCoreFrame]; frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = [self _mainCoreFrame]; frame; frame = frame->tree().traverseNext())
         [kit(frame) _attachScriptDebugger];
 }
 
 - (void)_detachScriptDebuggerFromAllFrames
 {
-    for (Frame* frame = [self _mainCoreFrame]; frame; frame = frame->tree()->traverseNext())
+    for (Frame* frame = [self _mainCoreFrame]; frame; frame = frame->tree().traverseNext())
         [kit(frame) _detachScriptDebugger];
 }
 
@@ -2454,7 +2454,7 @@ static inline IMP getMethod(id o, SEL s)
 
 - (void)_clearMainFrameName
 {
-    _private->page->mainFrame()->tree()->clearName();
+    _private->page->mainFrame()->tree().clearName();
 }
 
 - (void)setSelectTrailingWhitespaceEnabled:(BOOL)flag
@@ -2505,7 +2505,7 @@ static inline IMP getMethod(id o, SEL s)
 {
 #if USE(ACCELERATED_COMPOSITING)
     Frame* coreFrame = [self _mainCoreFrame];
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame)) {
         NSView *documentView = [[kit(frame) frameView] documentView];
         if ([documentView isKindOfClass:[WebHTMLView class]] && [(WebHTMLView *)documentView _isUsingAcceleratedCompositing])
             return YES;
@@ -2543,7 +2543,7 @@ static inline IMP getMethod(id o, SEL s)
 {
 #if USE(ACCELERATED_COMPOSITING)
     Frame* coreFrame = [self _mainCoreFrame];
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame)) {
         if (FrameView* view = frame->view()) {
             if (!view->isSoftwareRenderable())
                 return NO;
@@ -4212,7 +4212,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
         return;
 
     Frame* coreFrame = [self _mainCoreFrame];
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame))
         [[[kit(frame) frameView] documentView] viewWillMoveToHostWindow:hostWindow];
     if (_private->hostWindow && [self window] != _private->hostWindow)
         [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowWillCloseNotification object:_private->hostWindow];
@@ -4220,7 +4220,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillClose:) name:NSWindowWillCloseNotification object:hostWindow];
     [_private->hostWindow release];
     _private->hostWindow = [hostWindow retain];
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame))
         [[[kit(frame) frameView] documentView] viewDidMoveToHostWindow];
     _private->page->setDeviceScaleFactor([self _deviceScaleFactor]);
 }
@@ -4416,8 +4416,8 @@ static WebFrame *incrementFrame(WebFrame *frame, WebFindOptions options = 0)
 {
     Frame* coreFrame = core(frame);
     return kit((options & WebFindOptionsBackwards)
-        ? coreFrame->tree()->traversePreviousWithWrap(options & WebFindOptionsWrapAround)
-        : coreFrame->tree()->traverseNextWithWrap(options & WebFindOptionsWrapAround));
+        ? coreFrame->tree().traversePreviousWithWrap(options & WebFindOptionsWrapAround)
+        : coreFrame->tree().traverseNextWithWrap(options & WebFindOptionsWrapAround));
 }
 
 - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag
index 0c6076a..3416c73 100644 (file)
@@ -1,3 +1,28 @@
+2013-08-24  Darin Adler  <darin@apple.com>
+
+        Frame::tree should return a reference instead of a pointer
+        https://bugs.webkit.org/show_bug.cgi?id=120259
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::clearFrameName):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (drtDescriptionSuitableForTestResult):
+        (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidFinishDocumentLoad):
+        (WebCore::FrameLoaderClientQt::postProgressStartedNotification):
+        (WebCore::FrameLoaderClientQt::didPerformFirstNavigation):
+        (WebCore::FrameLoaderClientQt::createFrame):
+        * WebCoreSupport/QWebFrameAdapter.cpp:
+        (QWebFrameData::QWebFrameData):
+        (QWebFrameAdapter::load):
+        (QWebFrameAdapter::uniqueName):
+        (QWebFrameAdapter::childFrames):
+        * WebCoreSupport/QWebPageAdapter.cpp:
+        (QWebPageAdapter::findText):
+        Use tree(). instead of tree()->.
+
 2013-08-23  Allan Sandfeld Jensen  <allan.jensen@digia.com>
 
         [Qt] Update outdated source-paths in documentation
index a39b039..f2efab2 100644 (file)
@@ -279,7 +279,7 @@ void DumpRenderTreeSupportQt::setValueForUser(const QWebElement& element, const
 void DumpRenderTreeSupportQt::clearFrameName(QWebFrameAdapter *adapter)
 {
     Frame* coreFrame = adapter->frame;
-    coreFrame->tree()->clearName();
+    coreFrame->tree().clearName();
 }
 
 int DumpRenderTreeSupportQt::javaScriptObjectsCount()
index 95c0a2f..2ab32a6 100644 (file)
@@ -99,7 +99,7 @@ static QMap<unsigned long, QString> dumpAssignedUrls;
 static QString drtDescriptionSuitableForTestResult(WebCore::Frame* webCoreFrame)
 {
     QWebFrameAdapter* frame = QWebFrameAdapter::kit(webCoreFrame);
-    QString name = webCoreFrame->tree()->uniqueName();
+    QString name = webCoreFrame->tree().uniqueName();
 
     bool isMainFrame = frame == frame->pageAdapter->mainFrameAdapter();
     if (isMainFrame) {
@@ -481,7 +481,7 @@ void FrameLoaderClientQt::dispatchDidCommitLoad()
     if (dumpFrameLoaderCallbacks)
         printf("%s - didCommitLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
 
-    if (m_frame->tree()->parent() || !m_webFrame)
+    if (m_frame->tree().parent() || !m_webFrame)
         return;
 
     m_webFrame->emitUrlChanged();
@@ -511,7 +511,7 @@ void FrameLoaderClientQt::dispatchDidFinishDocumentLoad()
             printf("%s - has %u onunload handler(s)\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), unloadEventCount);
     }
 
-    if (m_frame->tree()->parent() || !m_webFrame)
+    if (m_frame->tree().parent() || !m_webFrame)
         return;
 
     m_webFrame->pageAdapter->updateNavigationActions();
@@ -563,7 +563,7 @@ void FrameLoaderClientQt::postProgressStartedNotification()
 {
     if (m_webFrame && m_frame->page())
         m_isOriginatingLoad = true;
-    if (m_frame->tree()->parent() || !m_webFrame)
+    if (m_frame->tree().parent() || !m_webFrame)
         return;
     m_webFrame->pageAdapter->updateNavigationActions();
 }
@@ -746,7 +746,7 @@ void FrameLoaderClientQt::documentElementAvailable()
 
 void FrameLoaderClientQt::didPerformFirstNavigation() const
 {
-    if (m_frame->tree()->parent() || !m_webFrame)
+    if (m_frame->tree().parent() || !m_webFrame)
         return;
     m_webFrame->pageAdapter->updateNavigationActions();
 }
@@ -1327,7 +1327,7 @@ PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String
     m_frame->loader().loadURLIntoChildFrame(urlToLoad, frameData.referrer, frameData.frame.get());
 
     // The frame's onload handler may have removed it from the document.
-    if (!frameData.frame->tree()->parent())
+    if (!frameData.frame->tree().parent())
         return 0;
 
     return frameData.frame.release();
index 7877be8..547a94d 100644 (file)
@@ -94,9 +94,9 @@ QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFr
     frame = Frame::create(page, ownerElement, frameLoaderClient);
 
     // FIXME: All of the below should probably be moved over into WebCore
-    frame->tree()->setName(name);
+    frame->tree().setName(name);
     if (parentFrame)
-        parentFrame->tree()->appendChild(frame);
+        parentFrame->tree().appendChild(frame);
 }
 
 QWebFrameAdapter::QWebFrameAdapter()
@@ -119,7 +119,7 @@ QWebFrameAdapter::~QWebFrameAdapter()
 
 void QWebFrameAdapter::load(const QNetworkRequest& req, QNetworkAccessManager::Operation operation, const QByteArray& body)
 {
-    if (frame->tree()->parent())
+    if (frame->tree().parent())
         pageAdapter->insideOpenCall = true;
 
     QUrl url = ensureAbsoluteUrl(req.url());
@@ -169,7 +169,7 @@ void QWebFrameAdapter::load(const QNetworkRequest& req, QNetworkAccessManager::O
 
     frame->loader().load(WebCore::FrameLoadRequest(frame, request));
 
-    if (frame->tree()->parent())
+    if (frame->tree().parent())
         pageAdapter->insideOpenCall = false;
 }
 
@@ -464,7 +464,7 @@ QWebSecurityOrigin QWebFrameAdapter::securityOrigin() const
 
 QString QWebFrameAdapter::uniqueName() const
 {
-    return frame->tree()->uniqueName();
+    return frame->tree().uniqueName();
 }
 
 // This code is copied from ChromeClientGtk.cpp.
@@ -690,8 +690,7 @@ QList<QObject*> QWebFrameAdapter::childFrames() const
 {
     QList<QObject*> originatingObjects;
     if (frame) {
-        FrameTree* tree = frame->tree();
-        for (Frame* child = tree->firstChild(); child; child = child->tree()->nextSibling()) {
+        for (Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
             FrameLoader& loader = child->loader();
             originatingObjects.append(loader.networkingContext()->originatingObject());
         }
index f016a5e..9e3a328 100644 (file)
@@ -422,10 +422,10 @@ bool QWebPageAdapter::findText(const QString& subString, FindFlag options)
 
     if (subString.isEmpty()) {
         page->mainFrame()->selection().clear();
-        Frame* frame = page->mainFrame()->tree()->firstChild();
+        Frame* frame = page->mainFrame()->tree().firstChild();
         while (frame) {
             frame->selection().clear();
-            frame = frame->tree()->traverseNextWithWrap(false);
+            frame = frame->tree().traverseNextWithWrap(false);
         }
     }
 
index 24de21e..94a914f 100644 (file)
@@ -1,3 +1,29 @@
+2013-08-24  Darin Adler  <darin@apple.com>
+
+        Frame::tree should return a reference instead of a pointer
+        https://bugs.webkit.org/show_bug.cgi?id=120259
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::createFrame):
+        * WebFrame.cpp:
+        (WebFrame::name):
+        (WebFrame::findFrameNamed):
+        (WebFrame::parentFrame):
+        (EnumChildFrames::EnumChildFrames):
+        (EnumChildFrames::Next):
+        (EnumChildFrames::Skip):
+        (EnumChildFrames::Reset):
+        (WebFrame::isDescendantOfFrame):
+        (WebFrame::unmarkAllMisspellings):
+        (WebFrame::unmarkAllBadGrammar):
+        * WebView.cpp:
+        (WebView::initWithFrame):
+        (incrementFrame):
+        (WebView::clearMainFrameName):
+        Use tree(). instead of tree()->.
+
 2013-08-23  Brent Fulgham  <bfulgham@apple.com>
 
         [Windows] Refactor WebFrame to compose with WebFrameLoaderClient
index e0cf36c..8cab681 100644 (file)
@@ -1091,14 +1091,14 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& URL, const Strin
 
     RefPtr<Frame> childFrame = webFrame->init(m_webFrame->webView(), coreFrame->page(), ownerElement);
 
-    childFrame->tree()->setName(name);
-    coreFrame->tree()->appendChild(childFrame);
+    childFrame->tree().setName(name);
+    coreFrame->tree().appendChild(childFrame);
     childFrame->init();
 
     coreFrame->loader().loadURLIntoChildFrame(URL, referrer, childFrame.get());
 
     // The frame's onload handler may have removed it from the document.
-    if (!childFrame->tree()->parent())
+    if (!childFrame->tree().parent())
         return 0;
 
     return childFrame.release();
index 18495cd..01eacce 100644 (file)
@@ -426,7 +426,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::name(
     if (!coreFrame)
         return E_FAIL;
 
-    *frameName = BString(coreFrame->tree()->uniqueName()).release();
+    *frameName = BString(coreFrame->tree().uniqueName()).release();
     return S_OK;
 }
 
@@ -742,7 +742,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::findFrameNamed(
     if (!coreFrame)
         return E_FAIL;
 
-    Frame* foundFrame = coreFrame->tree()->find(AtomicString(name, SysStringLen(name)));
+    Frame* foundFrame = coreFrame->tree().find(AtomicString(name, SysStringLen(name)));
     if (!foundFrame)
         return S_OK;
 
@@ -759,7 +759,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::parentFrame(
     HRESULT hr = S_OK;
     *frame = 0;
     if (Frame* coreFrame = core(this))
-        if (WebFrame* webFrame = kit(coreFrame->tree()->parent()))
+        if (WebFrame* webFrame = kit(coreFrame->tree().parent()))
             hr = webFrame->QueryInterface(IID_IWebFrame, (void**) frame);
 
     return hr;
@@ -768,7 +768,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::parentFrame(
 class EnumChildFrames : public IEnumVARIANT
 {
 public:
-    EnumChildFrames(Frame* f) : m_refCount(1), m_frame(f), m_curChild(f ? f->tree()->firstChild() : 0) { }
+    EnumChildFrames(Frame* f) : m_refCount(1), m_frame(f), m_curChild(f ? f->tree().firstChild() : 0) { }
 
     virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject)
     {
@@ -816,7 +816,7 @@ public:
         V_VT(rgVar) = VT_UNKNOWN;
         V_UNKNOWN(rgVar) = unknown;
 
-        m_curChild = m_curChild->tree()->nextSibling();
+        m_curChild = m_curChild->tree().nextSibling();
         if (pCeltFetched)
             *pCeltFetched = 1;
         return S_OK;
@@ -827,7 +827,7 @@ public:
         if (!m_frame)
             return S_FALSE;
         for (unsigned i = 0; i < celt && m_curChild; i++)
-            m_curChild = m_curChild->tree()->nextSibling();
+            m_curChild = m_curChild->tree().nextSibling();
         return m_curChild ? S_OK : S_FALSE;
     }
 
@@ -835,7 +835,7 @@ public:
     {
         if (!m_frame)
             return S_FALSE;
-        m_curChild = m_frame->tree()->firstChild();
+        m_curChild = m_frame->tree().firstChild();
         return S_OK;
     }
 
@@ -2019,7 +2019,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::isDescendantOfFrame(
     if (!ancestorWebFrame)
         return S_OK;
 
-    *result = (coreFrame && coreFrame->tree()->isDescendantOf(core(ancestorWebFrame.get()))) ? TRUE : FALSE;
+    *result = (coreFrame && coreFrame->tree().isDescendantOf(core(ancestorWebFrame.get()))) ? TRUE : FALSE;
     return S_OK;
 }
 
@@ -2072,7 +2072,7 @@ HRESULT WebFrame::stringByEvaluatingJavaScriptInScriptWorld(IWebScriptWorld* iWo
 void WebFrame::unmarkAllMisspellings()
 {
     Frame* coreFrame = core(this);
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame)) {
         Document *doc = frame->document();
         if (!doc)
             return;
@@ -2084,7 +2084,7 @@ void WebFrame::unmarkAllMisspellings()
 void WebFrame::unmarkAllBadGrammar()
 {
     Frame* coreFrame = core(this);
-    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
+    for (Frame* frame = coreFrame; frame; frame = frame->tree().traverseNext(coreFrame)) {
         Document *doc = frame->document();
         if (!doc)
             return;
index 2f02d74..0ef4232 100644 (file)
@@ -2740,7 +2740,7 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
     m_mainFrame = webFrame;
     webFrame->Release(); // The WebFrame is owned by the Frame, so release our reference to it.
 
-    coreFrame->tree()->setName(toString(frameName));
+    coreFrame->tree().setName(toString(frameName));
     coreFrame->init();
     setGroupName(groupName);
 
@@ -3442,8 +3442,8 @@ HRESULT STDMETHODCALLTYPE WebView::hostWindow(
 static Frame *incrementFrame(Frame *curr, bool forward, bool wrapFlag)
 {
     return forward
-        ? curr->tree()->traverseNextWithWrap(wrapFlag)
-        : curr->tree()->traversePreviousWithWrap(wrapFlag);
+        ? curr->tree().traverseNextWithWrap(wrapFlag)
+        : curr->tree().traversePreviousWithWrap(wrapFlag);
 }
 
 HRESULT STDMETHODCALLTYPE WebView::searchFor( 
@@ -3501,7 +3501,7 @@ HRESULT STDMETHODCALLTYPE WebView::executeCoreCommandByName(BSTR name, BSTR valu
 
 HRESULT STDMETHODCALLTYPE WebView::clearMainFrameName()
 {
-    m_page->mainFrame()->tree()->clearName();
+    m_page->mainFrame()->tree().clearName();
 
     return S_OK;
 }
index 3a1d58c..3e0a6a8 100644 (file)
@@ -1,3 +1,14 @@
+2013-08-24  Darin Adler  <darin@apple.com>
+
+        Frame::tree should return a reference instead of a pointer
+        https://bugs.webkit.org/show_bug.cgi?id=120259
+
+        Reviewed by Andreas Kling.
+
+        * WebView.cpp:
+        (WebView::createFrame):
+        Use tree(). instead of tree()->.
+
 2013-08-19  Pratik Solanki  <psolanki@apple.com>
 
         <https://webkit.org/b/119918> Frame::selection() should return a reference
index e46c5f6..2a6c300 100644 (file)
@@ -164,8 +164,8 @@ PassRefPtr<Frame> WebView::createFrame(const KURL& url, const String& name, HTML
     RefPtr<Frame> childFrame = Frame::create(m_page, ownerElement, loaderClient);
     loaderClient->setFrame(childFrame.get());
 
-    coreFrame->tree()->appendChild(childFrame);
-    childFrame->tree()->setName(name);
+    coreFrame->tree().appendChild(childFrame);
+    childFrame->tree().setName(name);
     childFrame->init();
 
     // The creation of the frame may have run arbitrary JavaScript that removed it from the page already.
@@ -175,7 +175,7 @@ PassRefPtr<Frame> WebView::createFrame(const KURL& url, const String& name, HTML
     coreFrame->loader().loadURLIntoChildFrame(url, referrer, childFrame.get());
 
     // The frame's onload handler may have removed it from the document.
-    if (!childFrame->tree()->parent())
+    if (!childFrame->tree().parent())
         return 0;
 
     return childFrame.release();
index 29b598b..8e9cb85 100644 (file)
@@ -1,3 +1,40 @@
+2013-08-24  Darin Adler  <darin@apple.com>
+
+        Frame::tree should return a reference instead of a pointer
+        https://bugs.webkit.org/show_bug.cgi?id=120259
+
+        Reviewed by Andreas Kling.
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::performJavaScriptURLRequest):
+        * WebProcess/Storage/StorageAreaMap.cpp:
+        (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
+        (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::createFrame):
+        * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
+        (WebKit::WebContextMenuClient::searchWithSpotlight):
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::frameWithSelection):
+        (WebKit::FindController::rectsForTextMatches):
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::init):
+        (WebKit::WebFrame::contentsAsString):
+        (WebKit::WebFrame::name):
+        (WebKit::WebFrame::childFrames):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::clearMainFrameName):
+        (WebKit::WebPage::setDrawsBackground):
+        (WebKit::WebPage::setDrawsTransparentBackground):
+        (WebKit::WebPage::setWindowResizerSize):
+        (WebKit::frameWithSelection):
+        (WebKit::WebPage::unmarkAllMisspellings):
+        (WebKit::WebPage::unmarkAllBadGrammar):
+        (WebKit::pageContainsAnyHorizontalScrollbars):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::forceRepaint):
+        Use tree(). instead of tree()->.
+
 2013-08-24  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r154545.
index e6466ba..b9bf7a1 100644 (file)
@@ -1166,7 +1166,7 @@ void PluginView::performJavaScriptURLRequest(URLRequest* request)
 
     if (!request->target().isNull()) {
         // For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
-        if (frame->tree()->find(request->target()) != frame) {
+        if (frame->tree().find(request->target()) != frame) {
             // Let the plug-in know that its frame load failed.
             m_plugin->frameDidFail(request->requestID(), false);
             return;
index 4a8582d..b8c615b 100644 (file)
@@ -312,7 +312,7 @@ void StorageAreaMap::dispatchSessionStorageEvent(uint64_t sourceStorageAreaID, c
     Vector<RefPtr<Frame>> frames;
 
     Page* page = webPage->corePage();
-    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         Document* document = frame->document();
         if (!document->securityOrigin()->equal(m_securityOrigin.get()))
             continue;
@@ -342,7 +342,7 @@ void StorageAreaMap::dispatchLocalStorageEvent(uint64_t sourceStorageAreaID, con
     PageGroup& pageGroup = *WebProcess::shared().webPageGroup(m_storageNamespaceID)->corePageGroup();
     const HashSet<Page*>& pages = pageGroup.pages();
     for (HashSet<Page*>::const_iterator it = pages.begin(), end = pages.end(); it != end; ++it) {
-        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+        for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().traverseNext()) {
             Document* document = frame->document();
             if (!document->securityOrigin()->equal(m_securityOrigin.get()))
                 continue;
index 44f51f1..c13aba0 100644 (file)
@@ -1276,7 +1276,7 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
     if (!subframe->coreFrame())
         return 0;
     ASSERT(subframe->coreFrame() == coreSubframe);
-    if (!coreSubframe->tree()->parent())
+    if (!coreSubframe->tree().parent())
         return 0;
 
     return coreSubframe;
index 9485179..a579ec3 100644 (file)
@@ -78,7 +78,7 @@ void WebContextMenuClient::searchWithSpotlight()
     Frame* mainFrame = m_page->corePage()->mainFrame();
     
     Frame* selectionFrame = mainFrame;
-    for (; selectionFrame; selectionFrame = selectionFrame->tree()->traverseNext(mainFrame)) {
+    for (; selectionFrame; selectionFrame = selectionFrame->tree().traverseNext(mainFrame)) {
         if (selectionFrame->selection().isRange())
             break;
     }
index 3826890..e61ec7a 100644 (file)
@@ -98,7 +98,7 @@ void FindController::countStringMatches(const String& string, FindOptions option
 
 static Frame* frameWithSelection(Page* page)
 {
-    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->selection().isRange())
             return frame;
     }
@@ -350,7 +350,7 @@ Vector<IntRect> FindController::rectsForTextMatches()
 {
     Vector<IntRect> rects;
 
-    for (Frame* frame = m_webPage->corePage()->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_webPage->corePage()->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         Document* document = frame->document();
         if (!document)
             continue;
index bcec71d..d605cc2 100644 (file)
@@ -164,11 +164,11 @@ void WebFrame::init(WebPage* page, const String& frameName, HTMLFrameOwnerElemen
     RefPtr<Frame> frame = Frame::create(page->corePage(), ownerElement, &m_frameLoaderClient);
     m_coreFrame = frame.get();
 
-    frame->tree()->setName(frameName);
+    frame->tree().setName(frameName);
 
     if (ownerElement) {
         ASSERT(ownerElement->document()->frame());
-        ownerElement->document()->frame()->tree()->appendChild(frame);
+        ownerElement->document()->frame()->tree().appendChild(frame);
     }
 
     frame->init();
@@ -311,7 +311,7 @@ String WebFrame::contentsAsString() const
 
     if (isFrameSet()) {
         StringBuilder builder;
-        for (Frame* child = m_coreFrame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+        for (Frame* child = m_coreFrame->tree().firstChild(); child; child = child->tree().nextSibling()) {
             if (!builder.isEmpty())
                 builder.append(' ');
 
@@ -387,7 +387,7 @@ String WebFrame::name() const
     if (!m_coreFrame)
         return String();
 
-    return m_coreFrame->tree()->uniqueName();
+    return m_coreFrame->tree().uniqueName();
 }
 
 String WebFrame::url() const
@@ -427,14 +427,14 @@ PassRefPtr<ImmutableArray> WebFrame::childFrames()
     if (!m_coreFrame)
         return ImmutableArray::create();
 
-    size_t size = m_coreFrame->tree()->childCount();
+    size_t size = m_coreFrame->tree().childCount();
     if (!size)
         return ImmutableArray::create();
 
     Vector<RefPtr<APIObject>> vector;
     vector.reserveInitialCapacity(size);
 
-    for (Frame* child = m_coreFrame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
+    for (Frame* child = m_coreFrame->tree().firstChild(); child; child = child->tree().nextSibling()) {
         WebFrameLoaderClient* webFrameLoaderClient = toWebFrameLoaderClient(child->loader().client());
         WebFrame* webFrame = webFrameLoaderClient ? webFrameLoaderClient->webFrame() : 0;
         ASSERT(webFrame);
index 24ca2f2..dd68cea 100644 (file)
@@ -790,7 +790,7 @@ bool WebPage::isEditingCommandEnabled(const String& commandName)
 void WebPage::clearMainFrameName()
 {
     if (Frame* frame = mainFrame())
-        frame->tree()->clearName();
+        frame->tree().clearName();
 }
 
 #if USE(ACCELERATED_COMPOSITING)
@@ -2018,7 +2018,7 @@ void WebPage::setDrawsBackground(bool drawsBackground)
 
     m_drawsBackground = drawsBackground;
 
-    for (Frame* coreFrame = m_mainFrame->coreFrame(); coreFrame; coreFrame = coreFrame->tree()->traverseNext()) {
+    for (Frame* coreFrame = m_mainFrame->coreFrame(); coreFrame; coreFrame = coreFrame->tree().traverseNext()) {
         if (FrameView* view = coreFrame->view())
             view->setTransparent(!drawsBackground);
     }
@@ -2035,7 +2035,7 @@ void WebPage::setDrawsTransparentBackground(bool drawsTransparentBackground)
     m_drawsTransparentBackground = drawsTransparentBackground;
 
     Color backgroundColor = drawsTransparentBackground ? Color::transparent : Color::white;
-    for (Frame* coreFrame = m_mainFrame->coreFrame(); coreFrame; coreFrame = coreFrame->tree()->traverseNext()) {
+    for (Frame* coreFrame = m_mainFrame->coreFrame(); coreFrame; coreFrame = coreFrame->tree().traverseNext()) {
         if (FrameView* view = coreFrame->view())
             view->setBaseBackgroundColor(backgroundColor);
     }
@@ -2098,7 +2098,7 @@ void WebPage::setWindowResizerSize(const IntSize& windowResizerSize)
 
     m_windowResizerSize = windowResizerSize;
 
-    for (Frame* coreFrame = m_mainFrame->coreFrame(); coreFrame; coreFrame = coreFrame->tree()->traverseNext()) {
+    for (Frame* coreFrame = m_mainFrame->coreFrame(); coreFrame; coreFrame = coreFrame->tree().traverseNext()) {
         FrameView* view = coreFrame->view();
         if (view)
             view->windowResizerRectChanged();
@@ -2286,7 +2286,7 @@ void WebPage::getRenderTreeExternalRepresentation(uint64_t callbackID)
 
 static Frame* frameWithSelection(Page* page)
 {
-    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (frame->selection().isRange())
             return frame;
     }
@@ -2949,7 +2949,7 @@ void WebPage::changeSpellingToWord(const String& word)
 
 void WebPage::unmarkAllMisspellings()
 {
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (Document* document = frame->document())
             document->markers().removeMarkers(DocumentMarker::Spelling);
     }
@@ -2957,7 +2957,7 @@ void WebPage::unmarkAllMisspellings()
 
 void WebPage::unmarkAllBadGrammar()
 {
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (Document* document = frame->document())
             document->markers().removeMarkers(DocumentMarker::Grammar);
     }
@@ -3684,7 +3684,7 @@ static bool pageContainsAnyHorizontalScrollbars(Frame* mainFrame)
             return true;
     }
 
-    for (Frame* frame = mainFrame; frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = mainFrame; frame; frame = frame->tree().traverseNext()) {
         FrameView* frameView = frame->view();
         if (!frameView)
             continue;
index 4e74d8f..d8d05b0 100644 (file)
@@ -143,7 +143,7 @@ void TiledCoreAnimationDrawingArea::forceRepaint()
     if (m_layerTreeStateIsFrozen)
         return;
 
-    for (Frame* frame = m_webPage->corePage()->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+    for (Frame* frame = m_webPage->corePage()->mainFrame(); frame; frame = frame->tree().traverseNext()) {
         FrameView* frameView = frame->view();
         if (!frameView || !frameView->tiledBacking())
             continue;