<https://webkit.org/b/120000> Chrome::client() should return a reference.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Aug 2013 10:56:27 +0000 (10:56 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Aug 2013 10:56:27 +0000 (10:56 +0000)
Reviewed by Antti Koivisto.

Chrome::m_client should never be null.

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

54 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/accessibility/win/AXObjectCacheWin.cpp
Source/WebCore/css/CSSDefaultStyleSheets.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/history/CachedFrame.cpp
Source/WebCore/html/HTMLFormControlElementWithState.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/SubframeLoader.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
Source/WebCore/page/AutoscrollController.cpp
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/Chrome.h
Source/WebCore/page/Console.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/PageConsole.cpp
Source/WebCore/page/PageGroup.cpp
Source/WebCore/page/PageThrottler.cpp
Source/WebCore/page/PointerLockController.cpp
Source/WebCore/page/mac/ChromeMac.mm
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/platform/blackberry/LocalFileSystemBlackBerry.cpp
Source/WebCore/platform/network/FormData.cpp
Source/WebCore/platform/network/blackberry/NetworkJob.cpp
Source/WebCore/platform/qt/RenderThemeQStyle.cpp
Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp
Source/WebCore/plugins/win/PluginViewWin.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/efl/WebCoreSupport/PopupMenuEfl.cpp
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp
Source/WebKit/qt/WebCoreSupport/PlatformStrategiesQt.cpp
Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp
Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 5e0d22db17b8e25a54a84fe2492de4912db55ea2..d2a3275bad858f531af74078416d298a4c12d2c7 100644 (file)
@@ -1,3 +1,11 @@
+2013-08-19  Andreas Kling  <akling@apple.com>
+
+        <https://webkit.org/b/120000> Chrome::client() should return a reference.
+
+        Reviewed by Antti Koivisto.
+
+        Chrome::m_client should never be null.
+
 2013-08-19  Antti Koivisto  <antti@apple.com>
 
         <https://webkit.org/b/120004> Rename StyleElement to InlineStyleSheetOwner and stop inheriting from it
index e5c93cdd2951f28aeb907b9e1ad3d6c80ee13e13..25b7aa0f700b903718a97652acf935ecfbc9683a 100644 (file)
@@ -220,7 +220,7 @@ void DatabaseContext::databaseExceededQuota(const String& name, DatabaseDetails
     if (m_scriptExecutionContext->isDocument()) {
         Document* document = toDocument(m_scriptExecutionContext);
         if (Page* page = document->page())
-            page->chrome().client()->exceededDatabaseQuota(document->frame(), name, details);
+            page->chrome().client().exceededDatabaseQuota(document->frame(), name, details);
         return;
     }
     ASSERT(m_scriptExecutionContext->isWorkerGlobalScope());
index 5fc81b17fa934e84ff2777915e63ba62ec8807c8..3040dca4b9f0015cce0766065e11f51502971075 100644 (file)
@@ -1540,7 +1540,7 @@ static NSMutableArray* convertToNSArray(const AccessibilityObject::Accessibility
         
         // If we have an empty chrome client (like SVG) then we should use the page
         // of the scroll view parent to help us get to the screen rect.
-        if (parent && page && page->chrome().client()->isEmptyChromeClient())
+        if (parent && page && page->chrome().client().isEmptyChromeClient())
             page = parent->page();
         
         if (page) {
@@ -3089,12 +3089,12 @@ static NSString* roleValueToNSString(AccessibilityRole value)
             FrameView* frameView = m_object->documentFrameView();
             Page* page = m_object->page();
             if (page && frameView) {
-                ChromeClient* client = page->chrome().client();
-                client->focus();
+                ChromeClient& chromeClient = page->chrome().client();
+                chromeClient.focus();
                 if (frameView->platformWidget())
-                    client->makeFirstResponder(frameView->platformWidget());
+                    chromeClient.makeFirstResponder(frameView->platformWidget());
                 else
-                    client->makeFirstResponder();
+                    chromeClient.makeFirstResponder();
             }
         }
         
index 54fe4a76a84ac6879a23fee42d754be80ee7c1d2..93186461801d7958556072963d07b3ffed2d4241 100644 (file)
@@ -142,9 +142,9 @@ void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject* o
         return;
 
     if (notification == AXLoadingStarted)
-        page->chrome().client()->AXStartFrameLoad();
+        page->chrome().client().AXStartFrameLoad();
     else if (notification == AXLoadingFinished)
-        page->chrome().client()->AXFinishFrameLoad();
+        page->chrome().client().AXFinishFrameLoad();
 }
 
 AXID AXObjectCache::platformGenerateAXID() const
index 48735d667a6b85349a7613376a82a299dee726eb..9accb362ec78de700da283249fd8bfb870374679 100644 (file)
@@ -203,7 +203,7 @@ void CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(Element* element,
 #endif
 
     if (!plugInsStyleSheet && (element->hasTagName(objectTag) || element->hasTagName(embedTag))) {
-        String plugInsRules = RenderTheme::themeForPage(element->document()->page())->extraPlugInsStyleSheet() + element->document()->page()->chrome().client()->plugInExtraStyleSheet();
+        String plugInsRules = RenderTheme::themeForPage(element->document()->page())->extraPlugInsStyleSheet() + element->document()->page()->chrome().client().plugInExtraStyleSheet();
         if (plugInsRules.isEmpty())
             plugInsRules = String(plugInsUserAgentStyleSheet, sizeof(plugInsUserAgentStyleSheet));
         plugInsStyleSheet = parseUASheet(plugInsRules);
index 8eb4c2fbcb95660a0c685fc753214b1823f27eb8..5e7f1efabc9e3b05ff76727a4b1c5a1708c54fb2 100644 (file)
@@ -4981,12 +4981,12 @@ void Document::requestFullScreenForElement(Element* element, unsigned short flag
         if (!page() || !page()->settings().fullScreenEnabled())
             break;
 
-        if (!page()->chrome().client()->supportsFullScreenForElement(element, flags & Element::ALLOW_KEYBOARD_INPUT)) {
+        if (!page()->chrome().client().supportsFullScreenForElement(element, flags & Element::ALLOW_KEYBOARD_INPUT)) {
             // The new full screen API does not accept a "flags" parameter, so fall back to disallowing
             // keyboard input if the chrome client refuses to allow keyboard input.
             if (!inLegacyMozillaMode && flags & Element::ALLOW_KEYBOARD_INPUT) {
                 flags &= ~Element::ALLOW_KEYBOARD_INPUT;
-                if (!page()->chrome().client()->supportsFullScreenForElement(element, false))
+                if (!page()->chrome().client().supportsFullScreenForElement(element, false))
                     break;
             } else
                 break;
@@ -5041,7 +5041,7 @@ void Document::requestFullScreenForElement(Element* element, unsigned short flag
         // 5. Return, and run the remaining steps asynchronously.
         // 6. Optionally, perform some animation.
         m_areKeysEnabledInFullScreen = flags & Element::ALLOW_KEYBOARD_INPUT;
-        page()->chrome().client()->enterFullScreenForElement(element);
+        page()->chrome().client().enterFullScreenForElement(element);
 
         // 7. Optionally, display a message indicating how the user can exit displaying the context object fullscreen.
         return;
@@ -5132,12 +5132,12 @@ void Document::webkitExitFullscreen()
     // Only exit out of full screen window mode if there are no remaining elements in the 
     // full screen stack.
     if (!newTop) {
-        page()->chrome().client()->exitFullScreenForElement(m_fullScreenElement.get());
+        page()->chrome().client().exitFullScreenForElement(m_fullScreenElement.get());
         return;
     }
 
     // Otherwise, notify the chrome of the new full screen element.
-    page()->chrome().client()->enterFullScreenForElement(newTop);
+    page()->chrome().client().enterFullScreenForElement(newTop);
 }
 
 bool Document::webkitFullscreenEnabled() const
@@ -5262,7 +5262,7 @@ void Document::setFullScreenRenderer(RenderFullScreen* renderer)
     
     // This notification can come in after the page has been destroyed.
     if (page())
-        page()->chrome().client()->fullScreenRendererChanged(m_fullScreenRenderer);
+        page()->chrome().client().fullScreenRendererChanged(m_fullScreenRenderer);
 }
 
 void Document::fullScreenRendererDestroyed()
@@ -5270,7 +5270,7 @@ void Document::fullScreenRendererDestroyed()
     m_fullScreenRenderer = 0;
 
     if (page())
-        page()->chrome().client()->fullScreenRendererChanged(0);
+        page()->chrome().client().fullScreenRendererChanged(0);
 }
 
 void Document::fullScreenChangeDelayTimerFired(Timer<Document>*)
@@ -5553,7 +5553,7 @@ void Document::didAddTouchEventHandler(Node* handler)
             scrollingCoordinator->touchEventTargetRectsDidChange(this);
 #endif
         if (m_touchEventTargets->size() == 1)
-            page->chrome().client()->needTouchEvents(true);
+            page->chrome().client().needTouchEvents(true);
     }
 #else
     UNUSED_PARAM(handler);
@@ -5585,7 +5585,7 @@ void Document::didRemoveTouchEventHandler(Node* handler)
         if (frame->document() && frame->document()->hasTouchEventHandlers())
             return;
     }
-    page->chrome().client()->needTouchEvents(false);
+    page->chrome().client().needTouchEvents(false);
 #else
     UNUSED_PARAM(handler);
 #endif
@@ -5942,7 +5942,7 @@ PassRefPtr<FontLoader> Document::fontloader()
 
 void Document::didAssociateFormControl(Element* element)
 {
-    if (!frame() || !frame()->page() || !frame()->page()->chrome().client()->shouldNotifyOnFormChanges())
+    if (!frame() || !frame()->page() || !frame()->page()->chrome().client().shouldNotifyOnFormChanges())
         return;
     m_associatedFormControls.add(element);
     if (!m_didAssociateFormControlsTimer.isActive())
@@ -5958,7 +5958,7 @@ void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer)
     Vector<RefPtr<Element> > associatedFormControls;
     copyToVector(m_associatedFormControls, associatedFormControls);
 
-    frame()->page()->chrome().client()->didAssociateFormControls(associatedFormControls);
+    frame()->page()->chrome().client().didAssociateFormControls(associatedFormControls);
     m_associatedFormControls.clear();
 }
 
@@ -5968,7 +5968,7 @@ void Document::ensurePlugInsInjectedScript(DOMWrapperWorld* world)
         return;
 
     // Use the JS file provided by the Chrome client, or fallback to the default one.
-    String jsString = page()->chrome().client()->plugInExtraScript();
+    String jsString = page()->chrome().client().plugInExtraScript();
     if (!jsString)
         jsString = plugInsJavaScript;
 
index 513b1c67ec27198d499cc17e317a8d0f412bc25d..8dc86bfbaa3c9943dffe132840c21f96855b93ca 100644 (file)
@@ -474,7 +474,7 @@ void Element::setActive(bool flag, bool pause)
     // The rest of this function implements a feature that only works if the
     // platform supports immediate invalidations on the ChromeClient, so bail if
     // that isn't supported.
-    if (!document()->page()->chrome().client()->supportsImmediateInvalidation())
+    if (!document()->page()->chrome().client().supportsImmediateInvalidation())
         return;
 
     if (reactsToPress && pause) {
@@ -2013,7 +2013,7 @@ void Element::dispatchFocusOutEvent(const AtomicString& eventType, PassRefPtr<El
 void Element::dispatchFocusEvent(PassRefPtr<Element> oldFocusedElement, FocusDirection)
 {
     if (document()->page())
-        document()->page()->chrome().client()->elementDidFocus(this);
+        document()->page()->chrome().client().elementDidFocus(this);
 
     RefPtr<FocusEvent> event = FocusEvent::create(eventNames().focusEvent, false, false, document()->defaultView(), 0, oldFocusedElement);
     EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(event.release()));
@@ -2022,7 +2022,7 @@ void Element::dispatchFocusEvent(PassRefPtr<Element> oldFocusedElement, FocusDir
 void Element::dispatchBlurEvent(PassRefPtr<Element> newFocusedElement)
 {
     if (document()->page())
-        document()->page()->chrome().client()->elementDidBlur(this);
+        document()->page()->chrome().client().elementDidBlur(this);
 
     RefPtr<FocusEvent> event = FocusEvent::create(eventNames().blurEvent, false, false, document()->defaultView(), 0, newFocusedElement);
     EventDispatcher::dispatchEvent(this, BlurEventDispatchMediator::create(event.release()));
index 75c2d9ac46b900341f4430a46fabd46cfd21c7a9..5ba4ad39e3f5ff010d97672180c2d905f3646e36 100644 (file)
@@ -143,7 +143,7 @@ void CachedFrameBase::restore()
     
 #if ENABLE(TOUCH_EVENTS)
     if (m_document->hasTouchEventHandlers())
-        m_document->page()->chrome().client()->needTouchEvents(true);
+        m_document->page()->chrome().client().needTouchEvents(true);
 #endif
 
     m_document->documentDidResumeFromPageCache();
index 144344713f19ceac8362502c68f3e64532f932bd..dd8d0be595e39a4eb97b04a03cddec3bd5db99ec 100644 (file)
@@ -71,7 +71,7 @@ void HTMLFormControlElementWithState::notifyFormStateChanged()
         return;
 
     if (Page* page = frame->page())
-        page->chrome().client()->formStateDidChange(this);
+        page->chrome().client().formStateDidChange(this);
 }
 
 bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() const
index 28001d111b31d5a44a420313ad3c30cb240ac835..a62a597d0f5dcbc8cf4ffe2fc18b9622bfe80f7d 100644 (file)
@@ -1684,20 +1684,20 @@ static void logMediaLoadRequest(Page* page, const String& mediaEngine, const Str
     if (!page || !page->settings().diagnosticLoggingEnabled())
         return;
 
-    ChromeClient* client = page->chrome().client();
+    ChromeClient& chromeClient = page->chrome().client();
 
     if (!succeeded) {
-        client->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadingFailedKey(), errorMessage, DiagnosticLoggingKeys::failKey());
+        chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadingFailedKey(), errorMessage, DiagnosticLoggingKeys::failKey());
         return;
     }
 
-    client->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadedKey(), mediaEngine, DiagnosticLoggingKeys::noopKey());
+    chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadedKey(), mediaEngine, DiagnosticLoggingKeys::noopKey());
 
     if (!page->hasSeenAnyMediaEngine())
-        client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey(), emptyString(), DiagnosticLoggingKeys::noopKey());
+        chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey(), emptyString(), DiagnosticLoggingKeys::noopKey());
 
     if (!page->hasSeenMediaEngine(mediaEngine))
-        client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsMediaEngineKey(), mediaEngine, DiagnosticLoggingKeys::noopKey());
+        chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsMediaEngineKey(), mediaEngine, DiagnosticLoggingKeys::noopKey());
 
     page->sawMediaEngine(mediaEngine);
 }
@@ -3823,7 +3823,7 @@ GraphicsDeviceAdapter* HTMLMediaElement::mediaPlayerGraphicsDeviceAdapter(const
     if (!document() || !document()->page())
         return 0;
 
-    return document()->page()->chrome().client()->graphicsDeviceAdapter();
+    return document()->page()->chrome().client().graphicsDeviceAdapter();
 }
 #endif
 
@@ -4412,7 +4412,7 @@ void HTMLMediaElement::enterFullscreen()
     if (hasMediaControls())
         mediaControls()->enteredFullscreen();
     if (document() && document()->page()) {
-        document()->page()->chrome().client()->enterFullscreenForNode(this);
+        document()->page()->chrome().client().enterFullscreenForNode(this);
         scheduleEvent(eventNames().webkitbeginfullscreenEvent);
     }
 }
@@ -4435,7 +4435,7 @@ void HTMLMediaElement::exitFullscreen()
     if (document() && document()->page()) {
         if (document()->page()->chrome().requiresFullscreenForVideoPlayback())
             pauseInternal();
-        document()->page()->chrome().client()->exitFullscreenForNode(this);
+        document()->page()->chrome().client().exitFullscreenForNode(this);
         scheduleEvent(eventNames().webkitendfullscreenEvent);
     }
 }
index 883340a61e813266820fa3cdfa0c81ccda095441..875d1aa165ad2192bc3858ec0cb8eb751d975b80 100644 (file)
@@ -75,7 +75,7 @@ static const String titleText(Page* page, String mimeType)
     if (!titleText.isEmpty())
         return titleText;
 
-    titleText = page->chrome().client()->plugInStartLabelTitle(mimeType);
+    titleText = page->chrome().client().plugInStartLabelTitle(mimeType);
     if (titleText.isEmpty())
         titleText = snapshottedPlugInLabelTitle();
     mimeTypeToLabelTitleMap.set(mimeType, titleText);
@@ -89,7 +89,7 @@ static const String subtitleText(Page* page, String mimeType)
     if (!subtitleText.isEmpty())
         return subtitleText;
 
-    subtitleText = page->chrome().client()->plugInStartLabelSubtitle(mimeType);
+    subtitleText = page->chrome().client().plugInStartLabelSubtitle(mimeType);
     if (subtitleText.isEmpty())
         subtitleText = snapshottedPlugInLabelSubtitle();
     mimeTypeToLabelSubtitleMap.set(mimeType, subtitleText);
index b6b5e224a84eaaeb3a30322c86678dbc6eb23fc6..026cc730d31416824e5c23e57921b3a9276fdf76 100644 (file)
@@ -140,14 +140,14 @@ bool HTMLVideoElement::supportsFullscreen() const
 #if ENABLE(FULLSCREEN_API)
     // If the full screen API is enabled and is supported for the current element
     // do not require that the player has a video track to enter full screen.
-    if (page->chrome().client()->supportsFullScreenForElement(this, false))
+    if (page->chrome().client().supportsFullScreenForElement(this, false))
         return true;
 #endif
 
     if (!player()->hasVideo())
         return false;
 
-    return page->chrome().client()->supportsFullscreenForNode(this);
+    return page->chrome().client().supportsFullscreenForNode(this);
 }
 
 unsigned HTMLVideoElement::videoWidth() const
index 9d258410d4b9a418cb4b8e783760c9c88fee4315..8728dd60a5c8e4dea463f1d2d456aaf50f010f70 100644 (file)
@@ -1833,7 +1833,7 @@ void FrameLoader::transitionToCommitted(PassRefPtr<CachedPage> cachedPage)
 
 #if ENABLE(TOUCH_EVENTS)
     if (isLoadingMainFrame())
-        m_frame->page()->chrome().client()->needTouchEvents(false);
+        m_frame->page()->chrome().client().needTouchEvents(false);
 #endif
 
     // Handle adding the URL to the back/forward list.
index 359a212f6740b5c8809b10bc5a3dc61f6556a20d..1c339c84bf0de1b3467125e5a76ff7a22635d3aa 100644 (file)
@@ -199,14 +199,14 @@ static void logPluginRequest(Page* page, const String& mimeType, const String& u
     String pluginFile = pluginData ? pluginData->pluginFileForMimeType(newMIMEType) : String();
     String description = !pluginFile ? newMIMEType : pluginFile;
 
-    ChromeClient* client = page->chrome().client();
-    client->logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), description, DiagnosticLoggingKeys::noopKey());
+    ChromeClient& chromeClient = page->chrome().client();
+    chromeClient.logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), description, DiagnosticLoggingKeys::noopKey());
 
     if (!page->hasSeenAnyPlugin())
-        client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey(), emptyString(), DiagnosticLoggingKeys::noopKey());
+        chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey(), emptyString(), DiagnosticLoggingKeys::noopKey());
     
     if (!page->hasSeenPlugin(description))
-        client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsPluginKey(), description, DiagnosticLoggingKeys::noopKey());
+        chromeClient.logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsPluginKey(), description, DiagnosticLoggingKeys::noopKey());
 
     page->sawPlugin(description);
 }
