[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
kov at webkit.org
kov at webkit.org
Thu Apr 8 01:29:08 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 9806a6cfd190289061db76eb4a28f13ed7f3d74d
Author: kov at webkit.org <kov at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 28 23:56:34 2010 +0000
2010-01-28 Sebastian Dröge <sebastian.droege at collabora.co.uk>
Reviewed by Gustavo Noronha.
Pass cookies to the GStreamer HTTP source
https://bugs.webkit.org/show_bug.cgi?id=34003
Test: http/tests/media/video-cookie.html
* platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
(WebCore::mediaPlayerPrivateSourceChangedCallback):
When using an appropiate GStreamer HTTP source element, pass
the cookies for the media URI to it. This fixes playback of
the YouTube HTML5 videos.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7ec1acb..69c6f50 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-28 Gustavo Noronha Silva <gns at gnome.org>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] Pass cookies to GStreamer
+ https://bugs.webkit.org/show_bug.cgi?id=34003
+
+ Test that cookie is being sent by the media player.
+
+ * http/tests/media/resources/setCookie.cgi: Added.
+ * http/tests/media/resources/video-cookie-check-cookie.php: Added.
+ * http/tests/media/video-cookie-expected.txt: Added.
+ * http/tests/media/video-cookie.html: Added.
+
2010-01-28 Csaba Osztrogonác <ossy at webkit.org>
[Qt] Incorrect small caps vs. normal text handling
diff --git a/LayoutTests/http/tests/media/resources/setCookie.cgi b/LayoutTests/http/tests/media/resources/setCookie.cgi
new file mode 100644
index 0000000..965bd9d
--- /dev/null
+++ b/LayoutTests/http/tests/media/resources/setCookie.cgi
@@ -0,0 +1,12 @@
+#!/usr/bin/perl -wT
+use CGI;
+
+$query = new CGI;
+$name = $query->param('name');
+
+print "Content-Type: text/plain\n";
+print "Cache-Control: no-store\n";
+print 'Cache-Control: no-cache="set-cookie"' . "\n";
+
+# We only map the SET_COOKIE request header to "Set-Cookie"
+print "Set-Cookie: TEST=${name}\n\n";
diff --git a/LayoutTests/http/tests/media/resources/video-cookie-check-cookie.php b/LayoutTests/http/tests/media/resources/video-cookie-check-cookie.php
new file mode 100644
index 0000000..60a03c1
--- /dev/null
+++ b/LayoutTests/http/tests/media/resources/video-cookie-check-cookie.php
@@ -0,0 +1,23 @@
+<?php
+ if($_COOKIE["TEST"])
+ {
+ $extension = substr($_COOKIE["TEST"], -3);
+
+ if ($extension == 'mp4') {
+ header("Content-Type: video/mp4");
+ $fileName = "test.mp4";
+ } else if ($extension == 'ogv') {
+ header("Content-Type: video/ogg");
+ $fileName = "test.ogv";
+ } else
+ die;
+
+ header("Cache-Control: no-store");
+ header("Connection: close");
+
+ $fn = fopen($fileName, "r");
+ fpassthru($fn);
+ fclose($fn);
+ exit;
+ }
+?>
diff --git a/LayoutTests/http/tests/media/video-cookie-expected.txt b/LayoutTests/http/tests/media/video-cookie-expected.txt
new file mode 100644
index 0000000..15f91d2
--- /dev/null
+++ b/LayoutTests/http/tests/media/video-cookie-expected.txt
@@ -0,0 +1,3 @@
+EVENT(canplaythrough)
+Tests that the media player will send the relevant cookies when requesting the media file.
+
diff --git a/LayoutTests/http/tests/media/video-cookie.html b/LayoutTests/http/tests/media/video-cookie.html
new file mode 100644
index 0000000..d8e6af1
--- /dev/null
+++ b/LayoutTests/http/tests/media/video-cookie.html
@@ -0,0 +1,37 @@
+<html>
+<head>
+</head>
+<body onload="loadCookie()">
+<video id="video"></video>
+<script src=../../../media/video-test.js></script>
+<script src=../../../media/media-file.js></script>
+<script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ function loadCookie () {
+ var movie = findMediaFile("video", "resources/test");
+ var frame = document.createElement("iframe");
+ document.body.appendChild(frame);
+
+ frame.addEventListener('load', function () {
+ video = document.getElementById('video');
+ video.src="http://127.0.0.1:8000/media/resources/video-cookie-check-cookie.php";
+ video.play();
+ });
+
+ frame.width = 0;
+ frame.height = 0;
+ frame.src = "http://127.0.0.1:8000/media/resources/setCookie.cgi?name=" + movie;
+ }
+
+ waitForEvent("canplaythrough", function () {
+ if (window.layoutTestController)
+ window.layoutTestController.notifyDone();
+ } );
+</script>
+Tests that the media player will send the relevant cookies when requesting the media file.<br/>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index 8f6d03c..411ffc6 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -102,3 +102,7 @@ platform/mac/accessibility/change-notification-on-scroll.html
# Skip Geolocation until https://bugs.webkit.org/show_bug.cgi?id=34025 is landed
fast/dom/Window/window-properties-geolocation.html
+
+# Fails on Mac for some reason; being investigates.
+# See https://bugs.webkit.org/show_bug.cgi?id=34287
+http/tests/media/video-cookie.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 29dbd84..21b77af 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -735,3 +735,7 @@ fast/css/non-standard-checkbox-size.html
# Skip Geolocation until https://bugs.webkit.org/show_bug.cgi?id=34025 is landed
fast/dom/Window/window-properties-geolocation.html
+
+# Needs to pass cookies to the media player
+# See http://bugs.webkit.org/show_bug.cgi?id=33954
+http/tests/media/video-cookie.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c4dfef5..4e78bc7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-01-28 Sebastian Dröge <sebastian.droege at collabora.co.uk>
+
+ Reviewed by Gustavo Noronha.
+
+ Pass cookies to the GStreamer HTTP source
+ https://bugs.webkit.org/show_bug.cgi?id=34003
+
+ Test: http/tests/media/video-cookie.html
+
+ * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::mediaPlayerPrivateSourceChangedCallback):
+ When using an appropiate GStreamer HTTP source element, pass
+ the cookies for the media URI to it. This fixes playback of
+ the YouTube HTML5 videos.
+
2010-01-28 Csaba Osztrogonác <ossy at webkit.org>
[Qt] Unreviewed buildfix after r54022.
@@ -3778,7 +3793,7 @@
* WebCore.pro: Fix warning about missing header file that isn't present anymore.
-2010-01-25 Sebastian Dröge <sebastian.droege at collabora.co.uk>
+2010-01-22 Sebastian Dröge <sebastian.droege at collabora.co.uk>
Reviewed by Gustavo Noronha Silva.
diff --git a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
index ea35196..e24ad89 100644
--- a/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
@@ -47,6 +47,7 @@
#include <gst/video/video.h>
#include <limits>
#include <math.h>
+#include <webkit/webkitwebview.h>
#include <wtf/gtk/GOwnPtr.h>
using namespace std;
@@ -131,6 +132,32 @@ void mediaPlayerPrivateSourceChangedCallback(GObject *object, GParamSpec *pspec,
g_object_get(mp->m_playBin, "source", &element, NULL);
gst_object_replace((GstObject**) &mp->m_source, (GstObject*) element);
+
+ if (element) {
+ GParamSpec* pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(element), "cookies");
+
+ // First check if the source element has a cookies property
+ // of the format we expect
+ if (!pspec || pspec->value_type != G_TYPE_STRV)
+ return;
+
+ // Then get the cookies for the URI and set them
+ SoupSession* session = webkit_get_default_session();
+ SoupCookieJar* cookieJar = SOUP_COOKIE_JAR(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR));
+
+ char* location;
+ g_object_get(element, "location", &location, NULL);
+
+ SoupURI* uri = soup_uri_new(location);
+ g_free(location);
+ char* cookies = soup_cookie_jar_get_cookies(cookieJar, uri, FALSE);
+ soup_uri_free(uri);
+
+ char* cookiesStrv[] = {cookies, NULL};
+ g_object_set(element, "cookies", cookiesStrv, NULL);
+ g_free(cookies);
+ }
+
gst_object_unref(element);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list