[GTK] Add MediaStream feature to avoid MediaStream test failure
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 15:36:10 +0000 (15:36 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 15:36:10 +0000 (15:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81727

Patch by Mao Yujie <yujie.mao@intel.com> on 2012-03-22
Reviewed by Martin Robinson.

* GNUmakefile.am:
* WebCoreSupport/UserMediaClientGtk.cpp: Added.
(WebKit):
(WebKit::UserMediaClientGtk::UserMediaClientGtk):
(WebKit::UserMediaClientGtk::~UserMediaClientGtk):
(WebKit::UserMediaClientGtk::pageDestroyed):
(WebKit::UserMediaClientGtk::requestUserMedia):
(WebKit::UserMediaClientGtk::cancelUserMediaRequest):
* WebCoreSupport/UserMediaClientGtk.h: Added.
(WebKit):
(UserMediaClientGtk):
* webkit/webkitwebview.cpp:
(webkit_web_view_init):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111707 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/GNUmakefile.am
Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.cpp [new file with mode: 0644]
Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.h [new file with mode: 0644]
Source/WebKit/gtk/webkit/webkitwebview.cpp

index e5fe6de74ef0d00aacb101b6c0bb38f5210d2fe0..0c47b0205af9bc64010850668478d02d0eab5f07 100644 (file)
@@ -1,3 +1,24 @@
+2012-03-22  Mao Yujie  <yujie.mao@intel.com>
+
+        [GTK] Add MediaStream feature to avoid MediaStream test failure
+        https://bugs.webkit.org/show_bug.cgi?id=81727
+
+        Reviewed by Martin Robinson.
+
+        * GNUmakefile.am:
+        * WebCoreSupport/UserMediaClientGtk.cpp: Added.
+        (WebKit):
+        (WebKit::UserMediaClientGtk::UserMediaClientGtk):
+        (WebKit::UserMediaClientGtk::~UserMediaClientGtk):
+        (WebKit::UserMediaClientGtk::pageDestroyed):
+        (WebKit::UserMediaClientGtk::requestUserMedia):
+        (WebKit::UserMediaClientGtk::cancelUserMediaRequest):
+        * WebCoreSupport/UserMediaClientGtk.h: Added.
+        (WebKit):
+        (UserMediaClientGtk):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_init):
+
 2012-03-22  Sergio Villar Senin  <svillar@igalia.com>
 
         [GTK] icon database requests not dispatched until new data arrives
index ec5f884af52c7994dc42c87e46ae36359890f2eb..3a0f7725a2c9dcaf25885e1f34caf8e67443ac1e 100644 (file)
@@ -211,6 +211,8 @@ webkitgtk_sources += \
        Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
        Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
        Source/WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
+       Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.cpp \
+       Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.h \
        Source/WebKit/gtk/webkit/webkitapplicationcache.cpp \
        Source/WebKit/gtk/webkit/webkitdownload.cpp \
        Source/WebKit/gtk/webkit/webkitdownloadprivate.h \
diff --git a/Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.cpp
new file mode 100644 (file)
index 0000000..391676a
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2012 Intel Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "UserMediaClientGtk.h"
+
+#if ENABLE(MEDIA_STREAM)
+#include "MediaStreamSource.h"
+#include "NotImplemented.h"
+#include "UserMediaRequest.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+UserMediaClientGtk::UserMediaClientGtk()
+{
+}
+
+UserMediaClientGtk::~UserMediaClientGtk()
+{
+}
+
+void UserMediaClientGtk::pageDestroyed()
+{
+    notImplemented();
+}
+
+void UserMediaClientGtk::requestUserMedia(WTF::PassRefPtr<UserMediaRequest> prpRequest, const MediaStreamSourceVector& audioSource, const MediaStreamSourceVector& videoSource)
+{
+    notImplemented();
+}
+
+void UserMediaClientGtk::cancelUserMediaRequest(UserMediaRequest* request)
+{
+    notImplemented();
+}
+
+} // namespace WebKit;
+
+#endif // MEDIA_STREAM
diff --git a/Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.h b/Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.h
new file mode 100644 (file)
index 0000000..a84be0d
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2012 Intel Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+#ifndef UserMediaClientGtk_h
+#define UserMediaClientGtk_h
+
+#include "UserMediaClient.h"
+
+namespace WebKit {
+
+class UserMediaClientGtk : public WebCore::UserMediaClient {
+public:
+    UserMediaClientGtk();
+    virtual ~UserMediaClientGtk();
+
+    virtual void pageDestroyed();
+    virtual void requestUserMedia(WTF::PassRefPtr<WebCore::UserMediaRequest>, const WebCore::MediaStreamSourceVector&, const WebCore::MediaStreamSourceVector&);
+    virtual void cancelUserMediaRequest(WebCore::UserMediaRequest*);
+};
+
+} // namespace WebKit
+
+#endif // UserMediaClientGtk_h
index 253e7d9f7b75fd5fc9e35e2e47d41acf75523192..586f6776b55208c88668f578f9b62e25b39b4a42 100644 (file)
 #include "DeviceOrientationClientGtk.h"
 #endif
 
+#if ENABLE(MEDIA_STREAM)
+#include "UserMediaClientGtk.h"
+#endif
+
 /**
  * SECTION:webkitwebview
  * @short_description: The central class of the WebKitGTK+ API
@@ -3520,6 +3524,10 @@ static void webkit_web_view_init(WebKitWebView* webView)
     WebCore::provideDeviceOrientationTo(priv->corePage, new DeviceOrientationClientGtk);
 #endif
 
+#if ENABLE(MEDIA_STREAM)
+    WebCore::provideUserMediaTo(priv->corePage, new UserMediaClientGtk);
+#endif
+
     if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
         static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(priv->corePage->geolocationController());
         // Set some testing-specific settings