Move displayID stuff from Widget to Chrome
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Jun 2013 21:02:36 +0000 (21:02 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Jun 2013 21:02:36 +0000 (21:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=117944

Reviewed by Anders Carlsson.

In r151877 I polluted Widget with displayID-related stuff. This would
be better on HostWindow, so move it there. This is a net code reduction,
and eliminates PlatformScreenMac.h, and the NSScreen category.

Source/WebCore:

* WebCore.exp.in: Remove some functions from the exports list.
* WebCore.xcodeproj/project.pbxproj: PlatformScreenMac.h is gone!
* dom/Document.cpp:
(WebCore::Document::requestAnimationFrame): Get the displayID from page->chrome()
* page/Chrome.cpp:
(WebCore::Chrome::Chrome): Initialize m_displayID.
(WebCore::Chrome::displayID):
(WebCore::Chrome::windowScreenDidChange): Code moved from Page; save the
displayID, and tell all subframes that the displayID changed.
* page/Chrome.h: Add displayID-related functions.
* page/FrameView.cpp: Removed windowDisplayID().
* page/FrameView.h: Ditto.
* page/Page.cpp: Removed code.
(WebCore::Page::Page):
* page/Page.h:
* platform/HostWindow.h: Added virtual displayID-related functions.
* platform/Widget.cpp: Removed code.
* platform/Widget.h: Ditto.
* platform/mac/PlatformScreenMac.h: Removed.
* platform/mac/PlatformScreenMac.mm: Removed the NSScreen category.
(WebCore::displayIDFromScreen):
(WebCore::screenForDisplayID):
(WebCore::displayFromWidget):
(WebCore::screenForWidget):
* platform/mac/WidgetMac.mm: Removed windowDisplayID().
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh): Get
the displayID via chrome().

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView doWindowDidChangeScreen]): Go via chrome().

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::windowScreenDidChange): Go via chrome().

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

21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Document.cpp
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/Chrome.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/platform/HostWindow.h
Source/WebCore/platform/Widget.cpp
Source/WebCore/platform/Widget.h
Source/WebCore/platform/mac/PlatformScreenMac.h [deleted file]
Source/WebCore/platform/mac/PlatformScreenMac.mm
Source/WebCore/platform/mac/WidgetMac.mm
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 19fc273..57e66e7 100644 (file)
@@ -1,3 +1,43 @@
+2013-06-24  Simon Fraser  <simon.fraser@apple.com>
+
+        Move displayID stuff from Widget to Chrome
+        https://bugs.webkit.org/show_bug.cgi?id=117944
+
+        Reviewed by Anders Carlsson.
+
+        In r151877 I polluted Widget with displayID-related stuff. This would
+        be better on HostWindow, so move it there. This is a net code reduction,
+        and eliminates PlatformScreenMac.h, and the NSScreen category.
+
+        * WebCore.exp.in: Remove some functions from the exports list.
+        * WebCore.xcodeproj/project.pbxproj: PlatformScreenMac.h is gone!
+        * dom/Document.cpp:
+        (WebCore::Document::requestAnimationFrame): Get the displayID from page->chrome()
+        * page/Chrome.cpp:
+        (WebCore::Chrome::Chrome): Initialize m_displayID.
+        (WebCore::Chrome::displayID):
+        (WebCore::Chrome::windowScreenDidChange): Code moved from Page; save the
+        displayID, and tell all subframes that the displayID changed.
+        * page/Chrome.h: Add displayID-related functions.
+        * page/FrameView.cpp: Removed windowDisplayID().
+        * page/FrameView.h: Ditto.
+        * page/Page.cpp: Removed code.
+        (WebCore::Page::Page):
+        * page/Page.h:
+        * platform/HostWindow.h: Added virtual displayID-related functions.
+        * platform/Widget.cpp: Removed code.
+        * platform/Widget.h: Ditto.
+        * platform/mac/PlatformScreenMac.h: Removed.
+        * platform/mac/PlatformScreenMac.mm: Removed the NSScreen category.
+        (WebCore::displayIDFromScreen):
+        (WebCore::screenForDisplayID):
+        (WebCore::displayFromWidget):
+        (WebCore::screenForWidget):
+        * platform/mac/WidgetMac.mm: Removed windowDisplayID().
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh): Get
+        the displayID via chrome().
+
 2013-06-24  Andreas Kling  <akling@apple.com>
 
         Don't create Document's selector query cache just to invalidate it.
