summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-11-23 13:16:38 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-11-23 13:16:38 -0800
commitecf268d482528c4778b1bca2eea6a2d49e477c3f (patch)
tree8eab8ffe271d63b419cfa6898e29f6c56b631bfb /WebCore/bindings/v8
parentd0a231404ec22bbd0cf70dff2446c58d88b067e7 (diff)
parent4bd4989daad3940ee44fc1cd88f1b805f187e171 (diff)
downloadexternal_webkit-ecf268d482528c4778b1bca2eea6a2d49e477c3f.zip
external_webkit-ecf268d482528c4778b1bca2eea6a2d49e477c3f.tar.gz
external_webkit-ecf268d482528c4778b1bca2eea6a2d49e477c3f.tar.bz2
Merge change Ia6cf2f30 into eclair-mr2
* changes: Updates an Android-specific work-around in V8GCController.cpp now that std::sort is available on Android.
Diffstat (limited to 'WebCore/bindings/v8')
-rw-r--r--WebCore/bindings/v8/V8GCController.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/WebCore/bindings/v8/V8GCController.cpp b/WebCore/bindings/v8/V8GCController.cpp
index 4ef3bb8..242954c 100644
--- a/WebCore/bindings/v8/V8GCController.cpp
+++ b/WebCore/bindings/v8/V8GCController.cpp
@@ -264,12 +264,12 @@ bool operator<(const GrouperItem& a, const GrouperItem& b)
typedef Vector<GrouperItem> GrouperList;
#if PLATFORM(ANDROID)
-// Sort GrouperList by the group id. Node* is only involved to sort within
-// a group id, so it will be fine.
-// TODO(andreip): used by std::stable_sort function. We can implement
-// the std::sort function and remove this one.
-static bool compareGrouperItem(const GrouperItem& a, const GrouperItem& b) {
- return a.groupId() < b.groupId();
+// Android's implementation of std::sort seems unable to do the necessary
+// template matching to pick up operator< for GrouperItem, so we have to
+// manually pass a comparison function.
+static bool compareGrouperItem(const GrouperItem& a, const GrouperItem& b)
+{
+ return a < b;
}
#endif
@@ -311,11 +311,10 @@ public:
void applyGrouping()
{
+ // Group by sorting by the group id.
#if PLATFORM(ANDROID)
- // TODO(andreip): implement std::sort() and get rid of this.
- std::stable_sort<GrouperItem>(m_grouper.begin(), m_grouper.end(), compareGrouperItem);
+ std::sort(m_grouper.begin(), m_grouper.end(), compareGrouperItem);
#else
- // Group by sorting by the group id.
std::sort(m_grouper.begin(), m_grouper.end());
#endif