Made -[WebHistoryItem copyWithZone:] allocate an object of the same class as the...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jan 2012 03:36:25 +0000 (03:36 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jan 2012 03:36:25 +0000 (03:36 +0000)
Reviewed by Mark Rowe.

* History/WebHistoryItem.mm:
(-[WebHistoryItem copyWithZone:]):

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/History/WebHistoryItem.mm

index 86e60db8ddc9aa845a8a65f381d37eeae3eb61c9..c5e65fa52486eccc8280e7194652f601d8f4081f 100644 (file)
@@ -1,3 +1,12 @@
+2012-01-10  Dan Bernstein  <mitz@apple.com>
+
+        Made -[WebHistoryItem copyWithZone:] allocate an object of the same class as the receiver.
+
+        Reviewed by Mark Rowe.
+
+        * History/WebHistoryItem.mm:
+        (-[WebHistoryItem copyWithZone:]):
+
 2012-01-10  Chris Marrin  <cmarrin@apple.com>
 
         Wrapped allowedCompositingTriggers in ACCELERATED_COMPOSITING ifdef to make non-accelerated builds work
index 646d8bebb1fbc02832d3b2d1a268be845a2498b2..653b1afae6d8ddcf1683366ce169e80cce065e26 100644 (file)
@@ -141,7 +141,7 @@ void WKNotifyHistoryItemChanged(HistoryItem*)
 - (id)copyWithZone:(NSZone *)zone
 {
     WebCoreThreadViolationCheckRoundOne();
-    WebHistoryItem *copy = [[WebHistoryItem alloc] initWithWebCoreHistoryItem:core(_private)->copy()];
+    WebHistoryItem *copy = [[[self class] alloc] initWithWebCoreHistoryItem:core(_private)->copy()];
     historyItemWrappers().set(core(copy->_private), copy);
 
     return copy;