diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
commit | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch) | |
tree | b34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Source/WebKit2/Shared | |
parent | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff) | |
download | qtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz |
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Source/WebKit2/Shared')
6 files changed, 49 insertions, 20 deletions
diff --git a/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp b/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp index be04bff26..866833c64 100644 --- a/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp +++ b/Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp @@ -137,14 +137,14 @@ bool NetscapePluginModule::getPluginInfoForLoadedPlugin(PluginModuleInfo& plugin char* buffer; NPError error = NPP_GetValue(0, NPPVpluginNameString, &buffer); if (error == NPERR_NO_ERROR) - plugin.info.name = buffer; + plugin.info.name = String::fromUTF8(buffer); error = NPP_GetValue(0, NPPVpluginDescriptionString, &buffer); if (error == NPERR_NO_ERROR) - plugin.info.desc = buffer; + plugin.info.desc = String::fromUTF8(buffer); - const char* mimeDescription = NP_GetMIMEDescription(); - if (!mimeDescription) + String mimeDescription = String::fromUTF8(NP_GetMIMEDescription()); + if (mimeDescription.isNull()) return false; setMIMEDescription(mimeDescription, plugin); diff --git a/Source/WebKit2/Shared/ShareableBitmap.h b/Source/WebKit2/Shared/ShareableBitmap.h index c78a14e09..e5d1a6dc9 100644 --- a/Source/WebKit2/Shared/ShareableBitmap.h +++ b/Source/WebKit2/Shared/ShareableBitmap.h @@ -135,7 +135,7 @@ public: // This creates a QImage that directly references the shared bitmap data. // This is only safe to use when we know that the contents of the shareable bitmap won't change. QImage createQImage(); - void swizzleRGB(); + static void releaseSharedMemoryData(void* typelessBitmap); #endif private: diff --git a/Source/WebKit2/Shared/WebPreferencesStore.h b/Source/WebKit2/Shared/WebPreferencesStore.h index 0cdc97594..cb7030940 100644 --- a/Source/WebKit2/Shared/WebPreferencesStore.h +++ b/Source/WebKit2/Shared/WebPreferencesStore.h @@ -73,6 +73,7 @@ namespace WebKit { macro(CompositingRepaintCountersVisible, compositingRepaintCountersVisible, Bool, bool, false) \ macro(CSSCustomFilterEnabled, cssCustomFilterEnabled, Bool, bool, true) \ macro(WebGLEnabled, webGLEnabled, Bool, bool, false) \ + macro(CSSRegionsEnabled, cssRegionsEnabled, Bool, bool, true) \ macro(ForceFTPDirectoryListings, forceFTPDirectoryListings, Bool, bool, false) \ macro(TabsToLinks, tabsToLinks, Bool, bool, DEFAULT_WEBKIT_TABSTOLINKS_ENABLED) \ macro(DNSPrefetchingEnabled, dnsPrefetchingEnabled, Bool, bool, false) \ @@ -90,7 +91,7 @@ namespace WebKit { macro(AllowUniversalAccessFromFileURLs, allowUniversalAccessFromFileURLs, Bool, bool, false) \ macro(AllowFileAccessFromFileURLs, allowFileAccessFromFileURLs, Bool, bool, false) \ macro(AVFoundationEnabled, isAVFoundationEnabled, Bool, bool, DEFAULT_WEBKIT_AVFOUNDATION_ENABLED) \ - macro(Hixie76WebSocketProtocolEnabled, hixie76WebSocketProtocolEnabled, Bool, bool, true) \ + macro(Hixie76WebSocketProtocolEnabled, hixie76WebSocketProtocolEnabled, Bool, bool, false) \ macro(MediaPlaybackRequiresUserGesture, mediaPlaybackRequiresUserGesture, Bool, bool, false) \ macro(MediaPlaybackAllowsInline, mediaPlaybackAllowsInline, Bool, bool, true) \ macro(InspectorStartsAttached, inspectorStartsAttached, Bool, bool, true) \ @@ -98,7 +99,7 @@ namespace WebKit { macro(MockScrollbarsEnabled, mockScrollbarsEnabled, Bool, bool, false) \ macro(WebAudioEnabled, webAudioEnabled, Bool, bool, false) \ macro(ApplicationChromeModeEnabled, applicationChromeMode, Bool, bool, false) \ - macro(SuppressIncrementalRendering, suppressIncrementalRendering, Bool, bool, false) \ + macro(SuppressesIncrementalRendering, suppressesIncrementalRendering, Bool, bool, false) \ macro(BackspaceKeyNavigationEnabled, backspaceKeyNavigationEnabled, Bool, bool, true) \ macro(CaretBrowsingEnabled, caretBrowsingEnabled, Bool, bool, false) \ macro(ShouldDisplaySubtitles, shouldDisplaySubtitles, Bool, bool, false) \ diff --git a/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp b/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp index aae59e340..9d6e25c66 100644 --- a/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp +++ b/Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp @@ -99,6 +99,11 @@ bool ArgumentCoder<ResourceRequest>::decode(ArgumentDecoder* decoder, ResourceRe void ArgumentCoder<ResourceResponse>::encode(ArgumentEncoder* encoder, const ResourceResponse& resourceResponse) { + bool responseIsNull = resourceResponse.isNull(); + encoder->encode(responseIsNull); + if (responseIsNull) + return; + encoder->encode(resourceResponse.url().string()); encoder->encode(static_cast<int32_t>(resourceResponse.httpStatusCode())); @@ -115,6 +120,14 @@ void ArgumentCoder<ResourceResponse>::encode(ArgumentEncoder* encoder, const Res bool ArgumentCoder<ResourceResponse>::decode(ArgumentDecoder* decoder, ResourceResponse& resourceResponse) { + bool responseIsNull; + if (!decoder->decode(responseIsNull)) + return false; + if (responseIsNull) { + resourceResponse = ResourceResponse(); + return true; + } + ResourceResponse response; String url; @@ -170,6 +183,11 @@ bool ArgumentCoder<ResourceResponse>::decode(ArgumentDecoder* decoder, ResourceR void ArgumentCoder<ResourceError>::encode(ArgumentEncoder* encoder, const ResourceError& resourceError) { + bool errorIsNull = resourceError.isNull(); + encoder->encode(errorIsNull); + if (errorIsNull) + return; + encoder->encode(resourceError.domain()); encoder->encode(resourceError.errorCode()); encoder->encode(resourceError.failingURL()); @@ -178,6 +196,14 @@ void ArgumentCoder<ResourceError>::encode(ArgumentEncoder* encoder, const Resour bool ArgumentCoder<ResourceError>::decode(ArgumentDecoder* decoder, ResourceError& resourceError) { + bool errorIsNull; + if (!decoder->decode(errorIsNull)) + return false; + if (errorIsNull) { + resourceError = ResourceError(); + return true; + } + String domain; if (!decoder->decode(domain)) return false; diff --git a/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp b/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp index d5e371def..0c8be072a 100644 --- a/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp +++ b/Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp @@ -38,8 +38,15 @@ namespace WebKit { QImage ShareableBitmap::createQImage() { + ref(); // Balanced by deref in releaseSharedMemoryData return QImage(reinterpret_cast<uchar*>(data()), m_size.width(), m_size.height(), m_size.width() * 4, - m_flags & SupportsAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); + m_flags & SupportsAlpha ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32, + releaseSharedMemoryData, this); +} + +void ShareableBitmap::releaseSharedMemoryData(void* typelessBitmap) +{ + static_cast<ShareableBitmap*>(typelessBitmap)->deref(); // Balanced by ref in createQImage. } PassRefPtr<Image> ShareableBitmap::createImage() @@ -70,17 +77,5 @@ void ShareableBitmap::paint(GraphicsContext& /*context*/, float /*scaleFactor*/, notImplemented(); } -void ShareableBitmap::swizzleRGB() -{ - uint32_t* data = reinterpret_cast<uint32_t*>(this->data()); - int width = size().width(); - int height = size().height(); - for (int y = 0; y < height; ++y) { - uint32_t* p = data + y * width; - for (int x = 0; x < width; ++x) - p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00); - } -} - } // namespace WebKit diff --git a/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp b/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp index b6ac2f5e1..4eaff2c7e 100644 --- a/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp +++ b/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp @@ -86,6 +86,8 @@ static WebEvent::Type webEventTypeForEvent(const QEvent* event) return WebEvent::TouchMove; case QEvent::TouchEnd: return WebEvent::TouchEnd; + case QEvent::TouchCancel: + return WebEvent::TouchCancel; #endif default: // assert @@ -207,6 +209,11 @@ WebTouchEvent WebEventFactory::createWebTouchEvent(const QTouchEvent* event, con break; } + // Qt does not have a Qt::TouchPointCancelled point state, so if we receive a touch cancel event, + // simply cancel all touch points here. + if (type == WebEvent::TouchCancel) + state = WebPlatformTouchPoint::TouchCancelled; + m_touchPoints.append(WebPlatformTouchPoint(id, state, touchPoint.screenPos().toPoint(), fromItemTransform.map(touchPoint.pos()).toPoint())); } |