index 564a0a9..665c1f1 100644 (file)
@@ -1011,7 +1011,6 @@ __ZN7WebCore6Widget5paintEPNS_15GraphicsContextERKNS_7IntRectE
 __ZN7WebCore6Widget8setFocusEb
 __ZN7WebCore6Widget9setParentEPNS_10ScrollViewE
 __ZN7WebCore6WidgetD2Ev
-__ZNK7WebCore6Widget15windowDisplayIDEv
 __ZN7WebCore6toInt8EPN3JSC9ExecStateENS0_7JSValueENS_30IntegerConversionConfigurationE
 __ZN7WebCore6toNodeEN3JSC7JSValueE
 __ZN7WebCore7Element12setAttributeERKN3WTF12AtomicStringES4_Ri
@@ -1898,7 +1897,6 @@ __ZN7WebCore38contextMenuItemTagWritingDirectionMenuEv
 __ZN7WebCore42contextMenuItemTagCheckGrammarWithSpellingEv
 __ZN7WebCore42contextMenuItemTagCheckSpellingWhileTypingEv
 __ZN7WebCore46contextMenuItemTagCorrectSpellingAutomaticallyEv
-__ZN7WebCore4Page21windowScreenDidChangeEj
 __ZN7WebCore5Frame9nodeImageEPNS_4NodeE
 __ZN7WebCore6Cursor8fromTypeENS0_4TypeE
 __ZN7WebCore6CursorC1EPNS_5ImageERKNS_8IntPointE
index aaa131c..6211e28 100644 (file)
                0F13164016ED0CDE0035CC04 /* PlatformCAFiltersMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersMac.mm */; };
                0F15DA8A0F3AAEE70000CE47 /* AnimationControllerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15DA890F3AAEE70000CE47 /* AnimationControllerPrivate.h */; };
                0F29C16E1300C2E2002D794E /* AccessibilityAllInOne.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F29C16D1300C2E2002D794E /* AccessibilityAllInOne.cpp */; };
-               0F2C98EB1774084C00C1BBBA /* PlatformScreenMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2C98EA1774084C00C1BBBA /* PlatformScreenMac.h */; };
                0F3DD44F12F5EA1B000D9190 /* ShadowBlur.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3DD44D12F5EA1B000D9190 /* ShadowBlur.cpp */; };
                0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3DD44E12F5EA1B000D9190 /* ShadowBlur.h */; };
                0F3F0E59157030C3006DA57F /* RenderGeometryMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3F0E57157030C3006DA57F /* RenderGeometryMap.cpp */; };
                0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlatformCAFiltersMac.mm; path = ca/mac/PlatformCAFiltersMac.mm; sourceTree = "<group>"; };
                0F15DA890F3AAEE70000CE47 /* AnimationControllerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationControllerPrivate.h; path = animation/AnimationControllerPrivate.h; sourceTree = "<group>"; };
                0F29C16D1300C2E2002D794E /* AccessibilityAllInOne.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityAllInOne.cpp; sourceTree = "<group>"; };
-               0F2C98EA1774084C00C1BBBA /* PlatformScreenMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformScreenMac.h; sourceTree = "<group>"; };
                0F3DD44D12F5EA1B000D9190 /* ShadowBlur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowBlur.cpp; sourceTree = "<group>"; };
                0F3DD44E12F5EA1B000D9190 /* ShadowBlur.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowBlur.h; sourceTree = "<group>"; };
                0F3F0E57157030C3006DA57F /* RenderGeometryMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderGeometryMap.cpp; sourceTree = "<group>"; };
                                BCAA486E14A052530088FAC4 /* PlatformEventFactoryMac.h */,
                                BCAA486D14A052530088FAC4 /* PlatformEventFactoryMac.mm */,
                                C5F765BA14E1ECF4006C899B /* PlatformPasteboardMac.mm */,
-                               0F2C98EA1774084C00C1BBBA /* PlatformScreenMac.h */,
                                BC94D1070C274F88006BC617 /* PlatformScreenMac.mm */,
                                29E4D8E016B0959800C84704 /* PlatformSpeechSynthesizerMac.mm */,
                                0081FEFE16B0A2B6008AAA7A /* PublicSuffixMac.mm */,
                                935C476909AC4D4300A6AAB4 /* PlatformMouseEvent.h in Headers */,
                                C598905814E9C29900E8D18B /* PlatformPasteboard.h in Headers */,
                                BCEC01D70C274EB4009F4EC9 /* PlatformScreen.h in Headers */,
-                               0F2C98EB1774084C00C1BBBA /* PlatformScreenMac.h in Headers */,
                                297BE3D516C03C08003316BD /* PlatformSpeechSynthesisUtterance.h in Headers */,
                                297BE3D616C03C0B003316BD /* PlatformSpeechSynthesisVoice.h in Headers */,
                                297BE3D716C03C0E003316BD /* PlatformSpeechSynthesizer.h in Headers */,
