Changeset 54266 in webkit
- Timestamp:
- Feb 2, 2010 5:21:32 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54264 r54266 1 2010-02-02 Gustavo Noronha Silva <gns@gnome.org> 2 3 No review, rolling out r54261. 4 http://trac.webkit.org/changeset/54261 5 https://bugs.webkit.org/show_bug.cgi?id=34435 6 7 Causes crashes on release builds 8 9 * GNUmakefile.am: 10 * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: 11 (WebCore::mediaPlayerPrivateSourceChangedCallback): 12 * platform/gtk/GOwnPtrGtk.cpp: Removed. 13 * platform/gtk/GOwnPtrGtk.h: Removed. 14 1 15 2010-02-02 David Levin <levin@chromium.org> 2 16 -
trunk/WebCore/GNUmakefile.am
r54261 r54266 2007 2007 WebCore/platform/gtk/GRefPtrGtk.cpp \ 2008 2008 WebCore/platform/gtk/GRefPtrGtk.h \ 2009 WebCore/platform/gtk/GOwnPtrGtk.cpp \2010 WebCore/platform/gtk/GOwnPtrGtk.h \2011 2009 WebCore/platform/gtk/GtkPluginWidget.cpp \ 2012 2010 WebCore/platform/gtk/GtkPluginWidget.h \ -
trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
r54261 r54266 132 132 { 133 133 MediaPlayerPrivate* mp = reinterpret_cast<MediaPlayerPrivate*>(data); 134 G OwnPtr<GstElement>element;135 136 g_object_get(mp->m_playBin, "source", &element .outPtr(), NULL);137 gst_object_replace((GstObject**) &mp->m_source, (GstObject*) element .get());138 139 if ( !element)140 return;141 142 GOwnPtr<char> location;143 g_object_get(element.get(), "location", &location.outPtr(), NULL);144 145 GOwnPtr<SoupURI> uri(soup_uri_new(location.get()));146 147 // Let Apple web servers know we want to access their nice movie trailers.148 if (g_str_equal(uri->host, "movies.apple.com"))149 g_object_set(element.get(), "user-agent", "Quicktime/7.2.0", NULL);150 151 // Set the HTTP referer.152 Frame* frame = mp->m_player->frameView() ? mp->m_player->frameView()->frame() : 0;153 Document* document = frame ? frame->document() : 0; 154 if (document) {155 GstStructure* extraHeaders = gst_structure_new("extra-headers",156 "Referer", G_TYPE_STRING, 157 document->documentURI().utf8().data(), 0);158 g_object_set(element.get(), "extra-headers", extraHeaders, NULL);159 gst_structure_free(extraHeaders);160 } 161 162 // Deal with the cookies from now on.163 GParamSpec* cookiesParamSpec = g_object_class_find_property(G_OBJECT_GET_CLASS(element.get()), "cookies"); 164 165 // First check if the source element has a cookies property166 // of the format we expect167 if (!cookiesParamSpec || cookiesParamSpec->value_type != G_TYPE_STRV) 168 return;169 170 // Then get the cookies for the URI and set them171 SoupSession* session = webkit_get_default_session();172 SoupSessionFeature* cookieJarFeature = soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR);173 if (!cookieJarFeature)174 return;175 176 SoupCookieJar* cookieJar = SOUP_COOKIE_JAR(cookieJarFeature);177 GOwnPtr<char> cookies(soup_cookie_jar_get_cookies(cookieJar, uri.get(), FALSE));178 char* cookiesStrv[] = {cookies.get(), 0}; 179 g _object_set(element.get(), "cookies", cookiesStrv, NULL);134 GstElement* element; 135 136 g_object_get(mp->m_playBin, "source", &element, NULL); 137 gst_object_replace((GstObject**) &mp->m_source, (GstObject*) element); 138 139 if (element) { 140 GParamSpec* pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(element), "cookies"); 141 142 // First check if the source element has a cookies property 143 // of the format we expect 144 if (!pspec || pspec->value_type != G_TYPE_STRV) 145 return; 146 147 // Then get the cookies for the URI and set them 148 SoupSession* session = webkit_get_default_session(); 149 SoupCookieJar* cookieJar = SOUP_COOKIE_JAR(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR)); 150 151 char* location; 152 g_object_get(element, "location", &location, NULL); 153 154 SoupURI* uri = soup_uri_new(location); 155 g_free(location); 156 157 // Let Apple web servers know we want to access their nice movie trailers. 158 if (g_str_equal(uri->host, "movies.apple.com")) 159 g_object_set(element, "user-agent", "Quicktime/7.2.0", NULL); 160 161 char* cookies = soup_cookie_jar_get_cookies(cookieJar, uri, FALSE); 162 soup_uri_free(uri); 163 164 char* cookiesStrv[] = {cookies, NULL}; 165 g_object_set(element, "cookies", cookiesStrv, NULL); 166 g_free(cookies); 167 168 Frame* frame = mp->m_player->frameView() ? mp->m_player->frameView()->frame() : 0; 169 Document* document = frame ? frame->document() : 0; 170 if (document) { 171 GstStructure* extraHeaders = gst_structure_new("extra-headers", 172 "Referer", G_TYPE_STRING, 173 document->documentURI().utf8().data(), 0); 174 g_object_set(element, "extra-headers", extraHeaders, NULL); 175 gst_structure_free(extraHeaders); 176 } 177 } 178 179 gst_object_unref(element); 180 180 } 181 181
Note: See TracChangeset
for help on using the changeset viewer.