index bf95d97250ca29230529445a8e7a7aaf08d16319..30c7c82e9bb45d547d4d6c05b1eb4b5bf8011c50 100644 (file)
@@ -821,7 +821,7 @@ void ApplicationCacheGroup::didReachMaxAppCacheSize()
 {
     ASSERT(m_frame);
     ASSERT(m_cacheBeingUpdated);
-    m_frame->page()->chrome().client()->reachedMaxAppCacheSize(cacheStorage().spaceNeeded(m_cacheBeingUpdated->estimatedSizeInStorage()));
+    m_frame->page()->chrome().client().reachedMaxAppCacheSize(cacheStorage().spaceNeeded(m_cacheBeingUpdated->estimatedSizeInStorage()));
     m_calledReachedMaxAppCacheSize = true;
     checkIfLoadIsComplete();
 }
@@ -830,7 +830,7 @@ void ApplicationCacheGroup::didReachOriginQuota(int64_t totalSpaceNeeded)
 {
     // Inform the client the origin quota has been reached, they may decide to increase the quota.
     // We expect quota to be increased synchronously while waiting for the call to return.
-    m_frame->page()->chrome().client()->reachedApplicationCacheOriginQuota(m_origin.get(), totalSpaceNeeded);
+    m_frame->page()->chrome().client().reachedApplicationCacheOriginQuota(m_origin.get(), totalSpaceNeeded);
 }
 
 void ApplicationCacheGroup::cacheUpdateFailed()
index b2dd26105022c384b0e918237810f0a47a8efc8c..6a30b90aaabb9cbc1241f9f7329dc3d6038d4ff1 100644 (file)
@@ -163,7 +163,7 @@ void AutoscrollController::updateDragAndDrop(Node* dropTargetNode, const IntPoin
     }
 
     Page* page = frame->page();
-    if (!page || !page->chrome().client()->shouldAutoscrollForDragAndDrop(scrollable)) {
+    if (!page || !page->chrome().client().shouldAutoscrollForDragAndDrop(scrollable)) {
         stopAutoscrollTimer();
         return;
     }
index 5190e475850b5c4736822697fd9605f78ee7c54d..cbfb15f959a93d0ba6fe1bd06f3fe5cd870bdbd8 100644 (file)
@@ -64,15 +64,15 @@ using namespace std;
 
 Chrome::Chrome(Page* page, ChromeClient* client)
     : m_page(page)
-    , m_client(client)
+    , m_client(*client)
     , m_displayID(0)
 {
-    ASSERT(m_client);
+    ASSERT(client);
 }
 
 Chrome::~Chrome()
 {
-    m_client->chromeDestroyed();
+    m_client.chromeDestroyed();
 }
 
 PassOwnPtr<Chrome> Chrome::create(Page* page, ChromeClient* client)
@@ -82,115 +82,115 @@ PassOwnPtr<Chrome> Chrome::create(Page* page, ChromeClient* client)
 
 void Chrome::invalidateRootView(const IntRect& updateRect, bool immediate)
 {
-    m_client->invalidateRootView(updateRect, immediate);
+    m_client.invalidateRootView(updateRect, immediate);
 }
 
 void Chrome::invalidateContentsAndRootView(const IntRect& updateRect, bool immediate)
 {
-    m_client->invalidateContentsAndRootView(updateRect, immediate);
+    m_client.invalidateContentsAndRootView(updateRect, immediate);
 }
 
 void Chrome::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
 {
-    m_client->invalidateContentsForSlowScroll(updateRect, immediate);
+    m_client.invalidateContentsForSlowScroll(updateRect, immediate);
 }
 
 void Chrome::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
 {
-    m_client->scroll(scrollDelta, rectToScroll, clipRect);
+    m_client.scroll(scrollDelta, rectToScroll, clipRect);
     InspectorInstrumentation::didScroll(m_page);
 }
 
 #if USE(TILED_BACKING_STORE)
 void Chrome::delegatedScrollRequested(const IntPoint& scrollPoint)
 {
-    m_client->delegatedScrollRequested(scrollPoint);
+    m_client.delegatedScrollRequested(scrollPoint);
 }
 #endif
 
 IntPoint Chrome::screenToRootView(const IntPoint& point) const
 {
-    return m_client->screenToRootView(point);
+    return m_client.screenToRootView(point);
 }
 
 IntRect Chrome::rootViewToScreen(const IntRect& rect) const
 {
-    return m_client->rootViewToScreen(rect);
+    return m_client.rootViewToScreen(rect);
 }
 
 PlatformPageClient Chrome::platformPageClient() const
 {
-    return m_client->platformPageClient();
+    return m_client.platformPageClient();
 }
 
 void Chrome::contentsSizeChanged(Frame* frame, const IntSize& size) const
 {
-    m_client->contentsSizeChanged(frame, size);
+    m_client.contentsSizeChanged(frame, size);
 }
 
 void Chrome::layoutUpdated(Frame* frame) const
 {
-    m_client->layoutUpdated(frame);
+    m_client.layoutUpdated(frame);
 }
 
 void Chrome::scrollRectIntoView(const IntRect& rect) const
 {
-    m_client->scrollRectIntoView(rect);
+    m_client.scrollRectIntoView(rect);
 }
 
 void Chrome::scrollbarsModeDidChange() const
 {
-    m_client->scrollbarsModeDidChange();
+    m_client.scrollbarsModeDidChange();
 }
 
 void Chrome::setWindowRect(const FloatRect& rect) const
 {
-    m_client->setWindowRect(rect);
+    m_client.setWindowRect(rect);
 }
 
 FloatRect Chrome::windowRect() const
 {
-    return m_client->windowRect();
+    return m_client.windowRect();
 }
 
 FloatRect Chrome::pageRect() const
 {
-    return m_client->pageRect();
+    return m_client.pageRect();
 }
 
 void Chrome::focus() const
 {
-    m_client->focus();
+    m_client.focus();
 }
 
 void Chrome::unfocus() const
 {
-    m_client->unfocus();
+    m_client.unfocus();
 }
 
 bool Chrome::canTakeFocus(FocusDirection direction) const
 {
-    return m_client->canTakeFocus(direction);
+    return m_client.canTakeFocus(direction);
 }
 
 void Chrome::takeFocus(FocusDirection direction) const
 {
-    m_client->takeFocus(direction);
+    m_client.takeFocus(direction);
 }
 
 void Chrome::focusedElementChanged(Element* element) const
 {
-    m_client->focusedElementChanged(element);
+    m_client.focusedElementChanged(element);
 }
 
 void Chrome::focusedFrameChanged(Frame* frame) const
 {
-    m_client->focusedFrameChanged(frame);
+    m_client.focusedFrameChanged(frame);
 }
 
 Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction& action) const
 {
-    Page* newPage = m_client->createWindow(frame, request, features, action);
+    Page* newPage = m_client.createWindow(frame, request, features, action);
     if (!newPage)
         return 0;
 
@@ -202,12 +202,12 @@ Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const
 
 void Chrome::show() const
 {
-    m_client->show();
+    m_client.show();
 }
 
 bool Chrome::canRunModal() const
 {
-    return m_client->canRunModal();
+    return m_client.canRunModal();
 }
 
 static bool canRunModalIfDuringPageDismissal(Page* page, ChromeClient::DialogType dialog, const String& message)
@@ -215,7 +215,7 @@ static bool canRunModalIfDuringPageDismissal(Page* page, ChromeClient::DialogTyp
     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);
+            return page->chrome().client().shouldRunModalDialogDuringPageDismissal(dialog, message, dismissal);
     }
     return true;
 }
@@ -235,57 +235,57 @@ void Chrome::runModal() const
     PageGroupLoadDeferrer deferrer(m_page, false);
 
     TimerBase::fireTimersInNestedEventLoop();
-    m_client->runModal();
+    m_client.runModal();
 }
 
 void Chrome::setToolbarsVisible(bool b) const
 {
-    m_client->setToolbarsVisible(b);
+    m_client.setToolbarsVisible(b);
 }
 
 bool Chrome::toolbarsVisible() const
 {
-    return m_client->toolbarsVisible();
+    return m_client.toolbarsVisible();
 }
 
 void Chrome::setStatusbarVisible(bool b) const
 {
-    m_client->setStatusbarVisible(b);
+    m_client.setStatusbarVisible(b);
 }
 
 bool Chrome::statusbarVisible() const
 {
-    return m_client->statusbarVisible();
+    return m_client.statusbarVisible();
 }
 
 void Chrome::setScrollbarsVisible(bool b) const
 {
-    m_client->setScrollbarsVisible(b);
+    m_client.setScrollbarsVisible(b);
 }
 
 bool Chrome::scrollbarsVisible() const
 {
-    return m_client->scrollbarsVisible();
+    return m_client.scrollbarsVisible();
 }
 
 void Chrome::setMenubarVisible(bool b) const
 {
-    m_client->setMenubarVisible(b);
+    m_client.setMenubarVisible(b);
 }
 
 bool Chrome::menubarVisible() const
 {
-    return m_client->menubarVisible();
+    return m_client.menubarVisible();
 }
 
 void Chrome::setResizable(bool b) const
 {
-    m_client->setResizable(b);
+    m_client.setResizable(b);
 }
 
 bool Chrome::canRunBeforeUnloadConfirmPanel()
 {
-    return m_client->canRunBeforeUnloadConfirmPanel();
+    return m_client.canRunBeforeUnloadConfirmPanel();
 }
 
 bool Chrome::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
@@ -295,14 +295,14 @@ bool Chrome::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
     PageGroupLoadDeferrer deferrer(m_page, true);
 
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJavaScriptDialog(m_page, message);
-    bool ok = m_client->runBeforeUnloadConfirmPanel(message, frame);
+    bool ok = m_client.runBeforeUnloadConfirmPanel(message, frame);
     InspectorInstrumentation::didRunJavaScriptDialog(cookie);
     return ok;
 }
 
 void Chrome::closeWindowSoon()
 {
-    m_client->closeWindowSoon();
+    m_client.closeWindowSoon();
 }
 
 void Chrome::runJavaScriptAlert(Frame* frame, const String& message)