index eeaaf8b..56cc7d0 100644 (file)
@@ -5467,7 +5467,7 @@ int Document::requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> ca
 {
     if (!m_scriptedAnimationController) {
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-        m_scriptedAnimationController = ScriptedAnimationController::create(this, page() ? page()->displayID() : 0);
+        m_scriptedAnimationController = ScriptedAnimationController::create(this, page() ? page()->chrome().displayID() : 0);
 #else
         m_scriptedAnimationController = ScriptedAnimationController::create(this, 0);
 #endif
index d9fa243..e5c833e 100644 (file)
@@ -65,6 +65,7 @@ using namespace std;
 Chrome::Chrome(Page* page, ChromeClient* client)
     : m_page(page)
     , m_client(client)
+    , m_displayID(0)
 {
     ASSERT(m_client);
 }
@@ -529,6 +530,24 @@ void Chrome::scheduleAnimation()
 }
 #endif
 
+PlatformDisplayID Chrome::displayID() const
+{
+    return m_displayID;
+}
+
+void Chrome::windowScreenDidChange(PlatformDisplayID displayID)
+{
+    if (displayID == m_displayID)
+        return;
+
+    m_displayID = displayID;
+
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+        if (frame->document())
+            frame->document()->windowScreenDidChange(displayID);
+    }
+}
+
 // --------
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
index 5831920..f3de5ba 100644 (file)
@@ -88,6 +88,9 @@ public:
     virtual void scheduleAnimation() OVERRIDE;
 #endif
 
+    virtual PlatformDisplayID displayID() const OVERRIDE;
+    virtual void windowScreenDidChange(PlatformDisplayID) OVERRIDE;
+
     void scrollRectIntoView(const IntRect&) const;
 
     void contentsSizeChanged(Frame*, const IntSize&) const;
@@ -186,6 +189,7 @@ private:
 
     Page* m_page;
     ChromeClient* m_client;
+    PlatformDisplayID m_displayID;
     Vector<PopupOpeningObserver*> m_popupOpeningObservers;
 };
 
index 0554328..0b7fe76 100644 (file)
@@ -3975,14 +3975,6 @@ IntPoint FrameView::convertFromContainingView(const IntPoint& parentPoint) const
     return parentPoint;
 }
 
-PlatformDisplayID FrameView::windowDisplayID() const
-{
-    if (Page* page = m_frame->page())
-        return page->displayID();
-    
-    return Widget::windowDisplayID();
-}
-
 // Normal delay
 void FrameView::setRepaintThrottlingDeferredRepaintDelay(double p)
 {
index 42353ec..e0be297 100644 (file)
@@ -482,8 +482,6 @@ private:
     virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE;
     virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE;
 
-    virtual PlatformDisplayID windowDisplayID() const OVERRIDE;
-
     // ScrollableArea interface
     virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE;
     virtual void getTickmarks(Vector<IntRect>&) const OVERRIDE;
index 2ef5e09..90430dd 100644 (file)
@@ -176,7 +176,6 @@ Page::Page(PageClients& pageClients)
 #if ENABLE(PAGE_VISIBILITY_API)
     , m_visibilityState(PageVisibilityStateVisible)
 #endif
-    , m_displayID(0)
     , m_requestedLayoutMilestones(0)
     , m_headerHeight(0)
     , m_footerHeight(0)
@@ -942,16 +941,6 @@ void Page::setIsInWindow(bool isInWindow)
     }
 }
 
-void Page::windowScreenDidChange(PlatformDisplayID displayID)
-{
-    m_displayID = displayID;
-    
-    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
-        if (frame->document())
-            frame->document()->windowScreenDidChange(displayID);
-    }
-}
-
 void Page::suspendScriptedAnimations()
 {
     m_scriptedAnimationsSuspended = true;
index 07b351a..3364c6a 100644 (file)
@@ -302,8 +302,6 @@ public:
     void setIsInWindow(bool);
     bool isInWindow() const { return m_isInWindow; }
 
-    void windowScreenDidChange(PlatformDisplayID);
-
     void suspendScriptedAnimations();
     void resumeScriptedAnimations();
     bool scriptedAnimationsSuspended() const { return m_scriptedAnimationsSuspended; }
@@ -355,8 +353,6 @@ public:
     void setVisibilityState(PageVisibilityState, bool);
 #endif
 
-    PlatformDisplayID displayID() const { return m_displayID; }
-
     void addLayoutMilestones(LayoutMilestones);
     void removeLayoutMilestones(LayoutMilestones);
     LayoutMilestones requestedLayoutMilestones() const { return m_requestedLayoutMilestones; }
@@ -523,7 +519,6 @@ private:
 #if ENABLE(PAGE_VISIBILITY_API)
     PageVisibilityState m_visibilityState;
 #endif
-    PlatformDisplayID m_displayID;
 
     LayoutMilestones m_requestedLayoutMilestones;
 
index 7c5bb20..5277e76 100644 (file)
@@ -73,6 +73,9 @@ public:
 #if ENABLE(REQUEST_ANIMATION_FRAME)
     virtual void scheduleAnimation() = 0;
 #endif
+
+    virtual PlatformDisplayID displayID() const = 0;
+    virtual void windowScreenDidChange(PlatformDisplayID) = 0;
 };
 
 } // namespace WebCore
