[Webkit-unassigned] [Bug 69610] [GTK] Add webkit_web_view_stop_loading() to WebKit2 GTK+ API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 18 03:44:52 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=69610





--- Comment #5 from Carlos Garcia Campos <cgarcia at igalia.com>  2011-10-18 03:44:53 PST ---
(In reply to comment #4)
> (From update of attachment 110995 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=110995&action=review
> 
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:287
> > + * Does nothing if no content is being loaded.
> 
> Does nothing... -> This method does nothing...

Ok.

> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:290
> > + * #WebKitWebLoaderClient::load-failed will be emitted on current
> 
> current -> the current

Ok.

> > Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebLoaderClient.cpp:103
> > +    WebKitWebLoaderClient* client = webkit_web_view_get_loader_client(test->m_webView);
> > +
> > +    g_signal_connect(client, "load-committed", G_CALLBACK(loadCancelledLoadCommitted), test);
> > +    g_signal_connect(client, "load-failed", G_CALLBACK(loadCancelledLoadFailed), test);
> > +    g_signal_connect(client, "load-finished", G_CALLBACK(loadCancelledLoadFinished), test);
> > +
> > +    webkit_web_view_load_uri(test->m_webView, kServer->getURIForPath("/cancelled").data());
> 
> I think this can be simplified by using a load tracking test. Here you can just make a simple class:
> 
> class LoadStopTrackingTest : public LoadTrackingTest {
>     MAKE_GLIB_TEST_FIXTURE(LoadTrackingTest);
> public:
>     virtual void loadCommitted(WebKitWebLoaderClient* client) {
>         LoadTrackingTest::loadCommitted(client);
>         webkit_web_view_stop_loading(test->m_webView);
>     }
> }
> 
> and then later
> 
> LoadStopTrackingTest::add("WebKitWebView", "stop-loading", testLoadCancelled);

Ok, it looks much better indeed.

> You could also store the load error as a GOwnPtr member to assert that it's the right one. This would be a useful feature for LoadTrackingTest.
> 
> > Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebLoaderClient.cpp:158
> > +    } else if (g_str_equal(path, "/cancelled")) {
> > +        soup_message_headers_set_encoding(message->response_headers, SOUP_ENCODING_CHUNKED);
> > +        soup_message_body_append(message->response_body, SOUP_MEMORY_STATIC, responseString, strlen(responseString));
> > +        soup_server_unpause_message(server, message);
> > +        return;
> 
> Why is it important to have a cancelled message here? Wouldn't the existing default endpoint be fine?

stop_loading() is aync too, so this is to make sure the load is cancelled before it's finished.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list