@@ -319,7 +319,7 @@ void Chrome::runJavaScriptAlert(Frame* frame, const String& message)
     String displayMessage = frame->displayStringModifiedByEncoding(message);
 
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJavaScriptDialog(m_page, displayMessage);
-    m_client->runJavaScriptAlert(frame, displayMessage);
+    m_client.runJavaScriptAlert(frame, displayMessage);
     InspectorInstrumentation::didRunJavaScriptDialog(cookie);
 }
 
@@ -337,7 +337,7 @@ bool Chrome::runJavaScriptConfirm(Frame* frame, const String& message)
     String displayMessage = frame->displayStringModifiedByEncoding(message);
 
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJavaScriptDialog(m_page, displayMessage);
-    bool ok = m_client->runJavaScriptConfirm(frame, displayMessage);
+    bool ok = m_client.runJavaScriptConfirm(frame, displayMessage);
     InspectorInstrumentation::didRunJavaScriptDialog(cookie);
     return ok;
 }
@@ -356,7 +356,7 @@ bool Chrome::runJavaScriptPrompt(Frame* frame, const String& prompt, const Strin
     String displayPrompt = frame->displayStringModifiedByEncoding(prompt);
 
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willRunJavaScriptDialog(m_page, displayPrompt);
-    bool ok = m_client->runJavaScriptPrompt(frame, displayPrompt, frame->displayStringModifiedByEncoding(defaultValue), result);
+    bool ok = m_client.runJavaScriptPrompt(frame, displayPrompt, frame->displayStringModifiedByEncoding(defaultValue), result);
     InspectorInstrumentation::didRunJavaScriptDialog(cookie);
 
     if (ok)
@@ -368,7 +368,7 @@ bool Chrome::runJavaScriptPrompt(Frame* frame, const String& prompt, const Strin
 void Chrome::setStatusbarText(Frame* frame, const String& status)
 {
     ASSERT(frame);
-    m_client->setStatusbarText(frame->displayStringModifiedByEncoding(status));
+    m_client.setStatusbarText(frame->displayStringModifiedByEncoding(status));
 }
 
 bool Chrome::shouldInterruptJavaScript()
@@ -377,12 +377,12 @@ bool Chrome::shouldInterruptJavaScript()
     // otherwise cause the load to continue while we're in the middle of executing JavaScript.
     PageGroupLoadDeferrer deferrer(m_page, true);
 
-    return m_client->shouldInterruptJavaScript();
+    return m_client.shouldInterruptJavaScript();
 }
 
 IntRect Chrome::windowResizerRect() const
 {
-    return m_client->windowResizerRect();
+    return m_client.windowResizerRect();
 }
 
 void Chrome::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
@@ -392,7 +392,7 @@ void Chrome::mouseDidMoveOverElement(const HitTestResult& result, unsigned modif
         if (document && document->isDNSPrefetchEnabled())
             prefetchDNS(result.absoluteLinkURL().host());
     }
-    m_client->mouseDidMoveOverElement(result, modifierFlags);
+    m_client.mouseDidMoveOverElement(result, modifierFlags);
 
     InspectorInstrumentation::mouseDidMoveOverElement(m_page, result, modifierFlags);
 }
@@ -453,29 +453,29 @@ void Chrome::setToolTip(const HitTestResult& result)
         }
     }
 
-    m_client->setToolTip(toolTip, toolTipDirection);
+    m_client.setToolTip(toolTip, toolTipDirection);
 }
 
 void Chrome::print(Frame* frame)
 {
     // FIXME: This should have PageGroupLoadDeferrer, like runModal() or runJavaScriptAlert(), becasue it's no different from those.
-    m_client->print(frame);
+    m_client.print(frame);
 }
 
 void Chrome::enableSuddenTermination()
 {
-    m_client->enableSuddenTermination();
+    m_client.enableSuddenTermination();
 }
 
 void Chrome::disableSuddenTermination()
 {
-    m_client->disableSuddenTermination();
+    m_client.disableSuddenTermination();
 }
 
 #if ENABLE(DIRECTORY_UPLOAD)
 void Chrome::enumerateChosenDirectory(FileChooser* fileChooser)
 {
-    m_client->enumerateChosenDirectory(fileChooser);
+    m_client.enumerateChosenDirectory(fileChooser);
 }
 #endif
 
@@ -483,7 +483,7 @@ void Chrome::enumerateChosenDirectory(FileChooser* fileChooser)
 PassOwnPtr<ColorChooser> Chrome::createColorChooser(ColorChooserClient* client, const Color& initialColor)
 {
     notifyPopupOpeningObservers();
-    return m_client->createColorChooser(client, initialColor);
+    return m_client.createColorChooser(client, initialColor);
 }
 #endif
 
@@ -491,41 +491,41 @@ PassOwnPtr<ColorChooser> Chrome::createColorChooser(ColorChooserClient* client,
 PassRefPtr<DateTimeChooser> Chrome::openDateTimeChooser(DateTimeChooserClient* client, const DateTimeChooserParameters& parameters)
 {
     notifyPopupOpeningObservers();
-    return m_client->openDateTimeChooser(client, parameters);
+    return m_client.openDateTimeChooser(client, parameters);
 }
 #endif
 
 void Chrome::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> fileChooser)
 {
     notifyPopupOpeningObservers();
-    m_client->runOpenPanel(frame, fileChooser);
+    m_client.runOpenPanel(frame, fileChooser);
 }
 
 void Chrome::loadIconForFiles(const Vector<String>& filenames, FileIconLoader* loader)
 {
-    m_client->loadIconForFiles(filenames, loader);
+    m_client.loadIconForFiles(filenames, loader);
 }
 
 void Chrome::dispatchViewportPropertiesDidChange(const ViewportArguments& arguments) const
 {
-    m_client->dispatchViewportPropertiesDidChange(arguments);
+    m_client.dispatchViewportPropertiesDidChange(arguments);
 }
 
 void Chrome::setCursor(const Cursor& cursor)
 {
-    m_client->setCursor(cursor);
+    m_client.setCursor(cursor);
 }
 
 void Chrome::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
 {
-    m_client->setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
+    m_client.setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
 }
 
 #if ENABLE(REQUEST_ANIMATION_FRAME)
 void Chrome::scheduleAnimation()
 {
 #if !USE(REQUEST_ANIMATION_FRAME_TIMER)
-    m_client->scheduleAnimation();
+    m_client.scheduleAnimation();
 #endif
 }
 #endif
@@ -587,34 +587,34 @@ bool ChromeClient::paintCustomOverhangArea(GraphicsContext*, const IntRect&, con
 
 bool Chrome::selectItemWritingDirectionIsNatural()
 {
-    return m_client->selectItemWritingDirectionIsNatural();
+    return m_client.selectItemWritingDirectionIsNatural();
 }
 
 bool Chrome::selectItemAlignmentFollowsMenuWritingDirection()
 {
-    return m_client->selectItemAlignmentFollowsMenuWritingDirection();
+    return m_client.selectItemAlignmentFollowsMenuWritingDirection();
 }
 
 bool Chrome::hasOpenedPopup() const
 {
-    return m_client->hasOpenedPopup();
+    return m_client.hasOpenedPopup();
 }
 
 PassRefPtr<PopupMenu> Chrome::createPopupMenu(PopupMenuClient* client) const
 {
     notifyPopupOpeningObservers();
-    return m_client->createPopupMenu(client);
+    return m_client.createPopupMenu(client);
 }
 
 PassRefPtr<SearchPopupMenu> Chrome::createSearchPopupMenu(PopupMenuClient* client) const
 {
     notifyPopupOpeningObservers();
-    return m_client->createSearchPopupMenu(client);
+    return m_client.createSearchPopupMenu(client);
 }
 
 bool Chrome::requiresFullscreenForVideoPlayback()
 {
-    return m_client->requiresFullscreenForVideoPlayback();
+    return m_client.requiresFullscreenForVideoPlayback();
 }
 
 void Chrome::registerPopupOpeningObserver(PopupOpeningObserver* observer)
index 173f987cb3fc6ae93ab5a0e9e4bddc5d0617d94f..0ac1f423e0da25d4e5da7cc7a27ca09b471109b9 100644 (file)
@@ -67,7 +67,7 @@ public:
 
     static PassOwnPtr<Chrome> create(Page*, ChromeClient*);
 
-    ChromeClient* client() { return m_client; }
+    ChromeClient& client() { return m_client; }
 
     // HostWindow methods.
     virtual void invalidateRootView(const IntRect&, bool) OVERRIDE;
@@ -188,7 +188,7 @@ private:
     void notifyPopupOpeningObservers() const;
 
     Page* m_page;
-    ChromeClient* m_client;
+    ChromeClient& m_client;
     PlatformDisplayID m_displayID;
     Vector<PopupOpeningObserver*> m_popupOpeningObservers;
 };
index 9be2572bda3fc7ae4b278feebf4ebcc11d37c423..e71e8913f9814099e64976650fe2af74d2e46016 100644 (file)
@@ -87,7 +87,7 @@ static void internalAddMessage(Page* page, MessageType type, MessageLevel level,
         return;
 
     if (gotMessage)
-        page->chrome().client()->addMessageToConsole(ConsoleAPIMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.columnNumber(), lastCaller.sourceURL());
+        page->chrome().client().addMessageToConsole(ConsoleAPIMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.columnNumber(), lastCaller.sourceURL());
 
     if (!page->settings().logsPageMessagesToSystemConsoleEnabled() && !PageConsole::shouldPrintExceptions())
         return;
index 6cf7c77d34b1590fd2a148a745c6502e05b03f2a..3f148164b69883fc24a562d5077d0f6e1353fb27 100644 (file)
@@ -339,7 +339,7 @@ FloatRect DOMWindow::adjustWindowRect(Page* page, const FloatRect& pendingChange
     if (!std::isnan(pendingChanges.height()))
         window.setHeight(pendingChanges.height());
 
-    FloatSize minimumSize = page->chrome().client()->minimumWindowSize();
+    FloatSize minimumSize = page->chrome().client().minimumWindowSize();
     window.setWidth(min(max(minimumSize.width(), window.width()), screen.width()));
     window.setHeight(min(max(minimumSize.height(), window.height()), screen.height()));
 
index 9b628e4950f6b5d512c773778ea7c7e5b347f905..03e5cd97169b0ecf173eff55f6acb843e555213f 100644 (file)
@@ -3707,7 +3707,7 @@ bool EventHandler::tabsToLinks(KeyboardEvent* event) const
     if (!page)
         return false;
 
-    bool tabsToLinksClientCallResult = page->chrome().client()->keyboardUIMode() & KeyboardAccessTabsToLinks;
+    bool tabsToLinksClientCallResult = page->chrome().client().keyboardUIMode() & KeyboardAccessTabsToLinks;
     return eventInvertsTabsToLinksClientCallResult(event) ? !tabsToLinksClientCallResult : tabsToLinksClientCallResult;
 }
 
index c56e797aa5e6b943a77dfe112622f2d88f0b01c9..414402e3afe7e889d919449fe7ff27b307d8601c 100644 (file)
@@ -308,7 +308,7 @@ void Frame::setDocument(PassRefPtr<Document> newDoc)
         notifyChromeClientWheelEventHandlerCountChanged();
 #if ENABLE(TOUCH_EVENTS)
         if (m_doc && m_doc->hasTouchEventHandlers())
-            m_page->chrome().client()->needTouchEvents(true);
+            m_page->chrome().client().needTouchEvents(true);
 #endif
     }
 
