Fix iOS build.
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Mar 2014 17:32:32 +0000 (17:32 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Mar 2014 17:32:32 +0000 (17:32 +0000)
Source/WebCore:

* page/ChromeClient.h:
(WebCore::ChromeClient::updateViewportConstrainedLayers):

Source/WebKit/ios:

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
* WebCoreSupport/WebFixedPositionContent.mm:
* WebCoreSupport/WebFixedPositionContentInternal.h:

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

Source/WebCore/ChangeLog
Source/WebCore/page/ChromeClient.h
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.h
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm
Source/WebKit/ios/WebCoreSupport/WebFixedPositionContent.mm
Source/WebKit/ios/WebCoreSupport/WebFixedPositionContentInternal.h

index ffba78e..0d0afad 100644 (file)
@@ -1,3 +1,10 @@
+2014-03-31  Anders Carlsson  <andersca@apple.com>
+
+        Fix iOS build.
+
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::updateViewportConstrainedLayers):
+
 2014-03-31  Jer Noble  <jer.noble@apple.com>
 
         [MSE][Mac] Support lease-renewal.
index 07b0b5b..67b5954 100644 (file)
@@ -250,8 +250,7 @@ public:
 
     virtual bool fetchCustomFixedPositionLayoutRect(IntRect&) { return false; }
 
-    // FIXME: Use std::unique_ptr instead of OwnPtr.
-    virtual void updateViewportConstrainedLayers(HashMap<PlatformLayer*, OwnPtr<ViewportConstraints>>&, HashMap<PlatformLayer*, PlatformLayer*>&) { }
+    virtual void updateViewportConstrainedLayers(HashMap<PlatformLayer*, std::unique_ptr<ViewportConstraints>>&, HashMap<PlatformLayer*, PlatformLayer*>&) { }
 
     virtual void addOrUpdateScrollingLayer(Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer, const IntSize& scrollSize, bool allowHorizontalScrollbar, bool allowVerticalScrollbar) = 0;
     virtual void removeScrollingLayer(Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer) = 0;
index a41edd8..99ced08 100644 (file)
@@ -1,3 +1,12 @@
+2014-03-31  Anders Carlsson  <andersca@apple.com>
+
+        Fix iOS build.
+
+        * WebCoreSupport/WebChromeClientIOS.h:
+        * WebCoreSupport/WebChromeClientIOS.mm:
+        * WebCoreSupport/WebFixedPositionContent.mm:
+        * WebCoreSupport/WebFixedPositionContentInternal.h:
+
 2014-03-30  Dan Bernstein  <mitz@apple.com>
 
         Tried to fix the iOS build.
index c5c9bf0..0a1f31d 100644 (file)
@@ -70,7 +70,7 @@ public:
 
     virtual void didFlushCompositingLayers() override;
 
-    virtual void updateViewportConstrainedLayers(HashMap<PlatformLayer*, OwnPtr<WebCore::ViewportConstraints> >&, HashMap<PlatformLayer*, PlatformLayer*>&) override;
+    virtual void updateViewportConstrainedLayers(HashMap<PlatformLayer*, std::unique_ptr<WebCore::ViewportConstraints>>&, HashMap<PlatformLayer*, PlatformLayer*>&) override;
 
     virtual bool fetchCustomFixedPositionLayoutRect(WebCore::IntRect&) override;
     virtual void addOrUpdateScrollingLayer(WebCore::Node*, PlatformLayer*, PlatformLayer*, const WebCore::IntSize&, bool allowHorizontalScrollbar, bool allowVerticalScrollbar) override;
index 410f4c6..756cc16 100644 (file)
@@ -276,7 +276,7 @@ bool WebChromeClientIOS::fetchCustomFixedPositionLayoutRect(IntRect& rect)
     return false;
 }
 
