Several upstream (as in WebKit itself) commits that fix the build with libc++,
plus a few additional changes made only for the port (the OS(FREEBSD) part for
time_t). Some of those commits had to be edited because they did not apply
cleanly to the ancient WebKit checkout present in Qt.

Upstream commit messages:

------------------------------------------------------------------------
r86529 | abarth@webkit.org | 2011-05-16 09:30:58 +0300 (Mon, 16 May 2011) | 7 lines

2011-05-15  Adam Barth  <abarth@webkit.org>

        Attempt to fix Qt build.  (Strict PassOwnPtr fix.)

        * dom/XMLDocumentParserQt.cpp:
        (WebCore::XMLDocumentParser::doEnd):

------------------------------------------------------------------------
r86530 | abarth@webkit.org | 2011-05-16 09:36:56 +0300 (Mon,  16 May 2011) | 13 lines

2011-05-15  Adam Barth  <abarth@webkit.org>

        Attempt to fix Qt build.  (Strict PassOwnPtr fix.)

* platform/network/qt/QNetworkReplyHandler.cpp:
(WebCore::QNetworkReplyWrapper::release):
(WebCore::QNetworkReplyWrapper::receiveMetaData):
(WebCore::QNetworkReplyWrapper::receiveSniffedMIMEType):
(WebCore::QNetworkReplyHandler::release):
(WebCore::QNetworkReplyHandler::finish):
(WebCore::QNetworkReplyHandler::redirect):
(WebCore::QNetworkReplyHandler::start):

------------------------------------------------------------------------
r86531 | abarth@webkit.org | 2011-05-16 09:41:08 +0300 (Mon, 16 May 2011) | 7 lines

2011-05-15  Adam Barth  <abarth@webkit.org>

        Attempt to fix Qt build.  (Strict PassOwnPtr fix.)

        * platform/text/qt/TextCodecQt.cpp:
        (WebCore::newTextCodecQt):

------------------------------------------------------------------------
r86532 | abarth@webkit.org | 2011-05-16 09:46:33 +0300 (Mon, 16 May 2011) | 8 lines

2011-05-15  Adam Barth  <abarth@webkit.org>

        Attempt to fix Qt build.  (Strict PassOwnPtr fix.)

        * platform/graphics/qt/GraphicsLayerQt.cpp:
        (WebCore::GraphicsLayerQt::GraphicsLayerQt):
        (WebCore::GraphicsLayer::create):


------------------------------------------------------------------------
r86533 | abarth@webkit.org | 2011-05-16 09:52:23 +0300 (Mon, 16 May 2011) | 10 lines

2011-05-15  Adam Barth  <abarth@webkit.org>

        Attempt to fix the Qt build.  (Strict PassOwnPtr fix.)

        * Api/qgraphicswebview.cpp:
        (QGraphicsWebViewPrivate::detachCurrentPage):
        (QGraphicsWebView::setPage):
        * Api/qwebpage.cpp:
        (QWebPage::setView):

------------------------------------------------------------------------
r86537 | abarth@webkit.org | 2011-05-16 10:24:01 +0300 (Mon, 16 May 2011) | 41 lines

2011-05-16  Adam Barth  <abarth@webkit.org>

        [Qt] QtPlatformPlugin create methods should use PassOwnPtr
        https://bugs.webkit.org/show_bug.cgi?id=60873

        This change is slightly more than a build fix because the patch kind of
        spidered a bit while I was trying to fix the build the "right way."
        Hopefully nothing here is controversial.

        * Api/qwebpage.cpp:
        (QWebPagePrivate::adjustPointForClicking):
        * WebCoreSupport/ChromeClientQt.cpp:
        (WebCore::ChromeClientQt::createSelectPopup):
        * WebCoreSupport/FullScreenVideoQt.cpp:
        (WebCore::FullScreenVideoQt::FullScreenVideoQt):
        (WebCore::FullScreenVideoQt::~FullScreenVideoQt):
        * WebCoreSupport/FullScreenVideoQt.h:
        * WebCoreSupport/NotificationPresenterClientQt.cpp:
        (WebCore::NotificationWrapper::NotificationWrapper):
        (WebCore::NotificationPresenterClientQt::displayNotification):
        * WebCoreSupport/PopupMenuQt.cpp:
        (WebCore::PopupMenuQt::PopupMenuQt):
        (WebCore::PopupMenuQt::~PopupMenuQt):
        (WebCore::PopupMenuQt::show):
        * WebCoreSupport/PopupMenuQt.h:
        * WebCoreSupport/QtPlatformPlugin.cpp:
        (WebCore::QtPlatformPlugin::createSelectInputMethod):
        (WebCore::QtPlatformPlugin::createNotificationPresenter):
        (WebCore::QtPlatformPlugin::createHapticFeedbackPlayer):
        (WebCore::QtPlatformPlugin::createTouchModifier):
        (WebCore::QtPlatformPlugin::createFullScreenVideoHandler):
        * WebCoreSupport/QtPlatformPlugin.h:
        (WebCore::QtPlatformPlugin::QtPlatformPlugin):
2011-05-16  Adam Barth  <abarth@webkit.org>

        [Qt] QtPlatformPlugin create methods should use PassOwnPtr
        https://bugs.webkit.org/show_bug.cgi?id=60873

        * plugins/qt/PluginViewQt.cpp:
        (WebCore::PluginView::platformStart):

------------------------------------------------------------------------
r86538 | abarth@webkit.org | 2011-05-16 10:27:51 +0300 (Mon, 16 May 2011) | 6 lines

2011-05-16  Adam Barth  <abarth@webkit.org>

        Missing include.

        * WebCoreSupport/PopupMenuQt.h:

------------------------------------------------------------------------
r86540 | abarth@webkit.org | 2011-05-16 10:43:22 +0300 (Mon, 16 May 2011) | 10 lines

2011-05-16  Adam Barth  <abarth@webkit.org>

        Attempt to fix Qt build.  (Strict PassOwnPtr fix.)

        This patch requires some slightly fancy footwork.

        * WebCoreSupport/InspectorClientQt.cpp:
        (WebCore::InspectorClientQt::openInspectorFrontend):
        (WebCore::InspectorFrontendClientQt::InspectorFrontendClientQt):

------------------------------------------------------------------------
r86541 | abarth@webkit.org | 2011-05-16 10:51:04 +0300 (Mon, 16 May 2011) | 7 lines

2011-05-16  Adam Barth  <abarth@webkit.org>

        Sigh.  This code is somewhat crazy.

        * WebCoreSupport/InspectorClientQt.cpp:
        (WebCore::InspectorClientQt::openInspectorFrontend):

------------------------------------------------------------------------
r86550 | abarth@webkit.org | 2011-05-16 12:30:40 +0300 (Mon, 16 May 2011) | 13 lines

2011-05-16  Adam Barth  <abarth@webkit.org>

        Partial revert of r86537.  FullScreenVideoQt.h can't depend on OwnPtr.h
        because moc_FullScreenVideoQt.cpp fails to include config.h.
        Apparently, having moc_FullScreenVideoQt.cpp properly include config.h
        is hard, so we're going back to manual new and delete for this class.
        Bad times.

        * WebCoreSupport/FullScreenVideoQt.cpp:
        (WebCore::FullScreenVideoQt::FullScreenVideoQt):
        (WebCore::FullScreenVideoQt::~FullScreenVideoQt):
        * WebCoreSupport/FullScreenVideoQt.h:

------------------------------------------------------------------------
r90915 | andersca@apple.com | 2011-07-13 17:11:49 +0300 (Wed, 13 Jul 2011) | 7 lines

If a compiler has nullptr support, include <cstddef> to get the nullptr_t definition
https://bugs.webkit.org/show_bug.cgi?id=64429

Include the cstddef which has the nullptr_t typedef according to the C++0x standard.

* wtf/NullPtr.h:

------------------------------------------------------------------------
r92556 | darin@apple.com | 2011-08-06 23:17:26 +0300 (Sat, 06 Aug 2011) | 17 lines

Fix Timer heap implementation to work with more libraries (other versions of STL)
https://bugs.webkit.org/show_bug.cgi?id=65782

Reviewed by Anders Carlsson.

No behavior change, so no tests needed. Existing tests pass.

* platform/Timer.cpp: Added TimerHeapPointer and TimerHeapReference class
alongside the TimerHeapIterator class. Also added a swap function. Also
added a TimerHeapLessThanFunction class.
(WebCore::TimerBase::heapDecreaseKey): Pass pointers in to the TimerHeapIterator
since that's how the class works now. Pass a TimerHeapLessThanFunction object
instead of letting the library use the < operator directly.
(WebCore::TimerBase::heapPopMin): Ditto.

* platform/Timer.h: Updated for above changes.

------------------------------------------------------------------------
r107489 | weinig@apple.com | 2012-02-12 01:10:24 +0200 (Sun, 12 Feb 2012) | 9 lines

Prepare JavaScriptCore to build with libc++
<rdar://problem/10426673>
https://bugs.webkit.org/show_bug.cgi?id=78424

Reviewed by Anders Carlsson.

* wtf/NullPtr.cpp:
* wtf/NullPtr.h:
libc++ provides std::nullptr emulation, so we don't have to.

------------------------------------------------------------------------
--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h
+++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h
@@ -35,10 +35,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     #define __has_feature(feature) 0
 #endif
 
-#if __has_feature(cxx_nullptr) || (GCC_VERSION_AT_LEAST(4, 6, 0) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && _MSC_VER >= 1600 && !COMPILER(INTEL))
+#include <ciso646>
+
+#if __has_feature(cxx_nullptr) || (GCC_VERSION_AT_LEAST(4, 6, 0) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && _MSC_VER >= 1600 && !COMPILER(INTEL)) || defined(_LIBCPP_VERSION)
 
 #define HAVE_NULLPTR 1
 