@@ -845,7 +845,7 @@ IntRect Frame::tiledBackingStoreVisibleRect()
 {
     if (!m_page)
         return IntRect();
-    return m_page->chrome().client()->visibleRectForTiledBackingStore();
+    return m_page->chrome().client().visibleRectForTiledBackingStore();
 }
 
 Color Frame::tiledBackingStoreBackgroundColor() const
@@ -1007,7 +1007,7 @@ void Frame::notifyChromeClientWheelEventHandlerCountChanged() const
             count += frame->document()->wheelEventHandlerCount();
     }
 
-    m_page->chrome().client()->numWheelEventHandlersChanged(count);
+    m_page->chrome().client().numWheelEventHandlersChanged(count);
 }
 
 bool Frame::isURLAllowed(const KURL& url) const
index cc79c0d771f86dbf88dd15f6b74b3947e7df38a5..2ae1aa29ce0783c3cde4df4879b5dbee0f6b433c 100644 (file)
@@ -345,7 +345,7 @@ void FrameView::init()
     }
 
     Page* page = frame().page();
-    if (page && page->chrome().client()->shouldPaintEntireContents())
+    if (page && page->chrome().client().shouldPaintEntireContents())
         setPaintsEntireContents(true);
 }
     
@@ -917,7 +917,7 @@ bool FrameView::flushCompositingStateForThisFrame(Frame* rootFrameForFlush)
 void FrameView::setNeedsOneShotDrawingSynchronization()
 {
     if (Page* page = frame().page())
-        page->chrome().client()->setNeedsOneShotDrawingSynchronization();
+        page->chrome().client().setNeedsOneShotDrawingSynchronization();
 }
 
 #endif // USE(ACCELERATED_COMPOSITING)
@@ -1380,7 +1380,7 @@ void FrameView::layout(bool allowSubtree)
         return;
 
     if (Page* page = frame().page())
-        page->chrome().client()->layoutUpdated(&frame());
+        page->chrome().client().layoutUpdated(&frame());
 }
 
 RenderBox* FrameView::embeddedContentBox() const
@@ -2049,7 +2049,7 @@ void FrameView::updateFixedElementsAfterScrolling()
 bool FrameView::shouldRubberBandInDirection(ScrollDirection direction) const
 {
     if (Page* page = frame().page())
-        return page->chrome().client()->shouldRubberBandInDirection(direction);
+        return page->chrome().client().shouldRubberBandInDirection(direction);
     return ScrollView::shouldRubberBandInDirection(direction);
 }
 
@@ -3088,7 +3088,7 @@ void FrameView::setVisibleScrollerThumbRect(const IntRect& scrollerThumb)
     if (!isMainFrameView())
         return;
 
-    frame().page()->chrome().client()->notifyScrollerThumbIsVisibleInRect(scrollerThumb);
+    frame().page()->chrome().client().notifyScrollerThumbIsVisibleInRect(scrollerThumb);
 }
 
 bool FrameView::scrollbarsCanBeActive() const
@@ -3176,7 +3176,7 @@ void FrameView::scrollbarStyleChanged(int newStyle, bool forceUpdate)
     if (!isMainFrameView())
         return;
 
-    frame().page()->chrome().client()->recommendedScrollbarStyleDidChange(newStyle);
+    frame().page()->chrome().client().recommendedScrollbarStyleDidChange(newStyle);
 
     if (forceUpdate)
         ScrollView::scrollbarStyleChanged(newStyle, forceUpdate);
@@ -3247,7 +3247,7 @@ void FrameView::updateAnnotatedRegions()
     Page* page = frame().page();
     if (!page)
         return;
-    page->chrome().client()->annotatedRegionsChanged();
+    page->chrome().client().annotatedRegionsChanged();
 }
 #endif
 
@@ -3657,7 +3657,7 @@ void FrameView::paintOverhangAreas(GraphicsContext* context, const IntRect& hori
     if (frame().document()->printing())
         return;
 
-    if (isMainFrameView() && frame().page()->chrome().client()->paintCustomOverhangArea(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect))
+    if (isMainFrameView() && frame().page()->chrome().client().paintCustomOverhangArea(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect))
         return;
 
     ScrollView::paintOverhangAreas(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect);
index b477f9c461386ac8ac71c448c4f15f8a093febb4..0c48e79cbabbcdba1f7e35b53f50cb01edcd4394 100644 (file)
@@ -171,7 +171,7 @@ void PageConsole::addMessage(MessageSource source, MessageLevel level, const Str
     if (page->settings().privateBrowsingEnabled())
         return;
 
-    page->chrome().client()->addMessageToConsole(source, level, message, lineNumber, columnNumber, url);
+    page->chrome().client().addMessageToConsole(source, level, message, lineNumber, columnNumber, url);
 
     if (!page->settings().logsPageMessagesToSystemConsoleEnabled() && !shouldPrintExceptions())
         return;
index c74d3237efaff66935402fb9245d39331e7c610a..47cdd1a38b3e3edd7e8d062084e1b67b6cf433a7 100644 (file)
@@ -195,7 +195,7 @@ bool PageGroup::isLinkVisited(LinkHash visitedLinkHash)
     if (!m_visitedLinksPopulated) {
         m_visitedLinksPopulated = true;
         ASSERT(!m_pages.isEmpty());
-        (*m_pages.begin())->chrome().client()->populateVisitedLinks();
+        (*m_pages.begin())->chrome().client().populateVisitedLinks();
     }
     return m_visitedLinkHashes.contains(visitedLinkHash);
 }
index 61ba2f1c1a6400124a54df2c01514b6f4401c3a5..68f73cb015f9b2f03dbce39335c6cb5522bde895 100644 (file)
@@ -41,8 +41,7 @@ PageThrottler::PageThrottler(Page* page)
     , m_throttleState(PageNotThrottledState)
     , m_throttleHysteresisTimer(this, &PageThrottler::throttleHysteresisTimerFired)
 {
-    if (ChromeClient* chromeClient = m_page->chrome().client())
-        chromeClient->incrementActivePageCount();
+    m_page->chrome().client().incrementActivePageCount();
 }
 
 PageThrottler::~PageThrottler()
@@ -52,18 +51,15 @@ PageThrottler::~PageThrottler()
     for (HashSet<PageActivityAssertionToken*>::iterator i = m_activityTokens.begin(); i != m_activityTokens.end(); ++i)
         (*i)->invalidate();
 
-    if (m_throttleState != PageThrottledState) {
-        if (ChromeClient* chromeClient = m_page->chrome().client())
-            chromeClient->decrementActivePageCount();
-    }
+    if (m_throttleState != PageThrottledState)
+        m_page->chrome().client().decrementActivePageCount();
 }
 
 void PageThrottler::throttlePage()
 {
     m_throttleState = PageThrottledState;
 
-    if (ChromeClient* chromeClient = m_page->chrome().client())
-        chromeClient->decrementActivePageCount();
+    m_page->chrome().client().decrementActivePageCount();
 
     for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
         if (frame->document())
@@ -81,10 +77,8 @@ void PageThrottler::unthrottlePage()
     if (oldState == PageNotThrottledState)
         return;
 
-    if (oldState == PageThrottledState) {
-        if (ChromeClient* chromeClient = m_page->chrome().client())
-            chromeClient->incrementActivePageCount();
-    }
+    if (oldState == PageThrottledState)
+        m_page->chrome().client().incrementActivePageCount();
     
     for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
         if (frame->document())
index 974b98da5f4ea33a1de34ebdccff990e6fb139b2..6f4c8eb7a21e4527f1f98f30907d38136742e376 100644 (file)
@@ -68,7 +68,7 @@ void PointerLockController::requestPointerLock(Element* target)
         }
         enqueueEvent(eventNames().webkitpointerlockchangeEvent, target);
         m_element = target;
-    } else if (m_page->chrome().client()->requestPointerLock()) {
+    } else if (m_page->chrome().client().requestPointerLock()) {
         m_lockPending = true;
         m_element = target;
     } else {
@@ -78,7 +78,7 @@ void PointerLockController::requestPointerLock(Element* target)
 
 void PointerLockController::requestPointerUnlock()
 {
-    return m_page->chrome().client()->requestPointerUnlock();
+    return m_page->chrome().client().requestPointerUnlock();
 }
 
 void PointerLockController::elementRemoved(Element* element)
index b09ecf1c040e4fd857ca043e53cedc5e68dec416..afa9e68eeecf27210c4c39160edf9dd6e66e4492 100644 (file)
@@ -32,25 +32,25 @@ void Chrome::focusNSView(NSView* view)
 
     // Handle the WK2 case where there is no view passed in.
     if (!view) {
-        client()->makeFirstResponder();
+        client().makeFirstResponder();
         return;
     }
     
-    NSResponder *firstResponder = client()->firstResponder();
+    NSResponder *firstResponder = client().firstResponder();
     if (firstResponder == view)
         return;
 
     if (![view window] || ![view superview] || ![view acceptsFirstResponder])
         return;
 
-    client()->makeFirstResponder(view);
+    client().makeFirstResponder(view);
 
     // Setting focus can actually cause a style change which might
     // remove the view from its superview while it's being made
     // first responder. This confuses AppKit so we must restore
     // the old first responder.
     if (![view superview])
-        client()->makeFirstResponder(firstResponder);
+        client().makeFirstResponder(firstResponder);
 
     END_BLOCK_OBJC_EXCEPTIONS;
 }