index 8f07870..613c473 100644 (file)
@@ -161,11 +161,6 @@ IntPoint Widget::convertFromContainingWindowToRoot(const Widget*, const IntPoint
 {
     return point;
 }
-
-PlatformDisplayID Widget::windowDisplayID() const
-{
-    return 0;
-}
 #endif
 
 IntRect Widget::convertToContainingView(const IntRect& localRect) const
index 20ca84e..a4a18a0 100644 (file)
@@ -225,9 +225,6 @@ public:
     virtual IntRect convertFromContainingView(const IntRect&) const;
     virtual IntPoint convertToContainingView(const IntPoint&) const;
     virtual IntPoint convertFromContainingView(const IntPoint&) const;
-    
-    // Return the displayID of the screen that this widget's window is primarily on.
-    virtual PlatformDisplayID windowDisplayID() const;
 
 private:
     void init(PlatformWidget); // Must be called by all Widget constructors to initialize cross-platform data.
diff --git a/Source/WebCore/platform/mac/PlatformScreenMac.h b/Source/WebCore/platform/mac/PlatformScreenMac.h
deleted file mode 100644 (file)
index a1c43e6..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PlatformScreenMac_h
-#define PlatformScreenMac_h
-
-#include "PlatformScreen.h"
-
-@interface NSScreen(WebCoreNSScreenUtilities)
-
-+ (NSScreen *)screenForDislayID:(PlatformDisplayID)displayID;
-- (PlatformDisplayID)displayID;
-
-@end
-
-
-#endif // PlatformScreenMac_h
index 6cd9fbd..4c8d714 100644 (file)
 #import "PlatformScreen.h"
 
 #import "FloatRect.h"
-#import "Frame.h"
-#import "Page.h"
-#import "Widget.h"
+#import "HostWindow.h"
+#import "ScrollView.h"
 #import "NotImplemented.h"
 
-@implementation NSScreen(WebCoreNSScreenUtilities)
-+ (NSScreen *)screenForDislayID:(PlatformDisplayID)displayID
+namespace WebCore {
+
+static PlatformDisplayID displayIDFromScreen(NSScreen *screen)
+{
+    return (PlatformDisplayID)[[[screen deviceDescription] objectForKey:@"NSScreenNumber"] intValue];
+}
+
+static NSScreen *screenForDisplayID(PlatformDisplayID displayID)
 {
     for (NSScreen *screen in [NSScreen screens]) {
-        if ([screen displayID] == displayID)
+        if (displayIDFromScreen(screen) == displayID)
             return screen;
     }
     return nil;
 }
 
-- (PlatformDisplayID)displayID
-{
-    return (PlatformDisplayID)[[[self deviceDescription] objectForKey:@"NSScreenNumber"] intValue];
-}
-@end
-
-namespace WebCore {
-
 int screenDepth(Widget*)
 {
     return NSBitsPerPixelFromDepth([[NSScreen deepestScreen] depth]);
@@ -68,6 +65,18 @@ bool screenIsMonochrome(Widget*)
 // These functions scale between screen and page coordinates because JavaScript/DOM operations 
 // assume that the screen and the page share the same coordinate system.
 
+static PlatformDisplayID displayFromWidget(Widget* widget)
+{
+    if (!widget)
+        return 0;
+    
+    ScrollView* view = widget->root();
+    if (!view)
+        return 0;
+
+    return view->hostWindow()->displayID();
+}
+
 static NSScreen *screenForWidget(Widget* widget, NSWindow *window)
 {
     // Widget is in an NSWindow, use its screen.
@@ -75,7 +84,7 @@ static NSScreen *screenForWidget(Widget* widget, NSWindow *window)
         return screenForWindow(window);
     
     // Didn't get an NSWindow; probably WebKit2. Try using the Widget's display ID.
-    if (NSScreen *screen = widget ? [NSScreen screenForDislayID:widget->windowDisplayID()] : nil)
+    if (NSScreen *screen = screenForDisplayID(displayFromWidget(widget)))
         return screen;
     
     // Widget's window is offscreen, or no screens. Fall back to the first screen if available.
index e4a4cd8..5980290 100644 (file)
@@ -37,7 +37,6 @@
 #import "NotImplemented.h"
 #import "Page.h"
 #import "PlatformMouseEvent.h"
-#import "PlatformScreenMac.h"
 #import "ScrollView.h"
 #import "WebCoreFrameView.h"
 #import "WebCoreView.h"
@@ -356,9 +355,4 @@ void Widget::setPlatformWidget(NSView *widget)
     m_data->previousVisibleRect = NSZeroRect;
 }
 
-PlatformDisplayID Widget::windowDisplayID() const
-{
-    return [[[platformWidget() window] screen] displayID];
-}
-
 } // namespace WebCore
index 9b552f9..a96fc24 100644 (file)
@@ -421,7 +421,7 @@ void RenderLayerCompositor::notifyFlushBeforeDisplayRefresh(const GraphicsLayer*
     if (!m_layerUpdater) {
         PlatformDisplayID displayID = 0;
         if (Page* page = this->page())
-            displayID = page->displayID();
+            displayID = page->chrome().displayID();
 
         m_layerUpdater = adoptPtr(new GraphicsLayerUpdater(this, displayID));
     }
index d31eac1..57ad3ca 100644 (file)
@@ -1,3 +1,17 @@
+2013-06-24  Simon Fraser  <simon.fraser@apple.com>
+
+        Move displayID stuff from Widget to Chrome
+        https://bugs.webkit.org/show_bug.cgi?id=117944
+
+        Reviewed by Anders Carlsson.
+
+        In r151877 I polluted Widget with displayID-related stuff. This would
+        be better on HostWindow, so move it there. This is a net code reduction,
+        and eliminates PlatformScreenMac.h, and the NSScreen category.
+
+        * WebView/WebView.mm:
+        (-[WebView doWindowDidChangeScreen]): Go via chrome().
+
 2013-06-21  Christophe Dumez  <ch.dumez@sisa.samsung.com>
 
         REGRESSION (r150663): Using webkitAudioContext in Inspector makes it undefined everywhere
index 28766d1..13d5f51 100644 (file)
 #import <WebCore/ApplicationCacheStorage.h>
 #import <WebCore/BackForwardListImpl.h>
 #import <WebCore/MemoryCache.h>
+#import <WebCore/Chrome.h>
 #import <WebCore/ColorMac.h>
 #import <WebCore/Cursor.h>
 #import <WebCore/DatabaseManager.h>
@@ -3700,7 +3701,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
 - (void)doWindowDidChangeScreen
 {
     if (_private && _private->page)
-        _private->page->windowScreenDidChange((PlatformDisplayID)[[[[[self window] screen] deviceDescription] objectForKey:@"NSScreenNumber"] intValue]);
+        _private->page->chrome().windowScreenDidChange((PlatformDisplayID)[[[[[self window] screen] deviceDescription] objectForKey:@"NSScreenNumber"] intValue]);
 }
 
 - (void)_windowChangedKeyState
index 354361a..eabc176 100644 (file)
@@ -1,3 +1,17 @@
+2013-06-24  Simon Fraser  <simon.fraser@apple.com>
+
+        Move displayID stuff from Widget to Chrome
+        https://bugs.webkit.org/show_bug.cgi?id=117944
+
+        Reviewed by Anders Carlsson.
+
+        In r151877 I polluted Widget with displayID-related stuff. This would
+        be better on HostWindow, so move it there. This is a net code reduction,
+        and eliminates PlatformScreenMac.h, and the NSScreen category.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::windowScreenDidChange): Go via chrome().
+
 2013-06-24  Krzysztof Wolanski  <k.wolanski@samsung.com>
 
         [EFL][WK2] Implement unit test callback: onWordGuesses.
index cb9b365..eccb83c 100644 (file)
@@ -1250,7 +1250,7 @@ void WebPage::setPageAndTextZoomFactors(double pageZoomFactor, double textZoomFa
 
 void WebPage::windowScreenDidChange(uint64_t displayID)
 {
-    m_page->windowScreenDidChange(static_cast<PlatformDisplayID>(displayID));
+    m_page->chrome().windowScreenDidChange(static_cast<PlatformDisplayID>(displayID));
 }
 
 void WebPage::scalePage(double scale, const IntPoint& origin)