+#include <cstddef>
+
 #else
 
 namespace std {
--- src/3rdparty/webkit/Source/WebCore/dom/XMLDocumentParserQt.cpp	(revision 86528)
+++ src/3rdparty/webkit/Source/WebCore/dom/XMLDocumentParserQt.cpp	(revision 86529)
@@ -215,7 +215,7 @@
 {
 #if ENABLE(XSLT)
     if (m_sawXSLTransform) {
-        document()->setTransformSource(new TransformSource(m_originalSourceForTransform));
+        document()->setTransformSource(adoptPtr(new TransformSource(m_originalSourceForTransform)));
         document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
         document()->styleSelectorChanged(RecalcStyleImmediately);
         document()->setParsing(true);
--- src/3rdparty/webkit/Source/WebCore/platform/Timer.cpp	(revision 92555)
+++ src/3rdparty/webkit/Source/WebCore/platform/Timer.cpp	(revision 92556)
@@ -41,6 +41,8 @@
 
 namespace WebCore {
 
+class TimerHeapReference;
+
 // Timers are stored in a heap data structure, used to implement a priority queue.
 // This allows us to efficiently determine which timer needs to fire the soonest.
 // Then we set a single shared system timer to fire at that time.
@@ -53,113 +55,141 @@
     return threadGlobalData().threadTimers().timerHeap();
 }
 
-// Class to represent elements in the heap when calling the standard library heap algorithms.
-// Maintains the m_heapIndex value in the timers themselves, which allows us to do efficient
-// modification of the heap.
-class TimerHeapElement {
+// ----------------
+
+class TimerHeapPointer {
 public:
-    explicit TimerHeapElement(int i)
-        : m_index(i)
-        , m_timer(timerHeap()[m_index])
-    { 
-        checkConsistency(); 
-    }
+    TimerHeapPointer(TimerBase** pointer) : m_pointer(pointer) { }
+    TimerHeapReference operator*() const;
+    TimerBase* operator->() const { return *m_pointer; }
+private:
+    TimerBase** m_pointer;
+};
 
-    TimerHeapElement(const TimerHeapElement&);
-    TimerHeapElement& operator=(const TimerHeapElement&);
-
-    TimerBase* timer() const { return m_timer; }
-
-    void checkConsistency() const
-    {
-        ASSERT(m_index >= 0);
-        ASSERT(m_index < static_cast<int>(timerHeap().size()));
-    }
-
+class TimerHeapReference {
+public:
+    TimerHeapReference(TimerBase*& reference) : m_reference(reference) { }
+    operator TimerBase*() const { return m_reference; }
+    TimerHeapPointer operator&() const { return &m_reference; }
+    TimerHeapReference& operator=(TimerBase*);
+    TimerHeapReference& operator=(TimerHeapReference);
 private:
-    TimerHeapElement();
-
-    int m_index;
-    TimerBase* m_timer;
+    TimerBase*& m_reference;
 };
 
-inline TimerHeapElement::TimerHeapElement(const TimerHeapElement& o)
-    : m_index(-1), m_timer(o.timer())
+inline TimerHeapReference TimerHeapPointer::operator*() const
 {
+    return *m_pointer;
 }
 
-inline TimerHeapElement& TimerHeapElement::operator=(const TimerHeapElement& o)
+inline TimerHeapReference& TimerHeapReference::operator=(TimerBase* timer)
 {
-    TimerBase* t = o.timer();
-    m_timer = t;
-    if (m_index != -1) {
-        checkConsistency();
-        timerHeap()[m_index] = t;
-        t->m_heapIndex = m_index;
-    }
+    m_reference = timer;
+    Vector<TimerBase*>& heap = timerHeap();
+    if (&m_reference >= heap.data() && &m_reference < heap.data() + heap.size())
+        timer->m_heapIndex = &m_reference - heap.data();
     return *this;
 }
 
-inline bool operator<(const TimerHeapElement& a, const TimerHeapElement& b)
+inline TimerHeapReference& TimerHeapReference::operator=(TimerHeapReference b)
 {
-    // The comparisons below are "backwards" because the heap puts the largest 
-    // element first and we want the lowest time to be the first one in the heap.
-    double aFireTime = a.timer()->m_nextFireTime;
-    double bFireTime = b.timer()->m_nextFireTime;
-    if (bFireTime != aFireTime)
-        return bFireTime < aFireTime;
-    
-    // We need to look at the difference of the insertion orders instead of comparing the two 
-    // outright in case of overflow. 
-    unsigned difference = a.timer()->m_heapInsertionOrder - b.timer()->m_heapInsertionOrder;
-    return difference < UINT_MAX / 2;
+    TimerBase* timer = b;
+    return *this = timer;
 }
 
+inline void swap(TimerHeapReference a, TimerHeapReference b)
+{
+    TimerBase* timerA = a;
+    TimerBase* timerB = b;
+
+    // Invoke the assignment operator, since that takes care of updating m_heapIndex.
+    a = timerB;
+    b = timerA;
+}
+
 // ----------------
 
 // Class to represent iterators in the heap when calling the standard library heap algorithms.
-// Returns TimerHeapElement for elements in the heap rather than the TimerBase pointers themselves.
-class TimerHeapIterator : public iterator<random_access_iterator_tag, TimerHeapElement, int> {
+// Uses a custom pointer and reference type that update indices for pointers in the heap.
+class TimerHeapIterator : public iterator<random_access_iterator_tag, TimerBase*, ptrdiff_t, TimerHeapPointer, TimerHeapReference> {
 public:
-    TimerHeapIterator() : m_index(-1) { }
-    TimerHeapIterator(int i) : m_index(i) { checkConsistency(); }
+    explicit TimerHeapIterator(TimerBase** pointer) : m_pointer(pointer) { checkConsistency(); }
 
-    TimerHeapIterator& operator++() { checkConsistency(); ++m_index; checkConsistency(); return *this; }
-    TimerHeapIterator operator++(int) { checkConsistency(); checkConsistency(1); return m_index++; }
+    TimerHeapIterator& operator++() { checkConsistency(); ++m_pointer; checkConsistency(); return *this; }
+    TimerHeapIterator operator++(int) { checkConsistency(1); return TimerHeapIterator(m_pointer++); }
 
-    TimerHeapIterator& operator--() { checkConsistency(); --m_index; checkConsistency(); return *this; }
-    TimerHeapIterator operator--(int) { checkConsistency(); checkConsistency(-1); return m_index--; }
+    TimerHeapIterator& operator--() { checkConsistency(); --m_pointer; checkConsistency(); return *this; }
+    TimerHeapIterator operator--(int) { checkConsistency(-1); return TimerHeapIterator(m_pointer--); }
 
-    TimerHeapIterator& operator+=(int i) { checkConsistency(); m_index += i; checkConsistency(); return *this; }
-    TimerHeapIterator& operator-=(int i) { checkConsistency(); m_index -= i; checkConsistency(); return *this; }
+    TimerHeapIterator& operator+=(ptrdiff_t i) { checkConsistency(); m_pointer += i; checkConsistency(); return *this; }
+    TimerHeapIterator& operator-=(ptrdiff_t i) { checkConsistency(); m_pointer -= i; checkConsistency(); return *this; }
 
-    TimerHeapElement operator*() const { return TimerHeapElement(m_index); }
-    TimerHeapElement operator[](int i) const { return TimerHeapElement(m_index + i); }
+    TimerHeapReference operator*() const { return TimerHeapReference(*m_pointer); }
+    TimerHeapReference operator[](ptrdiff_t i) const { return TimerHeapReference(m_pointer[i]); }
+    TimerBase* operator->() const { return *m_pointer; }
 
-    int index() const { return m_index; }
-
-    void checkConsistency(int offset = 0) const
+private:
+    void checkConsistency(ptrdiff_t offset = 0) const
     {
-        ASSERT_UNUSED(offset, m_index + offset >= 0);
-        ASSERT_UNUSED(offset, m_index + offset <= static_cast<int>(timerHeap().size()));
+        ASSERT(m_pointer >= timerHeap().data());
+        ASSERT(m_pointer <= timerHeap().data() + timerHeap().size());
+        ASSERT_UNUSED(offset, m_pointer + offset >= timerHeap().data());
+        ASSERT_UNUSED(offset, m_pointer + offset <= timerHeap().data() + timerHeap().size());
     }
 
-private:
-    int m_index;
+    friend bool operator==(TimerHeapIterator, TimerHeapIterator);
+    friend bool operator!=(TimerHeapIterator, TimerHeapIterator);
+    friend bool operator<(TimerHeapIterator, TimerHeapIterator);
+    friend bool operator>(TimerHeapIterator, TimerHeapIterator);
+    friend bool operator<=(TimerHeapIterator, TimerHeapIterator);
+    friend bool operator>=(TimerHeapIterator, TimerHeapIterator);
+    
+    friend TimerHeapIterator operator+(TimerHeapIterator, size_t);
+    friend TimerHeapIterator operator+(size_t, TimerHeapIterator);
+    
+    friend TimerHeapIterator operator-(TimerHeapIterator, size_t);
+    friend ptrdiff_t operator-(TimerHeapIterator, TimerHeapIterator);
+
+    TimerBase** m_pointer;
 };
 
-inline bool operator==(TimerHeapIterator a, TimerHeapIterator b) { return a.index() == b.index(); }
-inline bool operator!=(TimerHeapIterator a, TimerHeapIterator b) { return a.index() != b.index(); }
-inline bool operator<(TimerHeapIterator a, TimerHeapIterator b) { return a.index() < b.index(); }
+inline bool operator==(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer == b.m_pointer; }
+inline bool operator!=(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer != b.m_pointer; }
+inline bool operator<(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer < b.m_pointer; }
+inline bool operator>(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer > b.m_pointer; }
+inline bool operator<=(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer <= b.m_pointer; }
+inline bool operator>=(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer >= b.m_pointer; }
 
-inline TimerHeapIterator operator+(TimerHeapIterator a, int b) { return a.index() + b; }
-inline TimerHeapIterator operator+(int a, TimerHeapIterator b) { return a + b.index(); }
+inline TimerHeapIterator operator+(TimerHeapIterator a, size_t b) { return TimerHeapIterator(a.m_pointer + b); }
+inline TimerHeapIterator operator+(size_t a, TimerHeapIterator b) { return TimerHeapIterator(a + b.m_pointer); }
 
-inline TimerHeapIterator operator-(TimerHeapIterator a, int b) { return a.index() - b; }
-inline int operator-(TimerHeapIterator a, TimerHeapIterator b) { return a.index() - b.index(); }
+inline TimerHeapIterator operator-(TimerHeapIterator a, size_t b) { return TimerHeapIterator(a.m_pointer - b); }
+inline ptrdiff_t operator-(TimerHeapIterator a, TimerHeapIterator b) { return a.m_pointer - b.m_pointer; }
 
 // ----------------
 
+class TimerHeapLessThanFunction {
+public:
+    bool operator()(TimerBase*, TimerBase*) const;
+};
+
+inline bool TimerHeapLessThanFunction::operator()(TimerBase* a, TimerBase* b) const
+{
+    // The comparisons below are "backwards" because the heap puts the largest 
+    // element first and we want the lowest time to be the first one in the heap.
+    double aFireTime = a->m_nextFireTime;
+    double bFireTime = b->m_nextFireTime;
+    if (bFireTime != aFireTime)
+        return bFireTime < aFireTime;
+    
+    // We need to look at the difference of the insertion orders instead of comparing the two 
+    // outright in case of overflow. 
+    unsigned difference = a->m_heapInsertionOrder - b->m_heapInsertionOrder;
+    return difference < numeric_limits<unsigned>::max() / 2;
+}
+
+// ----------------
+
 TimerBase::TimerBase()
     : m_nextFireTime(0)
     , m_repeatInterval(0)
@@ -225,7 +255,8 @@
 {
     ASSERT(m_nextFireTime != 0);
     checkHeapIndex();
-    push_heap(TimerHeapIterator(0), TimerHeapIterator(m_heapIndex + 1));
+    TimerBase** heapData = timerHeap().data();
+    push_heap(TimerHeapIterator(heapData), TimerHeapIterator(heapData + m_heapIndex + 1), TimerHeapLessThanFunction());
     checkHeapIndex();
 }
 
@@ -274,7 +305,9 @@
 {
     ASSERT(this == timerHeap().first());
     checkHeapIndex();
-    pop_heap(TimerHeapIterator(0), TimerHeapIterator(timerHeap().size()));
+    Vector<TimerBase*>& heap = timerHeap();
+    TimerBase** heapData = heap.data();
+    pop_heap(TimerHeapIterator(heapData), TimerHeapIterator(heapData + heap.size()), TimerHeapLessThanFunction());
     checkHeapIndex();
     ASSERT(this == timerHeap().last());
 }
--- src/3rdparty/webkit/Source/WebCore/platform/Timer.h	(revision 92555)
+++ src/3rdparty/webkit/Source/WebCore/platform/Timer.h	(revision 92556)
@@ -84,9 +84,9 @@
     ThreadIdentifier m_thread;
 #endif
 
-    friend class TimerHeapElement;
     friend class ThreadTimers;
-    friend bool operator<(const TimerHeapElement&, const TimerHeapElement&);
+    friend class TimerHeapLessThanFunction;
+    friend class TimerHeapReference;
 };
 
 template <typename TimerFiredClass> class Timer : public TimerBase {
--- src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp	(revision 86531)
+++ src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp	(revision 86532)
@@ -944,7 +944,7 @@
 
 GraphicsLayerQt::GraphicsLayerQt(GraphicsLayerClient* client)
     : GraphicsLayer(client)
-    , m_impl(PassOwnPtr<GraphicsLayerQtImpl>(new GraphicsLayerQtImpl(this)))
+    , m_impl(adoptPtr(new GraphicsLayerQtImpl(this)))
 {
 }
 
@@ -955,7 +955,7 @@
 // This is the hook for WebCore compositor to know that Qt implements compositing with GraphicsLayerQt.
 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
 {
-    return new GraphicsLayerQt(client);
+    return adoptPtr(new GraphicsLayerQt(client));
 }
 
 /* \reimp (GraphicsLayer.h): The current size might change, thus we need to update the whole display.

--- src/3rdparty/webkit/Source/WebCore/loader/icon/IconRecord.h
+++ src/3rdparty/webkit/Source/WebCore/loader/icon/IconRecord.h
@@ -38,7 +38,7 @@
 #include <wtf/OwnPtr.h>
 #include <wtf/text/StringHash.h>
 
-#if OS(SOLARIS)
+#if OS(FREEBSD) || OS(SOLARIS)
 #include <sys/types.h> // For time_t structure.
 #endif
 
--- src/3rdparty/webkit/Source/WebCore/page/Page.h
+++ src/3rdparty/webkit/Source/WebCore/page/Page.h
@@ -29,7 +29,7 @@
 #include <wtf/HashSet.h>
 #include <wtf/Noncopyable.h>
 
-#if OS(SOLARIS)
+#if OS(FREEBSD) || OS(SOLARIS)
 #include <sys/time.h> // For time_t structure.
 #endif
 
--- src/3rdparty/webkit/Source/WebCore/platform/network/ResourceResponseBase.h
+++ src/3rdparty/webkit/Source/WebCore/platform/network/ResourceResponseBase.h
@@ -35,7 +35,7 @@
 #include <wtf/PassOwnPtr.h>
 #include <wtf/RefPtr.h>
 
-#if OS(SOLARIS)
+#if OS(FREEBSD) || OS(SOLARIS)
 #include <sys/time.h> // For time_t structure.
 #endif
 
--- src/3rdparty/webkit/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp	(revision 86529)
+++ src/3rdparty/webkit/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp	(revision 86530)
@@ -235,7 +235,7 @@
     resetConnections();
     QNetworkReply* reply = m_reply;
     m_reply = 0;
-    m_sniffer = 0;
+    m_sniffer = nullptr;
 
     reply->setParent(0);
     return reply;
@@ -285,7 +285,7 @@
 
     Q_ASSERT(!m_sniffer);
 
-    m_sniffer = new QtMIMETypeSniffer(m_reply, m_advertisedMIMEType, isSupportedImageType);
+    m_sniffer = adoptPtr(new QtMIMETypeSniffer(m_reply, m_advertisedMIMEType, isSupportedImageType));
 
     if (m_sniffer->isFinished()) {
         receiveSniffedMIMEType();
@@ -300,7 +300,7 @@
     Q_ASSERT(m_sniffer);
 
     m_sniffedMIMEType = m_sniffer->mimeType();
-    m_sniffer = 0;
+    m_sniffer = nullptr;
 
     emitMetaDataChanged();
 }
@@ -417,7 +417,7 @@
         return 0;
 
     QNetworkReply* reply = m_replyWrapper->release();
-    m_replyWrapper = 0;
+    m_replyWrapper = nullptr;
     return reply;
 }
 
@@ -440,12 +440,12 @@
 
     ResourceHandleClient* client = m_resourceHandle->client();
     if (!client) {
-        m_replyWrapper = 0;
+        m_replyWrapper = nullptr;
         return;
     }
 
     if (m_replyWrapper->wasRedirected()) {
-        m_replyWrapper = 0;
+        m_replyWrapper = nullptr;
         m_queue.push(&QNetworkReplyHandler::start);
         return;
     }
@@ -465,7 +465,7 @@
         }
     }
 
-    m_replyWrapper = 0;
+    m_replyWrapper = nullptr;
 }
 
 void QNetworkReplyHandler::sendResponseIfNeeded()
@@ -539,7 +539,7 @@
                             newUrl.toString(),
                             QCoreApplication::translate("QWebPage", "Redirection limit reached"));
         client->didFail(m_resourceHandle, error);
-        m_replyWrapper = 0;
+        m_replyWrapper = nullptr;
         return;
     }
 
@@ -660,7 +660,7 @@
     if (!reply)
         return;
 
-    m_replyWrapper = new QNetworkReplyWrapper(&m_queue, reply, m_resourceHandle->shouldContentSniff() && d->m_context->mimeSniffingEnabled(), this);
+    m_replyWrapper = adoptPtr(new QNetworkReplyWrapper(&m_queue, reply, m_resourceHandle->shouldContentSniff() && d->m_context->mimeSniffingEnabled(), this));
 
     if (m_loadType == SynchronousLoad) {
         m_replyWrapper->synchronousLoad();
===================================================================
--- src/3rdparty/webkit/Source/WebCore/platform/text/qt/TextCodecQt.cpp	(revision 86530)
+++ src/3rdparty/webkit/Source/WebCore/platform/text/qt/TextCodecQt.cpp	(revision 86531)
@@ -64,7 +64,7 @@
 
 static PassOwnPtr<TextCodec> newTextCodecQt(const TextEncoding& encoding, const void*)
 {
-    return new TextCodecQt(encoding);
+    return adoptPtr(new TextCodecQt(encoding));
 }
 
 void TextCodecQt::registerCodecs(TextCodecRegistrar registrar)

--- src/3rdparty/webkit/Source/WebKit/qt/Api/qgraphicswebview.cpp	(revision 86532)
+++ src/3rdparty/webkit/Source/WebKit/qt/Api/qgraphicswebview.cpp	(revision 86533)
@@ -473,7 +473,7 @@
         return;
 
     page->d->view.clear();
-    page->d->client = 0;
+    page->d->client = nullptr;
 
     // if the page was created by us, we own it and need to
     // destroy it as well.
@@ -506,7 +506,7 @@
     if (!d->page)
         return;
 
-    d->page->d->client = new PageClientQGraphicsWidget(this, page); // set the page client
+    d->page->d->client = adoptPtr(new PageClientQGraphicsWidget(this, page));
 
     if (d->overlay())
         d->overlay()->prepareGraphicsItemGeometryChange();
--- src/3rdparty/webkit/Source/WebKit/qt/Api/qwebpage.cpp	(revision 86532)
+++ src/3rdparty/webkit/Source/WebKit/qt/Api/qwebpage.cpp	(revision 86550)
@@ -1319,7 +1319,7 @@
 void QWebPagePrivate::adjustPointForClicking(QGraphicsSceneMouseEvent* ev)
 {
     QtPlatformPlugin platformPlugin;
-    QWebTouchModifier* touchModifier = platformPlugin.createTouchModifier();
+    OwnPtr<QWebTouchModifier> touchModifier = platformPlugin.createTouchModifier();
     if (!touchModifier)
         return;
 
@@ -1328,8 +1328,7 @@
     unsigned bottomPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Down);
     unsigned leftPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Left);
 
-    delete touchModifier;
-    touchModifier = 0;
+    touchModifier = nullptr;
 
     if (!topPadding && !rightPadding && !bottomPadding && !leftPadding)
         return;
@@ -2044,7 +2044,7 @@
     }
 
     if (view)
-        d->client = new PageClientQWidget(view, this);
+        d->client = adoptPtr(new PageClientQWidget(view, this));
 }
 
 /*!
--- src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h	(revision 86536)
+++ src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.h	(revision 86550)
@@ -22,6 +22,8 @@
 
 #include "PopupMenu.h"
 #include <QObject>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
 
 class QWebSelectData;
 class QWebSelectMethod;
@@ -49,8 +51,8 @@
 
 private:
     PopupMenuClient* m_popupClient;
-    QWebSelectMethod* m_popup;
-    QWebSelectData* m_selectData;
+    OwnPtr<QWebSelectMethod> m_popup;
+    OwnPtr<QWebSelectData> m_selectData;
     const ChromeClientQt* m_chromeClient;
 };
 
--- src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h	(revision 86536)
+++ src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h	(revision 86550)
@@ -22,6 +22,7 @@
 #define QtPlatformPlugin_h
 
 #include <QPluginLoader>
+#include <wtf/PassOwnPtr.h>
 
 class QWebSelectMethod;
 class QWebKitPlatformPlugin;
@@ -37,15 +38,20 @@
 
 class QtPlatformPlugin {
 public:
-    QtPlatformPlugin() : m_loaded(false), m_plugin(0) {}
+    QtPlatformPlugin()
+        : m_loaded(false)
+        , m_plugin(0)
+    {
+    }
+
     ~QtPlatformPlugin();
 
-    QWebSelectMethod* createSelectInputMethod();
-    QWebNotificationPresenter* createNotificationPresenter();
-    QWebHapticFeedbackPlayer* createHapticFeedbackPlayer();
-    QWebTouchModifier* createTouchModifier();
+    PassOwnPtr<QWebSelectMethod> createSelectInputMethod();
+    PassOwnPtr<QWebNotificationPresenter> createNotificationPresenter();
+    PassOwnPtr<QWebHapticFeedbackPlayer> createHapticFeedbackPlayer();
+    PassOwnPtr<QWebTouchModifier> createTouchModifier();
 #if ENABLE(VIDEO) && USE(QT_MULTIMEDIA)
-    QWebFullScreenVideoHandler* createFullScreenVideoHandler();
+    PassOwnPtr<QWebFullScreenVideoHandler> createFullScreenVideoHandler();
 #endif
 
     QWebKitPlatformPlugin* plugin();
--- src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp	(revision 86536)
+++ src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp	(revision 86550)
@@ -696,18 +696,18 @@
 } 
 #endif
 
-QWebSelectMethod* ChromeClientQt::createSelectPopup() const
+PassOwnPtr<QWebSelectMethod> ChromeClientQt::createSelectPopup() const
 {
-    QWebSelectMethod* result = m_platformPlugin.createSelectInputMethod();
+    OwnPtr<QWebSelectMethod> result = m_platformPlugin.createSelectInputMethod();
     if (result)
-        return result;
+        return result.release();
 
 #if defined(Q_WS_MAEMO_5)
-    return new QtMaemoWebPopup;
+    return adoptPtr(new QtMaemoWebPopup);
 #elif !defined(QT_NO_COMBOBOX)
-    return new QtFallbackWebPopup(this);
+    return adoptPtr(new QtFallbackWebPopup(this));
 #else
-    return 0;
+    return nullptr;
 #endif
 }
 
--- src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp	(revision 86536)
+++ src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp	(revision 86550)
@@ -82,8 +82,6 @@
 
 PopupMenuQt::PopupMenuQt(PopupMenuClient* client, const ChromeClientQt* chromeClient)
     : m_popupClient(client)
-    , m_popup(0)
-    , m_selectData(0)
     , m_chromeClient(chromeClient)
 {
 }
@@ -90,8 +88,6 @@
 
 PopupMenuQt::~PopupMenuQt()
 {
-    delete m_selectData;
-    delete m_popup;
 }
 
 void PopupMenuQt::disconnectClient()
@@ -107,11 +103,11 @@
 
     if (!m_popup) {
         m_popup = m_chromeClient->createSelectPopup();
-        connect(m_popup, SIGNAL(didHide()), this, SLOT(didHide()));
-        connect(m_popup, SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool)));
+        connect(m_popup.get(), SIGNAL(didHide()), this, SLOT(didHide()));
+        connect(m_popup.get(), SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool)));
     }
 
-    if (QtFallbackWebPopup* fallback = qobject_cast<QtFallbackWebPopup*>(m_popup)) {
+    if (QtFallbackWebPopup* fallback = qobject_cast<QtFallbackWebPopup*>(m_popup.get())) {
         QRect geometry(rect);
         geometry.moveTopLeft(view->contentsToWindow(rect.location()));
         fallback->setGeometry(geometry);
@@ -118,10 +114,8 @@
         fallback->setFont(m_popupClient->menuStyle().font().font());
     }
 
-    if (m_selectData)
-        delete m_selectData;
-    m_selectData = new SelectData(m_popupClient);
-    m_popup->show(*m_selectData);
+    m_selectData = adoptPtr(new SelectData(m_popupClient));
+    m_popup->show(*m_selectData.get());
 #endif
 }
 
--- src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp	(revision 86536)
+++ src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp	(revision 86550)
@@ -136,7 +136,7 @@
     Q_ASSERT(m_chromeClient);
 
 #if USE(QT_MULTIMEDIA)
-    m_FullScreenVideoHandler = m_chromeClient->m_platformPlugin.createFullScreenVideoHandler();
+    m_FullScreenVideoHandler = m_chromeClient->m_platformPlugin.createFullScreenVideoHandler().leakPtr();
     if (!m_FullScreenVideoHandler)
         m_FullScreenVideoHandler = new DefaultFullScreenVideoHandler;
 
--- src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp	(revision 86536)
+++ src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp	(revision 86550)
@@ -102,36 +102,35 @@
     return m_plugin;
 }
 
-QWebSelectMethod* QtPlatformPlugin::createSelectInputMethod()
+PassOwnPtr<QWebSelectMethod> QtPlatformPlugin::createSelectInputMethod()
 {
     QWebKitPlatformPlugin* p = plugin();
-    return p ? static_cast<QWebSelectMethod*>(p->createExtension(QWebKitPlatformPlugin::MultipleSelections)) : 0;
+    return adoptPtr(p ? static_cast<QWebSelectMethod*>(p->createExtension(QWebKitPlatformPlugin::MultipleSelections)) : 0);
 }
 
-
-QWebNotificationPresenter* QtPlatformPlugin::createNotificationPresenter()
+PassOwnPtr<QWebNotificationPresenter> QtPlatformPlugin::createNotificationPresenter()
 {
     QWebKitPlatformPlugin* p = plugin();
-    return p ? static_cast<QWebNotificationPresenter*>(p->createExtension(QWebKitPlatformPlugin::Notifications)) : 0;
+    return adoptPtr(p ? static_cast<QWebNotificationPresenter*>(p->createExtension(QWebKitPlatformPlugin::Notifications)) : 0);
 }
 
-QWebHapticFeedbackPlayer* QtPlatformPlugin::createHapticFeedbackPlayer()
+PassOwnPtr<QWebHapticFeedbackPlayer> QtPlatformPlugin::createHapticFeedbackPlayer()
 {
     QWebKitPlatformPlugin* p = plugin();
-    return p ? static_cast<QWebHapticFeedbackPlayer*>(p->createExtension(QWebKitPlatformPlugin::Haptics)) : 0;
+    return adoptPtr(p ? static_cast<QWebHapticFeedbackPlayer*>(p->createExtension(QWebKitPlatformPlugin::Haptics)) : 0);
 }
 
-QWebTouchModifier* QtPlatformPlugin::createTouchModifier()
+PassOwnPtr<QWebTouchModifier> QtPlatformPlugin::createTouchModifier()
 {
     QWebKitPlatformPlugin* p = plugin();
-    return p ? static_cast<QWebTouchModifier*>(p->createExtension(QWebKitPlatformPlugin::TouchInteraction)) : 0;
+    return adoptPtr(p ? static_cast<QWebTouchModifier*>(p->createExtension(QWebKitPlatformPlugin::TouchInteraction)) : 0);
 }
 
 #if ENABLE(VIDEO) && USE(QT_MULTIMEDIA)
-QWebFullScreenVideoHandler* QtPlatformPlugin::createFullScreenVideoHandler()
+PassOwnPtr<QWebFullScreenVideoHandler> QtPlatformPlugin::createFullScreenVideoHandler()
 {
     QWebKitPlatformPlugin* p = plugin();
-    return p ? static_cast<QWebFullScreenVideoHandler*>(p->createExtension(QWebKitPlatformPlugin::FullScreenVideoPlayer)) : 0;
+    return adoptPtr(p ? static_cast<QWebFullScreenVideoHandler*>(p->createExtension(QWebKitPlatformPlugin::FullScreenVideoPlayer)) : 0);
 }
 #endif
 
--- src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp	(revision 86536)
+++ src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp	(revision 86550)
@@ -203,8 +203,9 @@
 void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController* inspectorController)
 {
 #if ENABLE(INSPECTOR)
-    QWebView* inspectorView = new QWebView;
-    InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView);
+    OwnPtr<QWebView> inspectorView = adoptPtr(new QWebView);
+    // FIXME: Where does inspectorPage get deleted?
+    InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView.get());
     inspectorView->setPage(inspectorPage);
 
     QWebInspector* inspector = m_inspectedWebPage->d->getOrCreateInspector();
@@ -229,11 +230,14 @@
         inspectorPage->setProperty("_q_inspectorJavaScriptWindowObjects", inspectorJavaScriptWindowObjects);
 #endif
     inspectorView->page()->mainFrame()->load(inspectorUrl);
-    m_inspectedWebPage->d->inspectorFrontend = inspectorView;
-    inspector->d->setFrontend(inspectorView);
+    m_inspectedWebPage->d->inspectorFrontend = inspectorView.get();
+    inspector->d->setFrontend(inspectorView.get());
 
-    m_frontendClient = new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView, this);
-    inspectorView->page()->d->page->inspectorController()->setInspectorFrontendClient(m_frontendClient);
+    // Is 'controller' the same object as 'inspectorController' (which appears to be unused)?
+    InspectorController* controller = inspectorView->page()->d->page->inspectorController();
+    OwnPtr<InspectorFrontendClientQt> frontendClient = adoptPtr(new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView.release(), this));
+    m_frontendClient = frontendClient.get();
+    controller->setInspectorFrontendClient(frontendClient.release());
     m_frontendWebPage = inspectorPage;
 #endif
 }
@@ -297,7 +301,7 @@
 
 #if ENABLE(INSPECTOR)
 InspectorFrontendClientQt::InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView, InspectorClientQt* inspectorClient)
-    : InspectorFrontendClientLocal(inspectedWebPage->d->page->inspectorController(), inspectorView->page()->d->page, new InspectorFrontendSettingsQt())
+    : InspectorFrontendClientLocal(inspectedWebPage->d->page->inspectorController(), inspectorView->page()->d->page, adoptPtr(new InspectorFrontendSettingsQt()))
     , m_inspectedWebPage(inspectedWebPage)
     , m_inspectorView(inspectorView)
     , m_destroyingInspectorView(false)
--- src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp	(revision 86536)
+++ src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp	(revision 86550)
@@ -73,9 +73,9 @@
 #if ENABLE(NOTIFICATIONS)
 
 #ifndef QT_NO_SYSTEMTRAYICON
-    m_notificationIcon = 0;
+    m_notificationIcon = nullptr;
 #endif
-    m_presenter = 0;
+    m_presenter = nullptr;
 #endif
 }
 
@@ -211,9 +211,9 @@
         QPixmap pixmap;
         if (bytes.length() && pixmap.loadFromData(bytes)) {
             QIcon icon(pixmap);
-            wrapper->m_notificationIcon = new QSystemTrayIcon(icon);
+            wrapper->m_notificationIcon = adoptPtr(new QSystemTrayIcon(icon));
         } else
-            wrapper->m_notificationIcon = new QSystemTrayIcon();
+            wrapper->m_notificationIcon = adoptPtr(new QSystemTrayIcon());
 #endif
     }
 
--- src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h	(revision 86536)
+++ src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h	(revision 86550)
@@ -34,6 +34,7 @@
 #include "KURL.h"
 #include "PlatformString.h"
 #include "QtPlatformPlugin.h"
+#include <wtf/PassOwnPtr.h>
 #include <wtf/RefCounted.h>
 
 QT_BEGIN_NAMESPACE
@@ -189,7 +190,7 @@
     virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
     virtual void populateVisitedLinks();
 
-    QWebSelectMethod* createSelectPopup() const;
+    PassOwnPtr<QWebSelectMethod> createSelectPopup() const;
 
     virtual void dispatchViewportDataDidChange(const ViewportArguments&) const;

--- src/3rdparty/webkit/Source/WebCore/plugins/qt/PluginViewQt.cpp	(revision 86536)
+++ src/3rdparty/webkit/Source/WebCore/plugins/qt/PluginViewQt.cpp	(revision 86550)
@@ -950,7 +950,7 @@ bool PluginView::platformStart()
 
 #if USE(ACCELERATED_COMPOSITING) && !USE(TEXTURE_MAPPER)
         if (shouldUseAcceleratedCompositing()) {
-            m_platformLayer = new PluginGraphicsLayerQt(this);
+            m_platformLayer = adoptPtr(new PluginGraphicsLayerQt(this));
             // Trigger layer computation in RenderLayerCompositor
             m_element->setNeedsStyleRecalc(SyntheticStyleChange);
         }