index 79df8b063521e16c2160cfac194c8081e120bc5a..28f7ce9e0a4bcd0c22ad70ba0b6d9d0b5df28937 100644 (file)
@@ -203,11 +203,11 @@ bool EventHandler::passMouseDownEventToWidget(Widget* pWidget)
     if (!page)
         return true;
 
-    if (page->chrome().client()->firstResponder() != view) {
+    if (page->chrome().client().firstResponder() != view) {
         // Normally [NSWindow sendEvent:] handles setting the first responder.
         // But in our case, the event was sent to the view representing the entire web page.
         if ([currentNSEvent() clickCount] <= 1 && [view acceptsFirstResponder] && [view needsPanelToBecomeKey])
-            page->chrome().client()->makeFirstResponder(view);
+            page->chrome().client().makeFirstResponder(view);
     }
 
     // We need to "defer loading" while tracking the mouse, because tearing down the
@@ -688,7 +688,7 @@ bool EventHandler::tabsToAllFormControls(KeyboardEvent* event) const
     if (!page)
         return false;
 
-    KeyboardUIMode keyboardUIMode = page->chrome().client()->keyboardUIMode();
+    KeyboardUIMode keyboardUIMode = page->chrome().client().keyboardUIMode();
     bool handlingOptionTab = isKeyboardOptionTab(event);
 
     // If tab-to-links is off, option-tab always highlights all controls
index 85b2c1d3b8db2bf7d777b64f02df3c489aaf441e..be8d1c8d9b7c13c87be60d577fcf7d4cea3ac592 100644 (file)
@@ -94,7 +94,7 @@ static void openFileSystem(ScriptExecutionContext* context, const String& basePa
         int playerId = 0;
         Page* page = static_cast<Document*>(context)->page();
         if (page)
-            playerId = page->chrome().client()->platformPageClient()->playerID();
+            playerId = page->chrome().client().platformPageClient()->playerID();
         AsyncFileSystemBlackBerry::openFileSystem(rootURL, basePath, context->securityOrigin()->databaseIdentifier(), type, size, create, playerId, callbacks);
     } else {
 #if ENABLE(WORKERS)
index 72be6b7be40b986ed8cf34977dbb075bceb64daf..f126ae4675b0da540b1ac9d2805cd63c4df015d5 100644 (file)
@@ -235,7 +235,7 @@ void FormData::appendKeyValuePairItems(const FormDataList& list, const TextEncod
                     if (!path.isEmpty()) {
                         if (Page* page = document->page()) {
                             String generatedFileName;
-                            shouldGenerateFile = page->chrome().client()->shouldReplaceWithGeneratedFileForUpload(path, generatedFileName);
+                            shouldGenerateFile = page->chrome().client().shouldReplaceWithGeneratedFileForUpload(path, generatedFileName);
                             if (shouldGenerateFile)
                                 name = generatedFileName;
                         }
@@ -394,13 +394,12 @@ void FormData::generateFiles(Document* document)
     Page* page = document->page();
     if (!page)
         return;
-    ChromeClient* client = page->chrome().client();
 
     size_t n = m_elements.size();
     for (size_t i = 0; i < n; ++i) {
         FormDataElement& e = m_elements[i];
         if (e.m_type == FormDataElement::encodedFile && e.m_shouldGenerateFile) {
-            e.m_generatedFilename = client->generateReplacementFile(e.m_filename);
+            e.m_generatedFilename = page->chrome().client().generateReplacementFile(e.m_filename);
             m_hasGeneratedFiles = true;
         }
     }
index 2d64f940774ae871475f64b2bb4458ace47104af..16ae24aac1fdedc5e96bbe8aee4f35e9d4b6b34a 100644 (file)
@@ -906,7 +906,7 @@ NetworkJob::SendRequestResult NetworkJob::sendRequestWithCredentials(ProtectionS
             updateDeferLoadingCount(1);
 
             AuthenticationChallengeManager::instance()->authenticationChallenge(newURL, protectionSpace,
-                Credential(), this, m_frame->page()->chrome().client()->platformPageClient());
+                Credential(), this, m_frame->page()->chrome().client().platformPageClient());
             return SendRequestWaiting;
         }
 
@@ -962,7 +962,7 @@ void NetworkJob::storeCredentials(AuthenticationChallenge& challenge)
 
         BlackBerry::Platform::Settings::instance()->storeProxyCredentials(proxyInfo);
         if (m_frame && m_frame->page())
-            m_frame->page()->chrome().client()->platformPageClient()->syncProxyCredential(challenge.proposedCredential());
+            m_frame->page()->chrome().client().platformPageClient()->syncProxyCredential(challenge.proposedCredential());
     }
 }
 
index 8ba71e2799f9568efa92ca54ea6d2e1f89fc9d58..fe5b6625d3e267116d491baf414b46fd77755b99 100644 (file)
@@ -131,11 +131,7 @@ void RenderThemeQStyle::setPaletteFromPageClientIfExists(QPalette& palette) cons
     if (!m_page)
         return;
 
-    ChromeClient* chromeClient = m_page->chrome().client();
-    if (!chromeClient)
-        return;
-
-    if (QWebPageClient* pageClient = chromeClient->platformPageClient())
+    if (QWebPageClient* pageClient = m_page->chrome().client().platformPageClient())
         palette = pageClient->palette();
 }
 
index a6c67d90cf1fa93f6932c2509cf22ceee1cb7e9a..9b49fab7a8824c33076175beadbcedb0d7552688 100644 (file)
@@ -1074,7 +1074,7 @@ bool PluginView::platformStart()
     }
 
 #if USE(ACCELERATED_COMPOSITING)
-    if (m_parentFrame->page()->chrome().client()->allowsAcceleratedCompositing()
+    if (m_parentFrame->page()->chrome().client().allowsAcceleratedCompositing()
         && m_parentFrame->page()->settings()
         && m_parentFrame->page()->settings()->acceleratedCompositingEnabled()) {
         m_private->m_platformLayer = PluginLayerWebKitThread::create(this);
index fae3c44159e4878efb931dc9d82d354cbb5d39d6..b2dcd02e30b1d586069720a3070ec9e69fb76a25 100644 (file)
@@ -778,7 +778,7 @@ void PluginView::handleMouseEvent(MouseEvent* event)
     // and since we don't want that we set ignoreNextSetCursor to true here to prevent that.
     ignoreNextSetCursor = true;
     if (Page* page = m_parentFrame->page())
-        page->chrome().client()->setLastSetCursorToCurrentCursor();
+        page->chrome().client().setLastSetCursorToCurrentCursor();
 #endif
 }
 
index 49e2e1dd07374047da733a07fc7f2cf72cb3a566..3849e3c21d0125ec7862ec54ae1137a427ea8c13 100644 (file)
@@ -952,7 +952,7 @@ void InlineTextBox::paintCustomHighlight(const LayoutPoint& paintOffset, const A
     FloatRect rootRect(paintOffset.x() + r->x(), paintOffset.y() + selectionTop(), r->logicalWidth(), selectionHeight());
     FloatRect textRect(paintOffset.x() + x(), rootRect.y(), logicalWidth(), rootRect.height());
 
-    page->chrome().client()->paintCustomHighlight(renderer()->node(), type, textRect, rootRect, true, false);
+    page->chrome().client().paintCustomHighlight(renderer()->node(), type, textRect, rootRect, true, false);
 }
 
 #endif
index 85272de0d0aa13ac0ce5d31c20fb5e64911e01c1..54fe88d1450ad14acd602a579f512e51b02b2bf5 100644 (file)
@@ -1597,10 +1597,10 @@ void RenderBox::paintCustomHighlight(const LayoutPoint& paintOffset, const Atomi
     if (r) {
         FloatRect rootRect(paintOffset.x() + r->x(), paintOffset.y() + r->selectionTop(), r->logicalWidth(), r->selectionHeight());
         FloatRect imageRect(paintOffset.x() + x(), rootRect.y(), width(), rootRect.height());
-        page->chrome().client()->paintCustomHighlight(node(), type, imageRect, rootRect, behindText, false);
+        page->chrome().client().paintCustomHighlight(node(), type, imageRect, rootRect, behindText, false);
     } else {
         FloatRect imageRect(paintOffset.x() + x(), paintOffset.y() + y(), width(), height());
-        page->chrome().client()->paintCustomHighlight(node(), type, imageRect, imageRect, behindText, false);
+        page->chrome().client().paintCustomHighlight(node(), type, imageRect, imageRect, behindText, false);
     }
 }
 
index 26f1c4577f22b1beb72182992a2a752f30b11389..80d7b84f9631f527c89685078c1751e7d4110360 100644 (file)
@@ -152,7 +152,7 @@ static String unavailablePluginReplacementText(RenderEmbeddedObject::PluginUnava
 static bool shouldUnavailablePluginMessageBeButton(Document* document, RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason)
 {
     Page* page = document->page();
-    return page && page->chrome().client()->shouldUnavailablePluginMessageBeButton(pluginUnavailabilityReason);
+    return page && page->chrome().client().shouldUnavailablePluginMessageBeButton(pluginUnavailabilityReason);
 }
 
 void RenderEmbeddedObject::setPluginUnavailabilityReason(PluginUnavailabilityReason pluginUnavailabilityReason)
@@ -633,7 +633,7 @@ void RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent(Event* event)
         }
         if (m_mouseDownWasInUnavailablePluginIndicator && isInUnavailablePluginIndicator(mouseEvent)) {
             if (Page* page = document()->page())
-                page->chrome().client()->unavailablePluginButtonClicked(element, m_pluginUnavailabilityReason);
+                page->chrome().client().unavailablePluginButtonClicked(element, m_pluginUnavailabilityReason);
         }
         m_mouseDownWasInUnavailablePluginIndicator = false;
         event->setDefaultHandled();
index 2033cc7a12b068b437142f20b036e8e14d32b2bc..93b37af76990f3278885645477b2a6e0b56b376c 100644 (file)
@@ -175,7 +175,7 @@ PassOwnPtr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(const String&
 {
     GraphicsLayerFactory* graphicsLayerFactory = 0;
     if (Page* page = renderer()->frame()->page())
-        graphicsLayerFactory = page->chrome().client()->graphicsLayerFactory();
+        graphicsLayerFactory = page->chrome().client().graphicsLayerFactory();
 
     OwnPtr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFactory, this);
 
index 83edbf9eacf12368a657124c8dacf002fa209b4a..99d40a78ce436d551362dc21eab27f4cd1c293b7 100644 (file)
@@ -285,8 +285,7 @@ void RenderLayerCompositor::cacheAcceleratedCompositingFlags()
         // on a chrome that doesn't allow accelerated compositing.
         if (hasAcceleratedCompositing) {
             if (Page* page = this->page()) {
-                ChromeClient* chromeClient = page->chrome().client();
-                m_compositingTriggers = chromeClient->allowedCompositingTriggers();
+                m_compositingTriggers = page->chrome().client().allowedCompositingTriggers();
                 hasAcceleratedCompositing = m_compositingTriggers;
             }
         }
@@ -357,7 +356,7 @@ void RenderLayerCompositor::scheduleLayerFlushNow()
 {
     m_hasPendingLayerFlush = false;
     if (Page* page = this->page())
-        page->chrome().client()->scheduleCompositingLayerFlush();
+        page->chrome().client().scheduleCompositingLayerFlush();
 }
 
 void RenderLayerCompositor::scheduleLayerFlush(bool canThrottle)
@@ -2631,7 +2630,7 @@ GraphicsLayer* RenderLayerCompositor::updateLayerForHeader(bool wantsLayer)
         scrollingCoordinator->frameViewRootLayerDidChange(m_renderView->frameView());
 
     if (Page* page = this->page())
-        page->chrome().client()->didAddHeaderLayer(m_layerForHeader.get());
+        page->chrome().client().didAddHeaderLayer(m_layerForHeader.get());
 
     return m_layerForHeader.get();
 }
@@ -2670,7 +2669,7 @@ GraphicsLayer* RenderLayerCompositor::updateLayerForFooter(bool wantsLayer)
         scrollingCoordinator->frameViewRootLayerDidChange(m_renderView->frameView());
 
     if (Page* page = this->page())
-        page->chrome().client()->didAddFooterLayer(m_layerForFooter.get());
+        page->chrome().client().didAddFooterLayer(m_layerForFooter.get());
 
     return m_layerForFooter.get();
 }
