Exemplo n.º 1
0
WebKitNetworkResponse* kitNew(const WebCore::ResourceResponse& resourceResponse)
{
    GRefPtr<SoupMessage> soupMessage(adoptGRef(resourceResponse.toSoupMessage()));
    if (soupMessage)
        return WEBKIT_NETWORK_RESPONSE(g_object_new(WEBKIT_TYPE_NETWORK_RESPONSE, "message", soupMessage.get(), NULL));

    return WEBKIT_NETWORK_RESPONSE(g_object_new(WEBKIT_TYPE_NETWORK_RESPONSE, "uri", resourceResponse.url().string().utf8().data(), NULL));
}
// for internal use only
WebKitNetworkResponse* webkit_network_response_new_with_core_response(const WebCore::ResourceResponse& resourceResponse)
{
    GOwnPtr<SoupMessage> soupMessage(resourceResponse.toSoupMessage());
    if (soupMessage)
        return WEBKIT_NETWORK_RESPONSE(g_object_new(WEBKIT_TYPE_NETWORK_RESPONSE, "message", soupMessage.get(), NULL));

    return WEBKIT_NETWORK_RESPONSE(g_object_new(WEBKIT_TYPE_NETWORK_RESPONSE, "uri", resourceResponse.url().string().utf8().data(), NULL));
}
Exemplo n.º 3
0
static void webkit_network_response_finalize(GObject* object)
{
    WebKitNetworkResponse* response = WEBKIT_NETWORK_RESPONSE(object);
    WebKitNetworkResponsePrivate* priv = response->priv;

    g_free(priv->uri);

    G_OBJECT_CLASS(webkit_network_response_parent_class)->finalize(object);
}
Exemplo n.º 4
0
static void webkit_network_response_dispose(GObject* object)
{
    WebKitNetworkResponse* response = WEBKIT_NETWORK_RESPONSE(object);
    WebKitNetworkResponsePrivate* priv = response->priv;

    if (priv->message) {
        g_object_unref(priv->message);
        priv->message = NULL;
    }

    G_OBJECT_CLASS(webkit_network_response_parent_class)->dispose(object);
}
Exemplo n.º 5
0
static void webkit_network_response_get_property(GObject* object, guint propertyID, GValue* value, GParamSpec* pspec)
{
    WebKitNetworkResponse* response = WEBKIT_NETWORK_RESPONSE(object);

    switch(propertyID) {
    case PROP_URI:
        g_value_set_string(value, webkit_network_response_get_uri(response));
        break;
    case PROP_MESSAGE:
        g_value_set_object(value, webkit_network_response_get_message(response));
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyID, pspec);
    }
}
Exemplo n.º 6
0
static void webkit_network_response_set_property(GObject* object, guint propertyID, const GValue* value, GParamSpec* pspec)
{
    WebKitNetworkResponse* response = WEBKIT_NETWORK_RESPONSE(object);
    WebKitNetworkResponsePrivate* priv = response->priv;

    switch(propertyID) {
    case PROP_URI:
        webkit_network_response_set_uri(response, g_value_get_string(value));
        break;
    case PROP_MESSAGE:
        priv->message = SOUP_MESSAGE(g_value_dup_object(value));
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyID, pspec);
    }
}
Exemplo n.º 7
0
/**
 * webkit_network_response_new:
 * @uri: an URI
 *
 * Creates a new #WebKitNetworkResponse initialized with an URI.
 *
 * Returns: a new #WebKitNetworkResponse, or %NULL if the URI is
 * invalid.
 *
 * Since: 1.1.14
 */
WebKitNetworkResponse* webkit_network_response_new(const gchar* uri)
{
    g_return_val_if_fail(uri, NULL);

    return WEBKIT_NETWORK_RESPONSE(g_object_new(WEBKIT_TYPE_NETWORK_RESPONSE, "uri", uri, NULL));
}