Changeset 54266 in webkit


Ignore:
Timestamp:
Feb 2, 2010 5:21:32 PM (14 years ago)
Author:
kov@webkit.org
Message:

2010-02-02 Gustavo Noronha Silva <Gustavo Noronha Silva>

No review, rolling out r54261.
http://trac.webkit.org/changeset/54261
https://bugs.webkit.org/show_bug.cgi?id=34435

Causes crashes on release builds

  • GNUmakefile.am:
  • platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp: (WebCore::mediaPlayerPrivateSourceChangedCallback):
  • platform/gtk/GOwnPtrGtk.cpp: Removed.
  • platform/gtk/GOwnPtrGtk.h: Removed.
Location:
trunk/WebCore
Files:
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r54264 r54266  
     12010-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
    1152010-02-02  David Levin  <levin@chromium.org>
    216
  • trunk/WebCore/GNUmakefile.am

    r54261 r54266  
    20072007        WebCore/platform/gtk/GRefPtrGtk.cpp \
    20082008        WebCore/platform/gtk/GRefPtrGtk.h \
    2009         WebCore/platform/gtk/GOwnPtrGtk.cpp \
    2010         WebCore/platform/gtk/GOwnPtrGtk.h \
    20112009        WebCore/platform/gtk/GtkPluginWidget.cpp \
    20122010        WebCore/platform/gtk/GtkPluginWidget.h \
  • trunk/WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp

    r54261 r54266  
    132132{
    133133    MediaPlayerPrivate* mp = reinterpret_cast<MediaPlayerPrivate*>(data);
    134     GOwnPtr<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 property
    166     // of the format we expect
    167     if (!cookiesParamSpec || cookiesParamSpec->value_type != G_TYPE_STRV)
    168         return;
    169 
    170     // Then get the cookies for the URI and set them
    171     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);
    180180}
    181181
Note: See TracChangeset for help on using the changeset viewer.