Title: [207419] trunk/Source/WebKit/mac
- Revision
- 207419
- Author
- ander...@apple.com
- Date
- 2016-10-17 11:35:17 -0700 (Mon, 17 Oct 2016)
Log Message
CTTE some of the BackForwardList member functions
https://bugs.webkit.org/show_bug.cgi?id=163555
Reviewed by Dan Bernstein.
* History/BackForwardList.h:
(BackForwardList::entries):
* History/BackForwardList.mm:
(BackForwardList::removeItem):
(BackForwardList::containsItem):
(BackForwardList::entries): Deleted.
* History/WebBackForwardList.mm:
(-[WebBackForwardList removeItem:]):
(-[WebBackForwardList containsItem:]):
(-[WebBackForwardList description]):
Modified Paths
Diff
Modified: trunk/Source/WebKit/mac/ChangeLog (207418 => 207419)
--- trunk/Source/WebKit/mac/ChangeLog 2016-10-17 18:26:49 UTC (rev 207418)
+++ trunk/Source/WebKit/mac/ChangeLog 2016-10-17 18:35:17 UTC (rev 207419)
@@ -1,5 +1,23 @@
2016-10-17 Anders Carlsson <ander...@apple.com>
+ CTTE some of the BackForwardList member functions
+ https://bugs.webkit.org/show_bug.cgi?id=163555
+
+ Reviewed by Dan Bernstein.
+
+ * History/BackForwardList.h:
+ (BackForwardList::entries):
+ * History/BackForwardList.mm:
+ (BackForwardList::removeItem):
+ (BackForwardList::containsItem):
+ (BackForwardList::entries): Deleted.
+ * History/WebBackForwardList.mm:
+ (-[WebBackForwardList removeItem:]):
+ (-[WebBackForwardList containsItem:]):
+ (-[WebBackForwardList description]):
+
+2016-10-17 Anders Carlsson <ander...@apple.com>
+
Remove WEBCORE_EXPORT from BackForwardList, it lives in WebKit now
https://bugs.webkit.org/show_bug.cgi?id=163551
Modified: trunk/Source/WebKit/mac/History/BackForwardList.h (207418 => 207419)
--- trunk/Source/WebKit/mac/History/BackForwardList.h 2016-10-17 18:26:49 UTC (rev 207418)
+++ trunk/Source/WebKit/mac/History/BackForwardList.h 2016-10-17 18:35:17 UTC (rev 207419)
@@ -61,13 +61,13 @@
void setEnabled(bool);
int backListCount() override;
int forwardListCount() override;
- bool containsItem(WebCore::HistoryItem*);
+ bool containsItem(WebCore::HistoryItem&);
void close() override;
bool closed();
- void removeItem(WebCore::HistoryItem*);
- Vector<Ref<WebCore::HistoryItem>>& entries();
+ void removeItem(WebCore::HistoryItem&);
+ const Vector<Ref<WebCore::HistoryItem>>& entries() const { return m_entries; }
#if PLATFORM(IOS)
unsigned current();
Modified: trunk/Source/WebKit/mac/History/BackForwardList.mm (207418 => 207419)
--- trunk/Source/WebKit/mac/History/BackForwardList.mm 2016-10-17 18:26:49 UTC (rev 207418)
+++ trunk/Source/WebKit/mac/History/BackForwardList.mm 2016-10-17 18:35:17 UTC (rev 207419)
@@ -211,11 +211,6 @@
return m_entries[index + m_current].ptr();
}
-Vector<Ref<HistoryItem>>& BackForwardList::entries()
-{
- return m_entries;
-}
-
#if PLATFORM(IOS)
unsigned BackForwardList::current()
{
@@ -243,15 +238,12 @@
return m_closed;
}
-void BackForwardList::removeItem(HistoryItem* item)
+void BackForwardList::removeItem(HistoryItem& item)
{
- if (!item)
- return;
-
for (unsigned i = 0; i < m_entries.size(); ++i) {
- if (m_entries[i].ptr() == item) {
+ if (m_entries[i].ptr() == &item) {
m_entries.remove(i);
- m_entryHash.remove(item);
+ m_entryHash.remove(&item);
if (m_current == NoCurrentItemIndex || m_current < i)
break;
if (m_current > i)
@@ -266,7 +258,7 @@
}
}
-bool BackForwardList::containsItem(HistoryItem* entry)
+bool BackForwardList::containsItem(HistoryItem& entry)
{
- return m_entryHash.contains(entry);
+ return m_entryHash.contains(&entry);
}
Modified: trunk/Source/WebKit/mac/History/WebBackForwardList.mm (207418 => 207419)
--- trunk/Source/WebKit/mac/History/WebBackForwardList.mm 2016-10-17 18:26:49 UTC (rev 207418)
+++ trunk/Source/WebKit/mac/History/WebBackForwardList.mm 2016-10-17 18:35:17 UTC (rev 207419)
@@ -145,7 +145,10 @@
- (void)removeItem:(WebHistoryItem *)item
{
- core(self)->removeItem(core(item));
+ if (!item)
+ return;
+
+ core(self)->removeItem(*core(item));
}
#if PLATFORM(IOS)
@@ -199,7 +202,10 @@
- (BOOL)containsItem:(WebHistoryItem *)item
{
- return core(self)->containsItem(core(item));
+ if (!item)
+ return NO;
+
+ return core(self)->containsItem(*core(item));
}
- (void)goBack
@@ -306,9 +312,8 @@
BackForwardList* backForwardList = core(self);
auto& entries = backForwardList->entries();
-
- unsigned size = entries.size();
- for (unsigned i = 0; i < size; ++i) {
+
+ for (unsigned i = 0; i < entries.size(); ++i) {
if (entries[i].ptr() == backForwardList->currentItem()) {
[result appendString:@" >>>"];
} else {
@@ -316,7 +321,7 @@
}
[result appendFormat:@"%2d) ", i];
int currPos = [result length];
- [result appendString:[kit(entries[i].ptr()) description]];
+ [result appendString:[kit(const_cast<HistoryItem*>(entries[i].ptr())) description]];
// shift all the contents over. a bit slow, but this is for debugging
NSRange replRange = { static_cast<NSUInteger>(currPos), [result length] - currPos };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes