diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-03-10 14:45:46 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-03-10 14:46:25 +0100 |
commit | 1ee472207c63905ab4455e676ee3ffd3263ab2cb (patch) | |
tree | 5e00ee54aa0f963665e124c2e5ce6a6a554c484f | |
parent | 5160ca54bb01b1d7bb0e6b359aa3d475df22e6f0 (diff) | |
parent | 650c6ee8e76bb574d3a1bea09e2494992d8f070e (diff) |
Merge remote-tracking branch 'origin/5.4' into 5.5v5.5.0-alpha1
Change-Id: I824a984e8552340c2f9f631ac951f2c9eaa90b74
19 files changed, 144 insertions, 73 deletions
diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp index 8e003c782..9b46d8792 100644 --- a/Source/JavaScriptCore/jit/JIT.cpp +++ b/Source/JavaScriptCore/jit/JIT.cpp @@ -74,7 +74,7 @@ JIT::JIT(VM* vm, CodeBlock* codeBlock) : m_interpreter(vm->interpreter) , m_vm(vm) , m_codeBlock(codeBlock) - , m_labels(codeBlock ? codeBlock->numberOfInstructions() : 0) + , m_labels(0) , m_bytecodeOffset((unsigned)-1) , m_propertyAccessInstructionIndex(UINT_MAX) , m_byValInstructionIndex(UINT_MAX) @@ -96,6 +96,7 @@ JIT::JIT(VM* vm, CodeBlock* codeBlock) , m_shouldEmitProfiling(false) #endif { + m_labels.reserveCapacity(codeBlock ? codeBlock->numberOfInstructions() : 0); } #if ENABLE(DFG_JIT) @@ -174,6 +175,7 @@ void JIT::privateCompileMainPass() m_globalResolveInfoIndex = 0; m_callLinkInfoIndex = 0; + m_labels.resize(instructionCount); for (m_bytecodeOffset = 0; m_bytecodeOffset < instructionCount; ) { if (m_disassembler) @@ -694,6 +696,7 @@ JITCode JIT::privateCompile(CodePtr* functionEntryArityCheck, JITCompilationEffo if (patchBuffer.didFailToAllocate()) return JITCode(); + ASSERT(m_labels.size() >= m_codeBlock->instructionCount()); // Translate vPC offsets into addresses in JIT generated code, for switch tables. for (unsigned i = 0; i < m_switches.size(); ++i) { SwitchRecord record = m_switches[i]; diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp index 5637e2090..bd5591986 100644 --- a/Source/JavaScriptCore/runtime/JSObject.cpp +++ b/Source/JavaScriptCore/runtime/JSObject.cpp @@ -1909,6 +1909,11 @@ void JSObject::putByIndexBeyondVectorLengthWithoutAttributes(ExecState* exec, un } } +// Used in JSArray.cpp so we must instantiate explicit +template void JSObject::putByIndexBeyondVectorLengthWithoutAttributes<Int32Shape>(ExecState* exec, unsigned i, JSValue value); +template void JSObject::putByIndexBeyondVectorLengthWithoutAttributes<DoubleShape>(ExecState* exec, unsigned i, JSValue value); +template void JSObject::putByIndexBeyondVectorLengthWithoutAttributes<ContiguousShape>(ExecState* exec, unsigned i, JSValue value); + void JSObject::putByIndexBeyondVectorLengthWithArrayStorage(ExecState* exec, unsigned i, JSValue value, bool shouldThrow, ArrayStorage* storage) { VM& vm = exec->vm(); diff --git a/Source/WTF/wtf/Atomics.h b/Source/WTF/wtf/Atomics.h index 4b3eb4b88..8f950c718 100644 --- a/Source/WTF/wtf/Atomics.h +++ b/Source/WTF/wtf/Atomics.h @@ -188,7 +188,7 @@ inline bool weakCompareAndSwap(void*volatile* location, void* expected, void* ne #if CPU(X86_64) bool result; asm volatile( - "lock; cmpxchgq %3, %2\n\t" + "lock; cmpxchg %3, %2\n\t" "sete %1" : "+a"(expected), "=q"(result), "+m"(*location) : "r"(newValue) diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp index b4c963a4f..5319f8e0c 100644 --- a/Source/WebCore/page/Page.cpp +++ b/Source/WebCore/page/Page.cpp @@ -1242,6 +1242,21 @@ void Page::privateBrowsingStateChanged() pluginViewBases[i]->privateBrowsingStateChanged(privateBrowsingEnabled); } +#if PLATFORM(QT) +void Page::pluginVisibilityChanged(bool visible) +{ + Vector<RefPtr<PluginViewBase>, 32> pluginViewBases; + collectPluginViews(pluginViewBases); + + for (size_t i = 0; i < pluginViewBases.size(); ++i) { + if (visible) + pluginViewBases[i]->show(); + else + pluginViewBases[i]->hide(); + } +} +#endif // PLATFORM(QT) + #if !ASSERT_DISABLED void Page::checkSubframeCountConsistency() const { diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h index d95565ab9..0931ed7b8 100644 --- a/Source/WebCore/page/Page.h +++ b/Source/WebCore/page/Page.h @@ -353,6 +353,10 @@ public: void setVisibilityState(PageVisibilityState, bool); #endif +#if PLATFORM(QT) + void pluginVisibilityChanged(bool visible); +#endif // PLATFORM(QT) + void addLayoutMilestones(LayoutMilestones); void removeLayoutMilestones(LayoutMilestones); LayoutMilestones requestedLayoutMilestones() const { return m_requestedLayoutMilestones; } diff --git a/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp index 562587369..a6d961f17 100644 --- a/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp +++ b/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp @@ -354,7 +354,7 @@ static void webKitWebSrcSetProperty(GObject* object, guint propID, const GValue* switch (propID) { case PROP_IRADIO_MODE: { - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); priv->iradioMode = g_value_get_boolean(value); break; } @@ -376,7 +376,7 @@ static void webKitWebSrcGetProperty(GObject* object, guint propID, GValue* value WebKitWebSrc* src = WEBKIT_WEB_SRC(object); WebKitWebSrcPrivate* priv = src->priv; - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); switch (propID) { case PROP_IRADIO_MODE: g_value_set_boolean(value, priv->iradioMode); @@ -429,7 +429,7 @@ static gboolean webKitWebSrcStop(WebKitWebSrc* src) ASSERT(isMainThread()); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); bool seeking = priv->seekID; @@ -493,7 +493,7 @@ static gboolean webKitWebSrcStart(WebKitWebSrc* src) ASSERT(isMainThread()); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); priv->startID = 0; @@ -584,7 +584,7 @@ static GstStateChangeReturn webKitWebSrcChangeState(GstElement* element, GstStat return ret; } - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); switch (transition) { case GST_STATE_CHANGE_READY_TO_PAUSED: GST_DEBUG_OBJECT(src, "READY->PAUSED"); @@ -615,7 +615,7 @@ static gboolean webKitWebSrcQueryWithParent(GstPad* pad, GstObject* parent, GstQ gst_query_parse_duration(query, &format, NULL); GST_DEBUG_OBJECT(src, "duration query in format %s", gst_format_get_name(format)); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); if (format == GST_FORMAT_BYTES && src->priv->size > 0) { gst_query_set_duration(query, format, src->priv->size); result = TRUE; @@ -623,7 +623,7 @@ static gboolean webKitWebSrcQueryWithParent(GstPad* pad, GstObject* parent, GstQ break; } case GST_QUERY_URI: { - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); gst_query_set_uri(query, src->priv->uri); result = TRUE; break; @@ -668,7 +668,7 @@ static gchar* webKitWebSrcGetUri(GstURIHandler* handler) WebKitWebSrc* src = WEBKIT_WEB_SRC(handler); gchar* ret; - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); ret = g_strdup(src->priv->uri); return ret; } @@ -683,7 +683,7 @@ static gboolean webKitWebSrcSetUri(GstURIHandler* handler, const gchar* uri, GEr return FALSE; } - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); g_free(priv->uri); priv->uri = 0; @@ -719,7 +719,7 @@ static const gchar* webKitWebSrcGetUri(GstURIHandler* handler) WebKitWebSrc* src = WEBKIT_WEB_SRC(handler); gchar* ret; - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); ret = g_strdup(src->priv->uri); return ret; } @@ -734,7 +734,7 @@ static gboolean webKitWebSrcSetUri(GstURIHandler* handler, const gchar* uri) return FALSE; } - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); g_free(priv->uri); priv->uri = 0; @@ -772,7 +772,7 @@ static gboolean webKitWebSrcNeedDataMainCb(WebKitWebSrc* src) ASSERT(isMainThread()); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); // already stopped if (!priv->needDataID) return FALSE; @@ -793,7 +793,7 @@ static void webKitWebSrcNeedDataCb(GstAppSrc*, guint length, gpointer userData) GST_DEBUG_OBJECT(src, "Need more data: %u", length); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); if (priv->needDataID || !priv->paused) { return; } @@ -807,7 +807,7 @@ static gboolean webKitWebSrcEnoughDataMainCb(WebKitWebSrc* src) ASSERT(isMainThread()); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); // already stopped if (!priv->enoughDataID) return FALSE; @@ -828,7 +828,7 @@ static void webKitWebSrcEnoughDataCb(GstAppSrc*, gpointer userData) GST_DEBUG_OBJECT(src, "Have enough data"); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); if (priv->enoughDataID || priv->paused) { return; } @@ -842,7 +842,7 @@ static gboolean webKitWebSrcSeekMainCb(WebKitWebSrc* src) ASSERT(isMainThread()); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); // already stopped if (!priv->seekID) return FALSE; @@ -860,7 +860,7 @@ static gboolean webKitWebSrcSeekDataCb(GstAppSrc*, guint64 offset, gpointer user WebKitWebSrcPrivate* priv = src->priv; GST_DEBUG_OBJECT(src, "Seeking to offset: %" G_GUINT64_FORMAT, offset); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); if (offset == priv->offset && priv->requestedOffset == priv->offset) return TRUE; @@ -879,7 +879,7 @@ static gboolean webKitWebSrcSeekDataCb(GstAppSrc*, guint64 offset, gpointer user void webKitWebSrcSetMediaPlayer(WebKitWebSrc* src, WebCore::MediaPlayer* player) { ASSERT(player); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); src->priv->player = player; s_cachedResourceLoader = player->cachedResourceLoader(); } @@ -906,7 +906,7 @@ char* StreamingClient::createReadBuffer(size_t requestedSize, size_t& actualSize mapGstBuffer(buffer); #endif - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); priv->buffer = adoptGRef(buffer); locker.unlock(); @@ -921,7 +921,7 @@ void StreamingClient::handleResponseReceived(const ResourceResponse& response) GST_DEBUG_OBJECT(src, "Received response: %d", response.httpStatusCode()); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); // If we seeked we need 206 == PARTIAL_CONTENT if (priv->requestedOffset && response.httpStatusCode() != 206) { @@ -1020,7 +1020,7 @@ void StreamingClient::handleDataReceived(const char* data, int length) WebKitWebSrc* src = WEBKIT_WEB_SRC(m_src.get()); WebKitWebSrcPrivate* priv = src->priv; - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); GST_LOG_OBJECT(src, "Have %d bytes of data", priv->buffer ? getGstBufferSize(priv->buffer.get()) : length); @@ -1074,7 +1074,7 @@ void StreamingClient::handleNotifyFinished() GST_DEBUG_OBJECT(src, "Have EOS"); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); if (!priv->seekID) { locker.unlock(); gst_app_src_end_of_stream(priv->appsrc); @@ -1210,7 +1210,7 @@ void ResourceHandleStreamingClient::wasBlocked(ResourceHandle*) GST_ERROR_OBJECT(src, "Request was blocked"); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); uri.set(g_strdup(src->priv->uri)); locker.unlock(); @@ -1224,7 +1224,7 @@ void ResourceHandleStreamingClient::cannotShowURL(ResourceHandle*) GST_ERROR_OBJECT(src, "Cannot show URL"); - GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); + WebCore::GMutexLocker locker(GST_OBJECT_GET_LOCK(src)); uri.set(g_strdup(src->priv->uri)); locker.unlock(); diff --git a/Source/WebCore/platform/qt/QWebPageClient.h b/Source/WebCore/platform/qt/QWebPageClient.h index d07907287..71ba34a19 100644 --- a/Source/WebCore/platform/qt/QWebPageClient.h +++ b/Source/WebCore/platform/qt/QWebPageClient.h @@ -62,6 +62,7 @@ public: virtual QOpenGLContext* openGLContextIfAvailable() { return 0; } virtual void setInputMethodHints(Qt::InputMethodHints hint) = 0; + virtual bool isViewVisible() = 0; #ifndef QT_NO_CURSOR inline void resetCursor() diff --git a/Source/WebCore/plugins/win/PluginViewWin.cpp b/Source/WebCore/plugins/win/PluginViewWin.cpp index 3fa897db8..b225673ab 100644 --- a/Source/WebCore/plugins/win/PluginViewWin.cpp +++ b/Source/WebCore/plugins/win/PluginViewWin.cpp @@ -345,6 +345,17 @@ static bool isWindowsMessageUserGesture(UINT message) } } +static inline bool isWebViewVisible(FrameView* view) +{ +#if PLATFORM(QT) + if (PlatformPageClient client = view->hostWindow()->platformPageClient()) + return client->isViewVisible(); + return false; +#else + return true; +#endif // PLATFORM(QT) +} + static inline IntPoint contentsToNativeWindow(FrameView* view, const IntPoint& point) { #if PLATFORM(QT) @@ -511,9 +522,10 @@ void PluginView::show() { setSelfVisible(true); - if (isParentVisible() && platformPluginWidget()) + if (isParentVisible() && platformPluginWidget()) { ShowWindow(platformPluginWidget(), SW_SHOWNA); - + forceRedraw(); + } Widget::show(); } @@ -819,9 +831,10 @@ void PluginView::setParentVisible(bool visible) Widget::setParentVisible(visible); if (isSelfVisible() && platformPluginWidget()) { - if (visible) + if (visible) { ShowWindow(platformPluginWidget(), SW_SHOWNA); - else + forceRedraw(); + } else ShowWindow(platformPluginWidget(), SW_HIDE); } } @@ -1019,7 +1032,7 @@ bool PluginView::platformStart() #endif DWORD flags = WS_CHILD; - if (isSelfVisible()) + if (isSelfVisible() && isWebViewVisible(toFrameView(parent()))) flags |= WS_VISIBLE; HWND parentWindowHandle = windowHandleForPageClient(m_parentFrame->view()->hostWindow()->platformPageClient()); diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp index f12fec923..d1a7f6cab 100644 --- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp +++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp @@ -345,6 +345,13 @@ QWebPageAdapter::VisibilityState QWebPageAdapter::visibilityState() const #endif } +void QWebPageAdapter::setPluginsVisible(bool visible) +{ + if (!page) + return; + page->pluginVisibilityChanged(visible); +} + void QWebPageAdapter::setNetworkAccessManager(QNetworkAccessManager *manager) { if (manager == networkManager) diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h index d08df953b..ee4d2595a 100644 --- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h +++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h @@ -267,6 +267,8 @@ public: void setVisibilityState(VisibilityState); VisibilityState visibilityState() const; + void setPluginsVisible(bool visible); + static QWebPageAdapter* kit(WebCore::Page*); WebCore::ViewportArguments viewportArguments() const; void registerUndoStep(WTF::PassRefPtr<WebCore::UndoStep>); diff --git a/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp b/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp index a35252093..fe4a16ead 100644 --- a/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp +++ b/Source/WebKit/qt/WidgetApi/qgraphicswebview.cpp @@ -409,6 +409,9 @@ bool QGraphicsWebView::event(QEvent* event) d->page->d->client->resetCursor(); } #endif + if (event->type() == QEvent::Show + || event->type() == QEvent::Hide) + d->page->event(event); } } return QGraphicsWidget::event(event); diff --git a/Source/WebKit/qt/WidgetApi/qwebpage.cpp b/Source/WebKit/qt/WidgetApi/qwebpage.cpp index 613c1ac56..02bddebda 100644 --- a/Source/WebKit/qt/WidgetApi/qwebpage.cpp +++ b/Source/WebKit/qt/WidgetApi/qwebpage.cpp @@ -1003,7 +1003,7 @@ bool QWebPagePrivate::gestureEvent(QGestureEvent* event) \a property specifies which property is queried. - \sa QWidget::inputMethodEvent(), QInputMethodEvent, QInputContext + \sa QWidget::inputMethodEvent(), QInputMethodEvent */ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const { @@ -2690,6 +2690,12 @@ bool QWebPage::event(QEvent *ev) d->dynamicPropertyChangeEvent(this, static_cast<QDynamicPropertyChangeEvent*>(ev)); break; #endif + case QEvent::Show: + d->setPluginsVisible(true); + break; + case QEvent::Hide: + d->setPluginsVisible(false); + break; default: return QObject::event(ev); } diff --git a/Source/WebKit/qt/WidgetApi/qwebview.cpp b/Source/WebKit/qt/WidgetApi/qwebview.cpp index 1a35b325c..05cf042b0 100644 --- a/Source/WebKit/qt/WidgetApi/qwebview.cpp +++ b/Source/WebKit/qt/WidgetApi/qwebview.cpp @@ -703,7 +703,9 @@ bool QWebView::event(QEvent *e) d->page->updatePositionDependentActions(event->pos()); } else #endif // QT_NO_CONTEXTMENU - if (e->type() == QEvent::ShortcutOverride) { + if (e->type() == QEvent::ShortcutOverride + || e->type() == QEvent::Show + || e->type() == QEvent::Hide) { d->page->event(e); #ifndef QT_NO_CURSOR } else if (e->type() == QEvent::CursorChange) { diff --git a/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp b/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp index 8333a59cc..858290f6e 100644 --- a/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp +++ b/Source/WebKit/qt/WidgetSupport/PageClientQt.cpp @@ -157,6 +157,11 @@ void PageClientQWidget::setWidgetVisible(Widget* widget, bool visible) qtWidget->setVisible(visible); } +bool PageClientQWidget::isViewVisible() +{ + return view ? view->isVisible() : false; +} + #if !defined(QT_NO_GRAPHICSVIEW) PageClientQGraphicsWidget::~PageClientQGraphicsWidget() { @@ -343,6 +348,11 @@ QGraphicsView* PageClientQGraphicsWidget::firstGraphicsView() const return view->scene()->views().first(); return 0; } + +bool PageClientQGraphicsWidget::isViewVisible() +{ + return view ? view->isVisible() : false; +} #endif // QT_NO_GRAPHICSVIEW } // namespace WebCore diff --git a/Source/WebKit/qt/WidgetSupport/PageClientQt.h b/Source/WebKit/qt/WidgetSupport/PageClientQt.h index 5db890eb5..8c7953634 100644 --- a/Source/WebKit/qt/WidgetSupport/PageClientQt.h +++ b/Source/WebKit/qt/WidgetSupport/PageClientQt.h @@ -83,6 +83,7 @@ public: virtual QRectF windowRect() const; virtual void setWidgetVisible(Widget*, bool visible); + virtual bool isViewVisible(); QWidget* view; QWebPage* page; @@ -168,6 +169,7 @@ public: virtual bool viewResizesToContentsEnabled() const { return viewResizesToContents; } virtual void setWidgetVisible(Widget*, bool); + virtual bool isViewVisible(); #if USE(TILED_BACKING_STORE) virtual QRectF graphicsItemVisibleRect() const; diff --git a/Source/WebKit/qt/docs/qtwebkit-bridge.qdoc b/Source/WebKit/qt/docs/qtwebkit-bridge.qdoc index 5db9e931c..674475bee 100644 --- a/Source/WebKit/qt/docs/qtwebkit-bridge.qdoc +++ b/Source/WebKit/qt/docs/qtwebkit-bridge.qdoc @@ -22,7 +22,7 @@ The playlist manager is usually best authored as a classic desktop application, with the native-looking robust \l{QWidget}s as the application's backbone. The media-player control usually has a custom look and feel and is best written using the \l{Graphics View framework} - or \l{QtDeclarative}. The music store, which shows dynamic content + or \l{Qt Quick}. The music store, which shows dynamic content from the Internet and gets modified rapidly, is best authored in HTML and maintained on the server. With the Qt WebKit bridge, the music store component can interact with native parts of the application, diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp b/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp index e23d28a2c..73da9c914 100644 --- a/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp +++ b/Source/WebKit2/Platform/CoreIPC/ArgumentDecoder.cpp @@ -129,13 +129,19 @@ bool ArgumentDecoder::decodeVariableLengthByteArray(DataReference& dataReference return true; } +template<typename Type> +static void decodeValueFromBuffer(Type& value, uint8_t*& bufferPosition) +{ + memcpy(&value, bufferPosition, sizeof(value)); + bufferPosition += sizeof(Type); +} + bool ArgumentDecoder::decode(bool& result) { if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; - result = *reinterpret_cast<bool*>(m_bufferPos); - m_bufferPos += sizeof(result); + decodeValueFromBuffer(result, m_bufferPos); return true; } @@ -144,8 +150,7 @@ bool ArgumentDecoder::decode(uint8_t& result) if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; - result = *reinterpret_cast<uint8_t*>(m_bufferPos); - m_bufferPos += sizeof(result); + decodeValueFromBuffer(result, m_bufferPos); return true; } @@ -154,8 +159,7 @@ bool ArgumentDecoder::decode(uint16_t& result) if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; - result = *reinterpret_cast_ptr<uint16_t*>(m_bufferPos); - m_bufferPos += sizeof(result); + decodeValueFromBuffer(result, m_bufferPos); return true; } @@ -163,9 +167,8 @@ bool ArgumentDecoder::decode(uint32_t& result) { if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; - - result = *reinterpret_cast_ptr<uint32_t*>(m_bufferPos); - m_bufferPos += sizeof(result); + + decodeValueFromBuffer(result, m_bufferPos); return true; } @@ -174,8 +177,7 @@ bool ArgumentDecoder::decode(uint64_t& result) if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; - result = *reinterpret_cast_ptr<uint64_t*>(m_bufferPos); - m_bufferPos += sizeof(result); + decodeValueFromBuffer(result, m_bufferPos); return true; } @@ -184,8 +186,7 @@ bool ArgumentDecoder::decode(int32_t& result) if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; - result = *reinterpret_cast_ptr<uint32_t*>(m_bufferPos); - m_bufferPos += sizeof(result); + decodeValueFromBuffer(result, m_bufferPos); return true; } @@ -193,9 +194,8 @@ bool ArgumentDecoder::decode(int64_t& result) { if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; - - result = *reinterpret_cast_ptr<uint64_t*>(m_bufferPos); - m_bufferPos += sizeof(result); + + decodeValueFromBuffer(result, m_bufferPos); return true; } @@ -203,9 +203,8 @@ bool ArgumentDecoder::decode(float& result) { if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; - - result = *reinterpret_cast_ptr<float*>(m_bufferPos); - m_bufferPos += sizeof(result); + + decodeValueFromBuffer(result, m_bufferPos); return true; } @@ -214,8 +213,7 @@ bool ArgumentDecoder::decode(double& result) if (!alignBufferPosition(sizeof(result), sizeof(result))) return false; - result = *reinterpret_cast_ptr<double*>(m_bufferPos); - m_bufferPos += sizeof(result); + decodeValueFromBuffer(result, m_bufferPos); return true; } diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp index 43246f4b5..f6a065b60 100644 --- a/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp +++ b/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp @@ -128,67 +128,64 @@ void ArgumentEncoder::encodeVariableLengthByteArray(const DataReference& dataRef encodeFixedLengthData(dataReference.data(), dataReference.size(), 1); } +template<typename Type> +static void copyValueToBuffer(Type value, uint8_t* bufferPosition) +{ + memcpy(bufferPosition, &value, sizeof(Type)); +} + void ArgumentEncoder::encode(bool n) { uint8_t* buffer = grow(sizeof(n), sizeof(n)); - - *reinterpret_cast<bool*>(buffer) = n; + copyValueToBuffer(n, buffer); } void ArgumentEncoder::encode(uint8_t n) { uint8_t* buffer = grow(sizeof(n), sizeof(n)); - - *reinterpret_cast<uint8_t*>(buffer) = n; + copyValueToBuffer(n, buffer); } void ArgumentEncoder::encode(uint16_t n) { uint8_t* buffer = grow(sizeof(n), sizeof(n)); - - *reinterpret_cast_ptr<uint16_t*>(buffer) = n; + copyValueToBuffer(n, buffer); } void ArgumentEncoder::encode(uint32_t n) { uint8_t* buffer = grow(sizeof(n), sizeof(n)); - - *reinterpret_cast_ptr<uint32_t*>(buffer) = n; + copyValueToBuffer(n, buffer); } void ArgumentEncoder::encode(uint64_t n) { uint8_t* buffer = grow(sizeof(n), sizeof(n)); - - *reinterpret_cast_ptr<uint64_t*>(buffer) = n; + copyValueToBuffer(n, buffer); } void ArgumentEncoder::encode(int32_t n) { uint8_t* buffer = grow(sizeof(n), sizeof(n)); - - *reinterpret_cast_ptr<int32_t*>(buffer) = n; + copyValueToBuffer(n, buffer); } void ArgumentEncoder::encode(int64_t n) { uint8_t* buffer = grow(sizeof(n), sizeof(n)); - - *reinterpret_cast_ptr<int64_t*>(buffer) = n; + copyValueToBuffer(n, buffer); } void ArgumentEncoder::encode(float n) { uint8_t* buffer = grow(sizeof(n), sizeof(n)); - - *reinterpret_cast_ptr<float*>(buffer) = n; + copyValueToBuffer(n, buffer); } void ArgumentEncoder::encode(double n) { uint8_t* buffer = grow(sizeof(n), sizeof(n)); - - *reinterpret_cast_ptr<double*>(buffer) = n; + copyValueToBuffer(n, buffer); } void ArgumentEncoder::addAttachment(const Attachment& attachment) diff --git a/Tools/qmake/mkspecs/features/default_pre.prf b/Tools/qmake/mkspecs/features/default_pre.prf index 06f10dec5..ce97df429 100644 --- a/Tools/qmake/mkspecs/features/default_pre.prf +++ b/Tools/qmake/mkspecs/features/default_pre.prf @@ -97,6 +97,9 @@ contains(QT_CONFIG, c++11): CONFIG += c++11 # Limit the creation of thin archives to Linux, since only GNU's ar supports it. !debug_and_release:linux: CONFIG += gnu_thin_archives +# The Gold linker breaks transition between JIT and LLInt due to thumb-state mismatch. +gcc:isEqual(QT_ARCH, "arm"): CONFIG -= use_gold_linker + # Pick up Qt's defaults for debug/release/debug_and_release if(win32|mac):!macx-xcode { contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release |