Bug 170001 - [GTK] Add MIMETypeRegistry implementation using xdgmime and remove the GTK+ one
Summary: [GTK] Add MIMETypeRegistry implementation using xdgmime and remove the GTK+ one
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2017-03-23 03:56 PDT by Carlos Garcia Campos
Modified: 2017-04-07 09:46 PDT (History)
5 users (show)

See Also:


Attachments
Patch (143.26 KB, patch)
2017-03-23 04:02 PDT, Carlos Garcia Campos
mcatanzaro: review+
cgarcia: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (146.19 KB, patch)
2017-03-23 06:42 PDT, Carlos Garcia Campos
commit-queue: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2017-03-23 03:56:24 PDT
The XDG implementation could be used by any port where shared-mime-info is expected to be available. It also improves the current GTK+ implementation that is based on a very small map of mime types and extensions.
Comment 1 Carlos Garcia Campos 2017-03-23 04:02:43 PDT
Created attachment 305180 [details]
Patch
Comment 2 Michael Catanzaro 2017-03-23 04:50:22 PDT
Comment on attachment 305180 [details]
Patch

It's a shame there is no GLib API for this, but this seems like the sort of thing that is acceptable to keep in ThirdParty.
Comment 3 Carlos Garcia Campos 2017-03-23 04:53:19 PDT
Yes, xdgmime is still designed to be copied as third party.
Comment 4 Carlos Garcia Campos 2017-03-23 04:54:30 PDT
Comment on attachment 305180 [details]
Patch

Thanks for the review, I still need to update the style checker to ignore xdgmime sources. And I'm checking a few diffs in layout tests too.
Comment 5 Carlos Garcia Campos 2017-03-23 06:42:45 PDT
Created attachment 305192 [details]
Patch for landing
Comment 6 Carlos Garcia Campos 2017-03-23 06:44:31 PDT
I don't know how to land this. The SVN commit hooks complains about tabs in xdgmime sources and suggests to set allow-tabs svn prop, but it seems git-svn doesn't allow to set a property on a new file that is not yet in the repository
Comment 7 Carlos Garcia Campos 2017-03-23 07:24:31 PDT
Comment on attachment 305192 [details]
Patch for landing

Let's see if commit-queue knows how to deal with this...
Comment 8 WebKit Commit Bot 2017-03-23 07:55:18 PDT
Comment on attachment 305192 [details]
Patch for landing

Rejecting attachment 305192 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-03', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 305192, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
342b53b9ba47346259522a0b7beb4007cf3 062d6873dec7afe86e241f457b3b62d2d6324ca9 M	Tools
Current branch master is up to date.
ERROR: Not all changes have been committed into SVN, however the committed
ones (if any) seem to be successfully integrated into the working tree.
Please see the above messages for details.


Failed to run "['git', 'svn', 'dcommit', '--rmdir']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit
Updating OpenSource
Current branch master is up to date.
Total errors found: 0 in 0 files

Full output: http://webkit-queues.webkit.org/results/3395185
Comment 9 Carlos Garcia Campos 2017-03-23 08:00:49 PDT
Any idea Lucas? I don't want to untabify third party sources . . . Is there any way to set the allow-tabs properties in new files or bypass the svn hook somehow?
Comment 10 Carlos Garcia Campos 2017-03-24 01:21:36 PDT
Committed r214338: <http://trac.webkit.org/changeset/214338>
Comment 11 Michael Catanzaro 2017-04-07 09:46:36 PDT
Did you notice this build warning:

[103/5550] Building C object Source/Th...Files/xdgmime.dir/src/xdgmimecache.c.o
../../Source/ThirdParty/xdgmime/src/xdgmimecache.c: In function ‘cache_magic_matchlet_compare_to_data’:
../../Source/ThirdParty/xdgmime/src/xdgmimecache.c:200:62: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
    valid_matchlet = memcmp(cache->buffer + data_offset, data + i, data_length) == 0;

That's invalid code, so it should be fixed, not suppressed.