@@ -2708,7 +2707,7 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
             m_layerForOverhangAreas->setDrawsContent(false);
             m_layerForOverhangAreas->setSize(m_renderView->frameView()->frameRect().size());
 
-            ScrollbarTheme::theme()->setUpOverhangAreasLayerContents(m_layerForOverhangAreas.get(), this->page()->chrome().client()->underlayColor());
+            ScrollbarTheme::theme()->setUpOverhangAreasLayerContents(m_layerForOverhangAreas.get(), this->page()->chrome().client().underlayColor());
 
             // We want the overhang areas layer to be positioned below the frame contents,
             // so insert it below the clip layer.
@@ -2933,7 +2932,7 @@ void RenderLayerCompositor::attachRootLayer(RootLayerAttachment attachment)
             if (!page)
                 return;
 
-            page->chrome().client()->attachRootGraphicsLayer(&frame, rootGraphicsLayer());
+            page->chrome().client().attachRootGraphicsLayer(&frame, rootGraphicsLayer());
             break;
         }
         case RootLayerAttachedViaEnclosingFrame: {
@@ -2977,7 +2976,7 @@ void RenderLayerCompositor::detachRootLayer()
         if (!page)
             return;
 
-        page->chrome().client()->attachRootGraphicsLayer(&frame, 0);
+        page->chrome().client().attachRootGraphicsLayer(&frame, 0);
     }
     break;
     case RootLayerUnattached:
@@ -3240,7 +3239,7 @@ ScrollingCoordinator* RenderLayerCompositor::scrollingCoordinator() const
 GraphicsLayerFactory* RenderLayerCompositor::graphicsLayerFactory() const
 {
     if (Page* page = this->page())
-        return page->chrome().client()->graphicsLayerFactory();
+        return page->chrome().client().graphicsLayerFactory();
 
     return 0;
 }
@@ -3307,7 +3306,7 @@ void RenderLayerCompositor::paintRelatedMilestonesTimerFired(Timer<RenderLayerCo
         return;
 
     // If the layer tree is frozen, we'll paint when it's unfrozen and schedule the timer again.
-    if (page->chrome().client()->layerTreeStateIsFrozen())
+    if (page->chrome().client().layerTreeStateIsFrozen())
         return;
 
     frameView->firePaintRelatedMilestones();
index fc8ef94c1565449298f019c44c9f6a7909d57b82..084f32f1c9d9f3365d5eccae3fafd42226a3a0ec 100644 (file)
@@ -188,7 +188,7 @@ void RootInlineBox::addHighlightOverflow()
 
     // Highlight acts as a selection inflation.
     FloatRect rootRect(0, selectionTop(), logicalWidth(), selectionHeight());
-    IntRect inflatedRect = enclosingIntRect(page->chrome().client()->customHighlightRect(renderer()->node(), renderer()->style()->highlight(), rootRect));
+    IntRect inflatedRect = enclosingIntRect(page->chrome().client().customHighlightRect(renderer()->node(), renderer()->style()->highlight(), rootRect));
     setOverflowFromLogicalRects(inflatedRect, inflatedRect, lineTop(), lineBottom());
 }
 
@@ -206,9 +206,9 @@ void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, const LayoutPoint
 
     // Get the inflated rect so that we can properly hit test.
     FloatRect rootRect(paintOffset.x() + x(), paintOffset.y() + selectionTop(), logicalWidth(), selectionHeight());
-    FloatRect inflatedRect = page->chrome().client()->customHighlightRect(renderer()->node(), highlightType, rootRect);
+    FloatRect inflatedRect = page->chrome().client().customHighlightRect(renderer()->node(), highlightType, rootRect);
     if (inflatedRect.intersects(paintInfo.rect))
-        page->chrome().client()->paintCustomHighlight(renderer()->node(), highlightType, rootRect, rootRect, false, true);
+        page->chrome().client().paintCustomHighlight(renderer()->node(), highlightType, rootRect, rootRect, false, true);
 }
 
 #endif
index 0bf6efcf251bd0c6ff8395c98836d6a1985624fb..4b30c7aa2c221711113c51f3781dd82a0e41eb52 100644 (file)
@@ -402,8 +402,7 @@ bool isInSVGImage(const Element* element)
     if (!page)
         return false;
 
-    ChromeClient* chromeClient = page->chrome().client();
-    return chromeClient && chromeClient->isSVGImageChromeClient();
+    return page->chrome().client().isSVGImageChromeClient();
 }
 
 }
index 46be6a148f47f803566b29c16f54e274c0329e6d..6d619b2c2b753083ed3e8f738d136395ae5bfa62 100644 (file)
@@ -5267,7 +5267,7 @@ LayerRenderingResults WebPagePrivate::lastCompositingResults() const
 
 WebCore::GraphicsLayerFactory* WebPagePrivate::graphicsLayerFactory() const
 {
-    return m_page->chrome().client()->graphicsLayerFactory();
+    return m_page->chrome().client().graphicsLayerFactory();
 }
 
 GraphicsLayer* WebPagePrivate::overlayLayer()