-void WebChromeClientIOS::updateViewportConstrainedLayers(HashMap<PlatformLayer*, OwnPtr<ViewportConstraints> >& layerMap, HashMap<PlatformLayer*, PlatformLayer*>& stickyContainers)
+void WebChromeClientIOS::updateViewportConstrainedLayers(HashMap<PlatformLayer*, std::unique_ptr<ViewportConstraints>>& layerMap, HashMap<PlatformLayer*, PlatformLayer*>& stickyContainers)
 {
     [[webView() _fixedPositionContent] setViewportConstrainedLayers:layerMap stickyContainerMap:stickyContainers];
 }
index ca6634b..fa566c2 100644 (file)
@@ -59,10 +59,10 @@ struct ViewportConstrainedLayerData {
         : m_enclosingAcceleratedScrollLayer(nil)
     { }
     CALayer* m_enclosingAcceleratedScrollLayer; // May be nil.
-    OwnPtr<ViewportConstraints> m_viewportConstraints;
+    std::unique_ptr<ViewportConstraints> m_viewportConstraints;
 };
 
-typedef HashMap<RetainPtr<CALayer>, OwnPtr<ViewportConstrainedLayerData> > LayerInfoMap;
+typedef HashMap<RetainPtr<CALayer>, std::unique_ptr<ViewportConstrainedLayerData>> LayerInfoMap;
 
 struct WebFixedPositionContentData {
 public:
@@ -171,21 +171,20 @@ WebFixedPositionContentData::~WebFixedPositionContentData()
     });
 }
 
-- (void)setViewportConstrainedLayers:(WTF::HashMap<CALayer *, OwnPtr<WebCore::ViewportConstraints> >&)layerMap stickyContainerMap:(WTF::HashMap<CALayer*, CALayer*>&)stickyContainers
+- (void)setViewportConstrainedLayers:(WTF::HashMap<CALayer *, std::unique_ptr<WebCore::ViewportConstraints>>&)layerMap stickyContainerMap:(WTF::HashMap<CALayer*, CALayer*>&)stickyContainers
 {
     MutexLocker lock(WebFixedPositionContentDataLock());
 
     _private->m_viewportConstrainedLayers.clear();
 
-    HashMap<CALayer *, OwnPtr<ViewportConstraints> >::iterator end = layerMap.end();
-    for (HashMap<CALayer *, OwnPtr<ViewportConstraints> >::iterator it = layerMap.begin(); it != end; ++it) {
-        CALayer* layer = it->key;
-        OwnPtr<ViewportConstrainedLayerData> layerData = adoptPtr(new ViewportConstrainedLayerData);
+    for (auto& layerAndConstraints : layerMap) {
+        CALayer* layer = layerAndConstraints.key;
+        auto layerData = std::make_unique<ViewportConstrainedLayerData>();
 
         layerData->m_enclosingAcceleratedScrollLayer = stickyContainers.get(layer);
-        layerData->m_viewportConstraints = it->value.release();
+        layerData->m_viewportConstraints = std::move(layerAndConstraints.value);
 
-        _private->m_viewportConstrainedLayers.set(layer, layerData.release());
+        _private->m_viewportConstrainedLayers.set(layer, std::move(layerData));
     }
 }
 
index 64e2660..c57255a 100644 (file)
@@ -25,7 +25,6 @@
 
 #import <Foundation/Foundation.h>
 #import <wtf/HashMap.h>
-#import <wtf/OwnPtr.h>
 
 @class CALayer;
 
@@ -36,6 +35,6 @@ class ViewportConstraints;
 @interface WebFixedPositionContent(WebKitInternal)
 // Called from inside WebKit.
 
-- (void)setViewportConstrainedLayers:(WTF::HashMap<CALayer *, OwnPtr<WebCore::ViewportConstraints> >&)layerMap stickyContainerMap:(WTF::HashMap<CALayer*, CALayer*>&)stickyContainers;
+- (void)setViewportConstrainedLayers:(WTF::HashMap<CALayer *, std::unique_ptr<WebCore::ViewportConstraints>>&)layerMap stickyContainerMap:(WTF::HashMap<CALayer*, CALayer*>&)stickyContainers;
 
 @end