After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676837 - Cleanups and improvements to the extension system
Cleanups and improvements to the extension system
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-05-25 19:08 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-05-29 18:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
browser-plugin: Set the 'enabled-extensions' GSettings key directly (4.88 KB, patch)
2012-05-25 19:08 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
extensionSystem: Remove now-unused version_tag, clean up other code as well (5.70 KB, patch)
2012-05-25 19:08 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
extensionSystem: Remove custom CA file handling (3.77 KB, patch)
2012-05-25 19:08 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
extensionSystem: Clean up (1.20 KB, patch)
2012-05-25 19:08 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
extensionSystem: Use Gio.File.new_tmp (1.68 KB, patch)
2012-05-25 19:08 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
extensionSystem: Replace Shell.write_soup_message_to_stream with GBytes usage (2.96 KB, patch)
2012-05-25 19:08 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
extensionSystem: Show an icon in the install dialog (2.56 KB, patch)
2012-05-25 19:08 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
browser-plugin: Set the 'enabled-extensions' GSettings key directly (3.21 KB, patch)
2012-05-25 21:35 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
shellDBus: Remove now unused DisableExtension/EnableExtension (2.28 KB, patch)
2012-05-25 21:35 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
browser-plugin: Fix enable/disable (1.07 KB, patch)
2012-05-28 23:28 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-05-25 19:08:35 UTC
This is a quick clean up base that I'd like to have before I work on extension
updating for 3.6.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-05-25 19:08:37 UTC
Created attachment 214984 [details] [review]
browser-plugin: Set the 'enabled-extensions' GSettings key directly

This way, we won't have to shuttle over DBus if we want to set an extension's
status outside of a GNOME Shell session.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-05-25 19:08:40 UTC
Created attachment 214985 [details] [review]
extensionSystem: Remove now-unused version_tag, clean up other code as well
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-05-25 19:08:42 UTC
Created attachment 214986 [details] [review]
extensionSystem: Remove custom CA file handling

libsoup (well, glib-networking) now handles this automatically
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-05-25 19:08:45 UTC
Created attachment 214987 [details] [review]
extensionSystem: Clean up
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-05-25 19:08:47 UTC
Created attachment 214988 [details] [review]
extensionSystem: Use Gio.File.new_tmp
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-05-25 19:08:50 UTC
Created attachment 214989 [details] [review]
extensionSystem: Replace Shell.write_soup_message_to_stream with GBytes usage
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-05-25 19:08:52 UTC
Created attachment 214990 [details] [review]
extensionSystem: Show an icon in the install dialog
Comment 8 Giovanni Campagna 2012-05-25 20:50:54 UTC
Review of attachment 214984 [details] [review]:

I think the removal of DBus interfaces deserves a commit on its own. It is questionable, as there could be other consumers of it.

::: browser-plugin/browser-plugin.c
@@ +517,3 @@
+      new_uuids = g_new (const gchar *, length + 2); /* New key, NULL */
+      for (i = 0; i < length; i ++)
+        new_uuids[i] = g_strdup (uuids[i]);

You can avoid the copy if you g_free(new_uuids) instead of g_strfreev.
Comment 9 Giovanni Campagna 2012-05-25 20:59:32 UTC
Review of attachment 214985 [details] [review]:

Looks good.
Comment 10 Giovanni Campagna 2012-05-25 21:00:18 UTC
Review of attachment 214986 [details] [review]:

LG
Comment 11 Giovanni Campagna 2012-05-25 21:01:17 UTC
Review of attachment 214987 [details] [review]:

Yep
Comment 12 Giovanni Campagna 2012-05-25 21:02:30 UTC
Review of attachment 214988 [details] [review]:

LG
Comment 13 Giovanni Campagna 2012-05-25 21:10:40 UTC
Review of attachment 214989 [details] [review]:

Are we ok with the extra copy caused by conversion to GBytes?
(If so, acn)
Comment 14 Giovanni Campagna 2012-05-25 21:12:42 UTC
Review of attachment 214990 [details] [review]:

LG
Comment 15 Jasper St. Pierre (not reading bugmail) 2012-05-25 21:15:40 UTC
Review of attachment 214989 [details] [review]:

There's no extra copy. soup_buffer_get_as_bytes will take a ref on the buffer and hand the same buffer data contents that the SoupBuffer has internally:

http://git.gnome.org/browse/libsoup/tree/libsoup/soup-message-body.c#n311
Comment 16 Giovanni Campagna 2012-05-25 21:31:34 UTC
(In reply to comment #15)
> Review of attachment 214989 [details] [review]:
> 
> There's no extra copy. soup_buffer_get_as_bytes will take a ref on the buffer
> and hand the same buffer data contents that the SoupBuffer has internally:
> 
> http://git.gnome.org/browse/libsoup/tree/libsoup/soup-message-body.c#n311

Yes, my bad, I misread it.
Comment 17 Jasper St. Pierre (not reading bugmail) 2012-05-25 21:35:42 UTC
Created attachment 215007 [details] [review]
browser-plugin: Set the 'enabled-extensions' GSettings key directly

This way, we won't have to shuttle over DBus if we want to set an extension's
status outside of a GNOME Shell session.
Comment 18 Jasper St. Pierre (not reading bugmail) 2012-05-25 21:35:45 UTC
Created attachment 215008 [details] [review]
shellDBus: Remove now unused DisableExtension/EnableExtension

These methods were initially introduced when I was planning on having
an explicit DisableExtension/EnableExtension, instead of hooking up
a gsettings notify. This behavior was changed at the last minute, but
the methods were kept to avoid having to change the browser-plugin.

Consumers of this API should just set the GSettings key directly
instead now.
Comment 19 Giovanni Campagna 2012-05-25 22:15:12 UTC
Review of attachment 215007 [details] [review]:

This goes in for sure.
Comment 20 Giovanni Campagna 2012-05-25 22:16:03 UTC
Review of attachment 215008 [details] [review]:

This one I'm not sure... but after all it's not even 3.5.2, and that API has never been part of any stability promise. Go on and kill it.
Comment 21 Jasper St. Pierre (not reading bugmail) 2012-05-25 22:26:14 UTC
Attachment 214985 [details] pushed as 031206c - extensionSystem: Remove now-unused version_tag, clean up other code as well
Attachment 214986 [details] pushed as d57658d - extensionSystem: Remove custom CA file handling
Attachment 214987 [details] pushed as 33ad9d1 - extensionSystem: Clean up
Attachment 214988 [details] pushed as 0c736c4 - extensionSystem: Use Gio.File.new_tmp
Attachment 214989 [details] pushed as 9639616 - extensionSystem: Replace Shell.write_soup_message_to_stream with GBytes usage
Attachment 214990 [details] pushed as 3f94230 - extensionSystem: Show an icon in the install dialog
Attachment 215007 [details] pushed as 9d3750b - browser-plugin: Set the 'enabled-extensions' GSettings key directly
Attachment 215008 [details] pushed as 12c7cc2 - shellDBus: Remove now unused DisableExtension/EnableExtension
Comment 22 Jasper St. Pierre (not reading bugmail) 2012-05-28 23:28:17 UTC
Created attachment 215157 [details] [review]
browser-plugin: Fix enable/disable

This code was broken at the last minute, and an accidentally stale plugin
copy kept it untested.
Comment 23 Giovanni Campagna 2012-05-29 18:06:58 UTC
Review of attachment 215157 [details] [review]:

Ooops...
Good to go, integrate the comment if you want

::: browser-plugin/browser-plugin.c
@@ +516,3 @@
     {
       new_uuids = g_new (const gchar *, length + 2); /* New key, NULL */
+      memcpy (new_uuids, uuids, length * sizeof (*new_uuids));

sizeof(const char*) is clearer to me, but ok either way
Comment 24 Jasper St. Pierre (not reading bugmail) 2012-05-29 18:36:33 UTC
Attachment 215157 [details] pushed as ad6d986 - browser-plugin: Fix enable/disable