@@ -6014,7 +6014,7 @@ bool WebPagePrivate::openPagePopup(PagePopupClient* popupClient, const WebCore::
     closePagePopup();
     m_pagePopup = PagePopup::create(this, popupClient);
 
-    WebCore::IntRect popupRect = m_page->chrome().client()->rootViewToScreen(originBoundsInRootView);
+    WebCore::IntRect popupRect = m_page->chrome().client().rootViewToScreen(originBoundsInRootView);
     popupRect.setSize(popupClient->contentSize());
     if (!m_client->createPopupWebView(popupRect)) {
         closePagePopup();
index 4fd9e00eea2be9c4e0d782162031ab65411b7f03..c4dd992c0acf13af2f0ce20a5cfb0f5bada91dda 100644 (file)
@@ -51,20 +51,18 @@ PopupMenuEfl::~PopupMenuEfl()
 void PopupMenuEfl::show(const IntRect& rect, FrameView* view, int index)
 {
     ASSERT(m_popupClient);
-    ChromeClientEfl* chromeClient = static_cast<ChromeClientEfl*>(view->frame().page()->chrome().client());
-    ASSERT(chromeClient);
+    ChromeClientEfl& chromeClient = static_cast<ChromeClientEfl&>(view->frame().page()->chrome().client());
 
     m_view = view;
-    chromeClient->createSelectPopup(m_popupClient, index, rect);
+    chromeClient.createSelectPopup(m_popupClient, index, rect);
 }
 
 void PopupMenuEfl::hide()
 {
     ASSERT(m_view);
-    ChromeClientEfl* chromeClient = static_cast<ChromeClientEfl*>(m_view->frame().page()->chrome().client());
-    ASSERT(chromeClient);
+    ChromeClientEfl& chromeClient = static_cast<ChromeClientEfl&>(m_view->frame().page()->chrome().client());
 
-    chromeClient->destroySelectPopup();
+    chromeClient.destroySelectPopup();
 }
 
 void PopupMenuEfl::updateFromElement()
index e1fcb9212e85438cacce3c10b0ca14f2127bc76e..ffc1aceaa1bd35dbcc617778cc230f09cf34dfac 100644 (file)
@@ -1233,8 +1233,8 @@ static void _ewk_view_zoom_animation_start(Ewk_View_Smart_Data* smartData)
 static WebCore::ViewportAttributes _ewk_view_viewport_attributes_compute(Ewk_View_Private_Data* priv)
 {
     int desktopWidth = 980;
-    WebCore::IntRect availableRect = enclosingIntRect(priv->page->chrome().client()->pageRect());
-    WebCore::IntRect deviceRect = enclosingIntRect(priv->page->chrome().client()->windowRect());
+    WebCore::IntRect availableRect = enclosingIntRect(priv->page->chrome().client().pageRect());
+    WebCore::IntRect deviceRect = enclosingIntRect(priv->page->chrome().client().windowRect());
 
     WebCore::ViewportAttributes attributes = WebCore::computeViewportAttributes(priv->viewportArguments, desktopWidth, deviceRect.width(), deviceRect.height(), priv->page->deviceScaleFactor(), availableRect.size());
     WebCore::restrictMinimumScaleFactorToViewportSize(attributes, availableRect.size(), priv->page->deviceScaleFactor());
index 9b76df90d7bc5c57ac573f1b76f4c5a6eb00f8fc..354af6783dc1a35ee722bfee715a81fd9696787e 100644 (file)
@@ -438,7 +438,7 @@ void DumpRenderTreeSupportGtk::forceWebViewPaint(WebKitWebView* webView)
 {
     g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
 
-    static_cast<WebKit::ChromeClient*>(core(webView)->chrome().client())->forcePaint();
+    static_cast<WebKit::ChromeClient&>(core(webView)->chrome().client()).forcePaint();
 }
 
 void DumpRenderTreeSupportGtk::whiteListAccessFromOrigin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains)
index e7e86cc01af1d18052773cf8a6ab960fc1d06c4d..7c4137c08a32ae3e5ddb6c5070a99ba8bbbfdb2e 100644 (file)
@@ -470,7 +470,7 @@ static void setHorizontalAdjustment(WebKitWebView* webView, GtkAdjustment* adjus
     // This may be called after the page has been destroyed, in which case we do nothing.
     Page* page = core(webView);
     if (page)
-        static_cast<WebKit::ChromeClient*>(page->chrome().client())->adjustmentWatcher()->setHorizontalAdjustment(adjustment);
+        static_cast<WebKit::ChromeClient&>(page->chrome().client()).adjustmentWatcher()->setHorizontalAdjustment(adjustment);
 }
 
 static void setVerticalAdjustment(WebKitWebView* webView, GtkAdjustment* adjustment)
@@ -478,7 +478,7 @@ static void setVerticalAdjustment(WebKitWebView* webView, GtkAdjustment* adjustm
     // This may be called after the page has been destroyed, in which case we do nothing.
     Page* page = core(webView);
     if (page)
-        static_cast<WebKit::ChromeClient*>(page->chrome().client())->adjustmentWatcher()->setVerticalAdjustment(adjustment);
+        static_cast<WebKit::ChromeClient&>(page->chrome().client()).adjustmentWatcher()->setVerticalAdjustment(adjustment);
 }
 
 #ifndef GTK_API_VERSION_2
@@ -486,7 +486,7 @@ static GtkAdjustment* getHorizontalAdjustment(WebKitWebView* webView)
 {
     Page* page = core(webView);
     if (page)
-        return static_cast<WebKit::ChromeClient*>(page->chrome().client())->adjustmentWatcher()->horizontalAdjustment();
+        return static_cast<WebKit::ChromeClient&>(page->chrome().client()).adjustmentWatcher()->horizontalAdjustment();
     return 0;
 }
 
@@ -494,7 +494,7 @@ static GtkAdjustment* getVerticalAdjustment(WebKitWebView* webView)
 {
     Page* page = core(webView);
     if (page)
-        return static_cast<WebKit::ChromeClient*>(page->chrome().client())->adjustmentWatcher()->verticalAdjustment();
+        return static_cast<WebKit::ChromeClient&>(page->chrome().client()).adjustmentWatcher()->verticalAdjustment();
     return 0;
 }
 
@@ -867,9 +867,9 @@ static void resizeWebViewFromAllocation(WebKitWebView* webView, GtkAllocation* a
     if (!sizeChanged)
         return;
 
-    WebKit::ChromeClient* chromeClient = static_cast<WebKit::ChromeClient*>(page->chrome().client());
-    chromeClient->widgetSizeChanged(oldSize, IntSize(allocation->width, allocation->height));
-    chromeClient->adjustmentWatcher()->updateAdjustmentsFromScrollbars();
+    WebKit::ChromeClient& chromeClient = static_cast<WebKit::ChromeClient&>(page->chrome().client());
+    chromeClient.widgetSizeChanged(oldSize, IntSize(allocation->width, allocation->height));
+    chromeClient.adjustmentWatcher()->updateAdjustmentsFromScrollbars();
 }
 
 static void webkit_web_view_size_allocate(GtkWidget* widget, GtkAllocation* allocation)
@@ -5541,11 +5541,11 @@ WebKitWebView* kit(WebCore::Page* corePage)
     if (!corePage)
         return 0;
 
-    WebCore::ChromeClient* chromeClient = corePage->chrome().client();
-    if (chromeClient->isEmptyChromeClient())
+    WebCore::ChromeClient& chromeClient = corePage->chrome().client();
+    if (chromeClient.isEmptyChromeClient())
         return 0;
 
-    return static_cast<WebKit::ChromeClient*>(chromeClient)->webView();
+    return static_cast<WebKit::ChromeClient&>(chromeClient).webView();
 }
 
 }
index 9f3f75bd3ee8a77b62ce75f577c625c780512101..1fc6c7e004610403bde8ccbf2c3a186c346c2838 100644 (file)
@@ -245,11 +245,10 @@ WebView *kit(Page* page)
     if (!page)
         return nil;
 
-    ChromeClient* chromeClient = page->chrome().client();
-    if (chromeClient->isEmptyChromeClient())
+    if (page->chrome().client().isEmptyChromeClient())
         return nil;
 
-    return static_cast<WebChromeClient*>(chromeClient)->webView();
+    return static_cast<WebChromeClient&>(page->chrome().client()).webView();
 }
 
 WebView *getWebView(WebFrame *webFrame)
index 5b15c6188bf1b7e4ffb44cc0431d8b106ea1c946..a89f10e87585b8437e00adb455cf86d1bad64efc 100644 (file)
@@ -61,7 +61,7 @@ static WebCore::QStyleFacade* createStyleForPage(WebCore::Page* page)
 {
     QWebPageAdapter* pageAdapter = 0;
     if (page)
-        pageAdapter = static_cast<WebCore::ChromeClientQt*>(page->chrome().client())->m_webPage;
+        pageAdapter = static_cast<WebCore::ChromeClientQt&>(page->chrome().client()).m_webPage;
     return initCallback(pageAdapter);
 }
 
index d049fe3b769ffdadef27e78ae0cfd9df931d36a3..afb1adb287c4e799207aca0863304f92065b7ce1 100644 (file)
@@ -138,8 +138,8 @@ void PlatformStrategiesQt::refreshPlugins()
 void PlatformStrategiesQt::getPluginInfo(const WebCore::Page* page, Vector<WebCore::PluginInfo>& outPlugins)
 {
     QWebPageAdapter* qPage = 0;
-    if (!page->chrome().client()->isEmptyChromeClient())
-        qPage = static_cast<ChromeClientQt*>(page->chrome().client())->m_webPage;
+    if (!page->chrome().client().isEmptyChromeClient())
+        qPage = static_cast<ChromeClientQt&>(page->chrome().client()).m_webPage;
 
     QWebPluginFactory* factory;
     if (qPage && (factory = qPage->pluginFactory)) {
index 2af19edba68515cc47ef065af86650782817539f..bd6e9c32271981d98d73b68ef64ac8aa6616779f 100644 (file)
@@ -441,7 +441,7 @@ void QWebFrameAdapter::renderCompositedLayers(WebCore::GraphicsContext* context,
     WebCore::Page* page = frame->page();
     if (!page)
         return;
-    if (TextureMapperLayerClientQt* client = static_cast<ChromeClientQt*>(page->chrome().client())->m_textureMapperLayerClient.get())
+    if (TextureMapperLayerClientQt* client = static_cast<ChromeClientQt&>(page->chrome().client()).m_textureMapperLayerClient.get())
         client->renderCompositedLayers(context, clip);
 }
 #endif
index e4d1818e34be074746a111d2fd8d89a78077cc32..04cf6654e6b9acd660e02b3275ecb981b85410f8 100644 (file)
@@ -300,7 +300,7 @@ void QWebPageAdapter::deletePage()
 
 QWebPageAdapter* QWebPageAdapter::kit(Page* page)
 {
-    return static_cast<ChromeClientQt*>(page->chrome().client())->m_webPage;
+    return static_cast<ChromeClientQt&>(page->chrome().client()).m_webPage;
 }
 
 ViewportArguments QWebPageAdapter::viewportArguments() const
index 0ee7af3850bdfc4ab16fe5c2f8e9090607ae9bba..165192f39c7cc2116f3a43512858511a337a0c3d 100644 (file)
@@ -204,11 +204,10 @@ WebView* kit(Page* page)
     if (!page)
         return 0;
     
-    ChromeClient* chromeClient = page->chrome().client();
-    if (chromeClient->isEmptyChromeClient())
+    if (page->chrome().client().isEmptyChromeClient())
         return 0;
     
-    return static_cast<WebChromeClient*>(chromeClient)->webView();
+    return static_cast<WebChromeClient&>(page->chrome().client()).webView();
 }
 
 static inline AtomicString toAtomicString(BSTR bstr)
index 79ffacec891496eae3d949c7b3194ba574a1a14a..fbd50d455d1e3c2f36fc9407d8657ecdf2071ac5 100644 (file)
@@ -1064,7 +1064,7 @@ void WebPage::layoutIfNeeded()
 
 WebPage* WebPage::fromCorePage(Page* page)
 {
-    return static_cast<WebChromeClient*>(page->chrome().client())->page();
+    return static_cast<WebChromeClient&>(page->chrome().client()).page();
 }
 
 void WebPage::setSize(const WebCore::IntSize& viewSize)