Title: [121686] trunk/Source/WebKit2
Revision
121686
Author
[email protected]
Date
2012-07-02 09:31:10 -0700 (Mon, 02 Jul 2012)

Log Message

[Qt] Fix WebProcess crash on Mac when accessing a site with video tag.
https://bugs.webkit.org/show_bug.cgi?id=90384

Reviewed by Jocelyn Turcotte.

We need to initialize the private symbols used by MediaPlayerPrivateQTKit
otherwise they will be null and it will lead to a crash. We copy WebSystemInterface
files for WK2 just like the Mac port as WK2 may have different needs than WK1 layer (we
may add or remove symbols in here). It doesn't fix the video rendering yet but it's
first step.

* Target.pri:
* WebProcess/WebCoreSupport/qt/WebSystemInterface.h: Added.
* WebProcess/WebCoreSupport/qt/WebSystemInterface.mm: Added.
(InitWebCoreSystemInterfaceForWK2):
* WebProcess/qt/WebProcessMainQt.cpp:
(WebKit::WebProcessMainQt):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (121685 => 121686)


--- trunk/Source/WebKit2/ChangeLog	2012-07-02 16:22:13 UTC (rev 121685)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-02 16:31:10 UTC (rev 121686)
@@ -1,3 +1,23 @@
+2012-07-02  Alexis Menard  <[email protected]>
+
+        [Qt] Fix WebProcess crash on Mac when accessing a site with video tag.
+        https://bugs.webkit.org/show_bug.cgi?id=90384
+
+        Reviewed by Jocelyn Turcotte.
+
+        We need to initialize the private symbols used by MediaPlayerPrivateQTKit
+        otherwise they will be null and it will lead to a crash. We copy WebSystemInterface
+        files for WK2 just like the Mac port as WK2 may have different needs than WK1 layer (we
+        may add or remove symbols in here). It doesn't fix the video rendering yet but it's
+        first step.
+
+        * Target.pri:
+        * WebProcess/WebCoreSupport/qt/WebSystemInterface.h: Added.
+        * WebProcess/WebCoreSupport/qt/WebSystemInterface.mm: Added.
+        (InitWebCoreSystemInterfaceForWK2):
+        * WebProcess/qt/WebProcessMainQt.cpp:
+        (WebKit::WebProcessMainQt):
+
 2012-07-02  Sudarsana Nagineni  <[email protected]>
 
         [EFL] [WK2] Remove content sniffer and decoder initialization from WebProcess

Modified: trunk/Source/WebKit2/Target.pri (121685 => 121686)


--- trunk/Source/WebKit2/Target.pri	2012-07-02 16:22:13 UTC (rev 121685)
+++ trunk/Source/WebKit2/Target.pri	2012-07-02 16:31:10 UTC (rev 121686)
@@ -771,6 +771,16 @@
     WebProcess/qt/WebProcessQt.cpp
 
 mac: {
+
+    contains(DEFINES, WTF_USE_QTKIT=1) {
+        DEFINES += NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+        INCLUDEPATH += \
+            $$PWD/../../WebKitLibraries/
+        HEADERS += \
+            WebProcess/WebCoreSupport/qt/WebSystemInterface.h
+        SOURCES += \
+            WebProcess/WebCoreSupport/qt/WebSystemInterface.mm
+    }
     INCLUDEPATH += \
         Platform/mac \
         Platform/CoreIPC/mac

Added: trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebSystemInterface.h (0 => 121686)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebSystemInterface.h	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebSystemInterface.h	2012-07-02 16:31:10 UTC (rev 121686)
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2006 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+void InitWebCoreSystemInterfaceForWK2();

Added: trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebSystemInterface.mm (0 => 121686)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebSystemInterface.mm	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/qt/WebSystemInterface.mm	2012-07-02 16:31:10 UTC (rev 121686)
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WebSystemInterface.h"
+
+// Needed for builds not using PCH to expose BUILDING_ macros, see bug 32753.
+#include <wtf/Platform.h>
+
+#import <WebCoreSystemInterface.h>
+#import <WebKitSystemInterface.h>
+
+#define INIT(function) wk##function = WK##function
+
+void InitWebCoreSystemInterfaceForWK2(void)
+{
+    static bool didInit;
+    if (didInit)
+        return;
+
+    INIT(QTIncludeOnlyModernMediaFileTypes);
+    INIT(QTMovieDataRate);
+    INIT(QTMovieDisableComponent);
+    INIT(QTMovieMaxTimeLoaded);
+    INIT(QTMovieMaxTimeLoadedChangeNotification);
+    INIT(QTMovieMaxTimeSeekable);
+    INIT(QTMovieGetType);
+    INIT(QTMovieHasClosedCaptions);
+    INIT(QTMovieResolvedURL);
+    INIT(QTMovieSetShowClosedCaptions);
+    INIT(QTMovieSelectPreferredAlternates);
+    INIT(QTMovieViewSetDrawSynchronously);
+    INIT(QTGetSitesInMediaDownloadCache);
+    INIT(QTClearMediaDownloadCacheForSite);
+    INIT(QTClearMediaDownloadCache);
+    INIT(CreateMediaUIBackgroundView);
+    INIT(CreateMediaUIControl);
+    INIT(WindowSetAlpha);
+    INIT(WindowSetScaledFrame);
+
+    didInit = true;
+}

Modified: trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp (121685 => 121686)


--- trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp	2012-07-02 16:22:13 UTC (rev 121685)
+++ trunk/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp	2012-07-02 16:31:10 UTC (rev 121686)
@@ -40,6 +40,9 @@
 #if USE(ACCELERATED_COMPOSITING)
 #include "WebGraphicsLayer.h"
 #endif
+#if USE(QTKIT)
+#include "WebSystemInterface.h"
+#endif
 
 #ifndef NDEBUG
 #if !OS(WINDOWS)
@@ -148,6 +151,10 @@
     JSC::initializeThreading();
     WTF::initializeMainThread();
     RunLoop::initializeMainRunLoop();
+    
+#if USE(QTKIT)
+    InitWebCoreSystemInterfaceForWK2();
+#endif
 
     // Create the connection.
     if (app->arguments().size() <= 1) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to