[Webkit-unassigned] [Bug 88094] Web Inspector: Add a WebInspectorServer on Linux using the GSocket API for the GTK port

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 14 00:08:26 PDT 2012


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





--- Comment #25 from Carlos Garcia Campos <cgarcia at igalia.com>  2012-09-14 00:08:52 PST ---
(From update of attachment 163880)
View in context: https://bugs.webkit.org/attachment.cgi?id=163880&action=review

>> Source/WebKit2/UIProcess/API/gtk/tests/TestInspectorServer.cpp:86
>> +    g_thread_new("TestServerMonitor", testServerMonitorThreadFunc, 0);
> 
> Do we really need to use a thread here? Wouldn't a glib timeout do?

I think the reasoning is the same as in bug #72589, see the discussion there.

> Source/WebKit2/UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:40
> +bool WebInspectorServer::platformResourceForPath(const String& path, Vector<char>& data, String& contentType)

How often is this method called? I don't like all these synchronous API blocking the UI process, but the method is synchronous so I don't see any other solution.

> Source/WebKit2/UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:58
> +    GRefPtr<GFileInputStream> inputStream = adoptGRef(g_file_read(file.get(), NULL, 0));

Use 0 instead of NULL.

> Source/WebKit2/UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:66
> +    contentType = GOwnPtr<gchar>(g_file_info_get_attribute_as_string(fileInfo.get(), G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE)).get();

You can use g_file_info_get_content_type() which returns a const char *, if what contentType expects is actually the mime type, you might need to call g_content_type_get_mime_type() to get the mime type from the content type.

> Source/WebKit2/UIProcess/InspectorServer/gtk/WebSocketServerGtk.cpp:44
> +static gboolean connectionCallback(GSocketService* service,
> +                                   GSocketConnection* connection,
> +                                   GObject* sourceObject,
> +                                   WebSocketServer* server)

This should be a single line.

> Source/WebKit2/UIProcess/InspectorServer/gtk/WebSocketServerGtk.cpp:47
> +    GSocketAddress* sockaddr = g_socket_connection_get_remote_address(connection, NULL);

Use GRefPtr and adoptGRef. Use also 0 instead of NULL.

> Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp:61
> +        initialized = WebInspectorServer::shared().listen(bindAddress, port);

initialized is to ensure initInspectorServer() is executed only once, so it should set to true always, even if the env var is not present or the server fails to run.

-- 
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