[Webkit-unassigned] [Bug 149496] [GTK][WPE] Use mobile user-agent on tablet

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 7 23:42:59 PDT 2020


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

--- Comment #27 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 403599
  --> https://bugs.webkit.org/attachment.cgi?id=403599
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=403599&action=review

> Source/WebCore/platform/glib/UserAgentGLib.cpp:55
> +        if (!g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
> +            g_warning("Could not open /etc/machine-info: %s", error->message);

This is not working, all API tests are failing because of this warning:

FATAL-WARNING: Could not open /etc/machine-info: Failed to open file “/etc/machine-info”: No such file or directory

> Source/WebCore/platform/glib/UserAgentGLib.cpp:140
> +static ChassisType getChassisType()

We don't use getFoo in WebKit when the result is returned as return value.

> Source/WebCore/platform/glib/UserAgentGLib.cpp:145
> +    static bool firstRun = true;
> +
> +    if (firstRun) {

Use std::once_flag

> Source/WebCore/platform/glib/UserAgentGLib.cpp:282
> +    auto quirks = UserAgentQuirks::quirksForURL(url, getChassisType());

I wonder if we could move the chassisType() to WTF and simply use it every, instead of passing it as an argument. For now it's only used by user agent, but doesn't really belong to UserAgent, I would say.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200708/a413d89b/attachment.htm>


More information about the webkit-unassigned mailing list