diff -Nru epiphany-browser-3.22.6/ChangeLog epiphany-browser-3.22.7/ChangeLog --- epiphany-browser-3.22.6/ChangeLog 2017-02-03 14:24:45.000000000 -0500 +++ epiphany-browser-3.22.7/ChangeLog 2017-03-19 17:22:03.000000000 -0400 @@ -1,3 +1,393 @@ +commit bdaf345ef07f30fc2f9a59967933acc0d6272ae5 +Author: Michael Catanzaro +Date: Sun Mar 19 16:20:29 2017 -0500 + + Prepare 3.22.7 + + NEWS | 10 ++++++++++ + configure.ac | 2 +- + 2 files changed, 11 insertions(+), 1 deletion(-) + +commit e819b36748519b3225bc596e3e0f577a28b3a560 +Author: Michael Catanzaro +Date: Sat Mar 4 13:28:19 2017 -0600 + + embed: avoid memory corruption when clearing top widgets + + Don't call remove_from_destroy_list_cb, which modifies the destroy list, + when already iterating through the list. + + https://bugzilla.gnome.org/show_bug.cgi?id=779180 + + embed/ephy-embed.c | 22 +++++++++++++--------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +commit f6cd6a9a0c00471f8fce97f484c98780df2e3ca7 +Author: Carlos Garcia Campos +Date: Fri Mar 3 10:11:18 2017 +0100 + + Allocate PermissionRequestData with g_slice_new since it's freed with g_slice_free + + https://bugzilla.gnome.org/show_bug.cgi?id=779180 + + embed/ephy-web-view.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e101530c3f029d0c828a93f94687821bf4c34d9d +Author: Michael Catanzaro +Date: Wed Mar 1 07:45:06 2017 -0600 + + history-service: Don't crash if database is locked + + Yeah this is really bad, but let's not make it fatal. I changed this in + 3f76e6e5d45e4be973653f530e23c5ce2667d079 but I'm not sure if it was + intentional. It doesn't look like it, because I don't like leaving + unreachable code after calling g_error(). I think I was probably just + considering the change and forgot to turn it back to g_warning(). + + lib/history/ephy-history-service.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cfe3911b43de2ebf3c77e3377639a0bc51f7a12b +Author: Michael Catanzaro +Date: Tue Feb 21 10:36:18 2017 -0600 + + history-service: remove longstanding transactions + + Instead of having a longstanding transaction open at all times and + scheduling commits that open a new transaction, just create transactions + around history messages, so that each message forms its own atomic + transaction. This is way simpler. + + I considered that we might not need transactions at all, but there are + performance implications to removing transactions entirely. + + lib/history/ephy-history-service-hosts-table.c | 1 - + lib/history/ephy-history-service-private.h | 2 - + lib/history/ephy-history-service-urls-table.c | 1 - + lib/history/ephy-history-service-visits-table.c | 7 +- + lib/history/ephy-history-service.c | 135 ++++++++---------------- + 5 files changed, 47 insertions(+), 99 deletions(-) + +commit 0a6e90f8badde14b3bd6e112a9df2c8b68ef41bf +Author: Michael Catanzaro +Date: Tue Feb 21 09:54:11 2017 -0600 + + history-service: Remove useless allocations + + lib/history/ephy-history-service-hosts-table.c | 7 +++---- + lib/history/ephy-history-service-urls-table.c | 7 +++---- + 2 files changed, 6 insertions(+), 8 deletions(-) + +commit c636bdc739c55bb3cb9ddf4915d4137f319dbf86 +Author: Michael Catanzaro +Date: Mon Feb 20 20:24:03 2017 -0600 + + Fix theoretical race condition in ephy_history_service_add_visit_row + + The design of the history service feels like one big footgun. I'm really + not sure why a history thread is necessary at all, or why we have + longstanding transactions (defeating the entire purpose of transactions) + instead of just using autocommit, which I think would be sufficient for + everything we do. + + This commit doesn't fix any of that. That's just a rant. This commit + just fixes one theoretical race condition. Prepared statements lock the + database and need to be finalized BEFORE commit. The current code only + works if the prepared statement is finalized on the UI thread before the + scheduled commit occurs on the history thread. Which is probably always, + but let's not leave it to luck. + + I could see this leading to a small loss of the last bit of history when + closing the browser. + + https://bugzilla.gnome.org/show_bug.cgi?id=778649 + + lib/history/ephy-history-service-visits-table.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 429ed9b34b0cc708e8bd0b79f08486893a58b114 +Author: Michael Catanzaro +Date: Sun Feb 19 11:05:26 2017 -0600 + + history-service: Fix write to database in read-only mode + + Now that SQLite enforces read-only mode for us, bugs like this will be + uncovered.... + + https://bugzilla.gnome.org/show_bug.cgi?id=778649 + + lib/history/ephy-history-service-hosts-table.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit feae9a35c59bb5abd6ab6708dac82bcaf9c605ef +Author: Michael Catanzaro +Date: Sun Feb 19 09:45:32 2017 -0600 + + history-service: Fix multiple initialization race conditions + + This started out as a project to fix the read-only service test I just + added. Initializing two history service objects in a row was racy, + because I needed the first history service to be initialized before + creating the second one, but there was no way to ensure that. This was + only an issue for this one test, though; real Epiphany browser mode of + course only creates one history service, so I assumed it was not a big + problem. + + Fix this first issue using a condition variable to ensure the GObject + initialization doesn't complete until after the history service has + actually created the SQLite database. + + In doing this, I discovered a second bug. The use of the condition + variable altered the timing slightly, and caused the history filename + property to not be set in time when entering the history service thread. + In fact, it's kind of amazing that the history service ever worked at + all, because there is absolutely nothing here to guarantee that the + filename and read-only properties have been initialized prior to + starting the history service thread. So the database filename could be + NULL when opening the database, which is a great way to lose all your + history. Also, it could also be in read-only mode here even if it is + supposed to be read/write mode, which is going to cause failures after + today's commits. Fix this by adding a constructed function and starting + the history thread from there, instead of doing it in init. This means + that the history thread will not be started until after properties have + been set. Note that, while I could not reproduce this bug on my machine + until after adding the condition variable to fix the first bug, that was + just due to timing and luck; it was already broken before. + + https://bugzilla.gnome.org/show_bug.cgi?id=778649 + + lib/history/ephy-history-service-private.h | 2 ++ + lib/history/ephy-history-service.c | 47 ++++++++++++++++++++++++------ + tests/ephy-history-test.c | 5 ---- + 3 files changed, 40 insertions(+), 14 deletions(-) + +commit 1266f3025d4fd38df1bcc1afdbe02028e7117e9a +Author: Michael Catanzaro +Date: Sun Feb 19 08:58:42 2017 -0600 + + history-service: Remove incorrect comment + + The code does something different, and it's not complex enough to merit + a comment anyway. + + https://bugzilla.gnome.org/show_bug.cgi?id=778649 + + lib/history/ephy-history-service.c | 1 - + 1 file changed, 1 deletion(-) + +commit c4e43bf3b93a2a56070fbafea5a6ab01d5b5b6d8 +Author: Michael Catanzaro +Date: Sun Feb 19 08:57:04 2017 -0600 + + history-service: Don't schedule commit after clearing history + + Now that clear all is implemented by deleting the database file, there's + no longer any need to schedule a commit here. + + https://bugzilla.gnome.org/show_bug.cgi?id=778649 + + lib/history/ephy-history-service.c | 1 - + 1 file changed, 1 deletion(-) + +commit 92885ae9a87bdd963eb56b378dae80db92e3c5da +Author: Michael Catanzaro +Date: Sat Feb 18 22:13:05 2017 -0600 + + history-service: Remove Yoda conditions + + There's no excuse for this.... + + https://bugzilla.gnome.org/show_bug.cgi?id=778649 + + lib/history/ephy-history-service.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit b03a62304845b1140d49be58fae72e400138e677 +Author: Michael Catanzaro +Date: Sat Feb 18 22:05:21 2017 -0600 + + history-service: Fix leak when clearing all history + + Closing the connection is great, but not enough. We're leaking our + wrapper object. + + https://bugzilla.gnome.org/show_bug.cgi?id=778649 + + lib/history/ephy-history-service.c | 3 +++ + 1 file changed, 3 insertions(+) + +commit 6abc89cab36a5bd177f05670243227e4c50bcfad +Author: Michael Catanzaro +Date: Sat Feb 18 21:28:22 2017 -0600 + + history-service: Ensure thread member is initialized before use + + We have assertions to ensure that several functions are only ever called + on the history thread. But the first such assertion, at the top of + run_history_service_thread, sometimes fails when running the tests. It + is racy. Use a mutex to fix this. + + These assertions are actually executed at runtime for end users, so it's + surprising that nobody has ever reported a bug about this. + + We also need to be sure to initialize the async queue before running the + history service thread. The mutex is needed as a memory barrier here, so + it's not possible to remove the mutex by removing the assertions except + in debug mode, which is something I considered. + + https://bugzilla.gnome.org/show_bug.cgi?id=778649 + + lib/history/ephy-history-service-private.h | 1 + + lib/history/ephy-history-service.c | 15 ++++++++++++++- + 2 files changed, 15 insertions(+), 1 deletion(-) + +commit a6d81d79ccc31a7b262cdc1dd09ac2ea4a03bc7e +Author: Michael Catanzaro +Date: Sat Feb 18 20:47:50 2017 -0600 + + Fix search provider horribly breaking history service + + If the search provider is running, all database transactions will fail + because the search provider will take a write lock on the database. + Ouch! This is worth a good string of profanities.... + + Notably, this causes opening the database to fail if you searched for + anything in the shell overview in the minute prior to starting Epiphany. + (One minute is our search provider timeout.) Then no history will ever + get saved, ever. I think. Something like that. + + So, although our history service has read-only mode, it's enforced at + the history service level, not the SQLite connection level. SQLite + actually has a read-only mode, which we are not using, and which we need + to use in the search provider if we want to have any chance of reliably + saving history. + + Accordingly, give EphySQLiteConnection a mode property, to indicate + whether it is in writable mode or read-only mode. Teach all callers to + set it properly. Use it, rather than a boolean, when creating the + EphyHistoryService, since boolean parameters are hard to read at call + sites. And actually put the underlying SQLite connection in read-only + mode when set. + + Don't open transactions or ever attempt to rollback in read-only mode, + because that doesn't make any sense. This should never have been + happening due to the history service level read-only checks, but it + should be enforced at the SQLite connection level now, too. + + Avoid initializing tables when opening the database in read-only mode. + This is obviously writing to the database, and now that we really have a + read-only SQLite connection it fails. As it should. + + SQLite connection creation will now fail in case the connection is + read-only and the database does not yet exist; it will no longer be + created anyway. So handle this case gracefully. It's fine for the + history service to return nothing in this case. This has the small + advantage that the history thread will quit immediately after it's + created in this case, so it's not constantly running if there's no + history in incognito mode anymore. To check for this condition, we + expose the underlying SQLite error; previously, only the error message + was exposed outside of EphySQLiteConnection. Exposing the error isn't + really necessary or sufficient, though, since it's super generic and we + have to check if the file actually exists on disk anyway. + + Test it. Ensure that a read/write history service functions properly if + it's running at the same time as a read-only history service. Using two + read/write services here fails very badly, but when one of the services + is read-only it works fine. + + Also, remove the original read-only service test. It only ever tested + that creating a read-only history service with an empty history database + would succeed. And, as I just explained, that fails now. + + Lastly, stop running a second history service for the search provider. + It needed its own once upon a time when the search provider did not run + an EphyShell instance. That changed when we stopped using the default + web context, because nothing works without EphyEmbedShell now, as all + sorts of places need it to get the embed's web context. And since + EphyEmbedShell runs its own history service, the search provider can + just use that now instead of running its own separate one. + + https://bugzilla.gnome.org/show_bug.cgi?id=778649 + + embed/ephy-embed-shell.c | 10 ++++-- + lib/Makefile.am | 3 +- + lib/ephy-profile-migrator.c | 2 +- + lib/ephy-sqlite-connection.c | 70 +++++++++++++++++++++++++++++++++----- + lib/ephy-sqlite-connection.h | 13 ++++++- + lib/history/ephy-history-service.c | 21 +++++++++--- + lib/history/ephy-history-service.h | 4 ++- + src/ephy-search-provider.c | 8 ++--- + tests/ephy-history-test.c | 64 +++++++++++++++++++++------------- + tests/ephy-sqlite-test.c | 2 +- + 10 files changed, 149 insertions(+), 48 deletions(-) + +commit 37a44e922e8d873ce9d6a5616ef5fba93ee2aa88 +Author: Michael Catanzaro +Date: Wed Feb 15 10:28:28 2017 -0600 + + downloads-popover: Disconnect more signals when popover is destroyed + + These signals can run after the popover has been destroyed. We don't + want that. Speculative fix for this critical: + + epiphany-Gtk-CRITICAL: gtk_widget_set_sensitive: assertion 'GTK_IS_WIDGET (widget)' failed + + https://bugzilla.gnome.org/show_bug.cgi?id=778659 + + lib/widgets/ephy-downloads-popover.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +commit 9d75f710be56c92b87fe91484d579559172aa92b +Author: Michael Catanzaro +Date: Tue Feb 14 22:55:37 2017 -0600 + + sqlite-connection: Do not ignore errors when executing commands + + This file is so careful to handle errors properly everywhere EXCEPT the + point where actual SQLite commands are executed. The history database is + pretty much totally broken right now; having error messages would be + helpful thank you! + + lib/ephy-sqlite-connection.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 305b4f8905747785f7683161cca38bb7bc449ed4 +Author: Michael Catanzaro +Date: Mon Feb 13 22:51:34 2017 -0600 + + embed-shell: fix criticals in delayed_thumbnail_update_data_free + + embed/ephy-embed-shell.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 869d3c7d463976a558d99f1314926df59a4a85fa +Author: Michael Catanzaro +Date: Mon Feb 13 21:07:31 2017 -0600 + + snapshot-service: Fix stale snapshot replacement + + Looks like I broke this in a refactoring, probably + adc6c404f650d51bf2709ed3d6f70475a0. Snapshots loaded for the overview + are almost always available in cache before a webpage is visited, so + those pages would never get updated. We need to update stale snapshots + in ephy_snapshot_service_get_snapshot_path_async() to avoid this. It + *could* still happen that snapshot requests are scheduled multiple + times in a row, but it's unlikely and harmless. + + lib/ephy-snapshot-service.c | 33 ++++++++++++++++++++++----------- + 1 file changed, 22 insertions(+), 11 deletions(-) + +commit dfeedecc5c92980e0c6cf57f297063503bf0b013 +Author: Michael Catanzaro +Date: Fri Feb 3 13:27:32 2017 -0600 + + Prepare 3.22.6 + + NEWS | 8 ++++++++ + configure.ac | 2 +- + 2 files changed, 9 insertions(+), 1 deletion(-) + commit 30a34f2a0a97d951dea8de923feafca6d0846011 Author: Adrian Perez de Castro Date: Fri Feb 3 00:54:51 2017 +0200 @@ -5851,213 +6241,3 @@ po/pl.po | 1237 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 644 insertions(+), 593 deletions(-) - -commit 5eed405e85001a18e1fdf3658445e5661d2c643c -Author: Jiri Grönroos -Date: Fri Feb 5 20:33:11 2016 +0000 - - Updated Finnish translation - - po/fi.po | 231 +++++++++++++++++++++++++++++++++------------------------------ - 1 file changed, 121 insertions(+), 110 deletions(-) - -commit 9e233ee9cb3e2ffd9fcbd765fd607acd3640a842 -Author: Fábio Nogueira -Date: Wed Feb 3 14:33:58 2016 +0000 - - Updated Brazilian Portuguese translation - - po/pt_BR.po | 793 ++++++++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 503 insertions(+), 290 deletions(-) - -commit e1c753712b7a43fcbd588ae502d8c9d15391ee1a -Author: Matej Urbančič -Date: Tue Feb 2 17:45:18 2016 +0100 - - Updated Slovenian translation - - po/sl.po | 480 ++++++++++++++++++++++++++++++++++----------------------------- - 1 file changed, 259 insertions(+), 221 deletions(-) - -commit cb9e0c4bb7d2bc1105977b434499ba14ee1384db -Author: Alexandre Franke -Date: Tue Feb 2 11:23:22 2016 +0000 - - Updated French translation - - po/fr.po | 1156 +++++++++++++++++++++++++++++++++----------------------------- - 1 file changed, 615 insertions(+), 541 deletions(-) - -commit 41d802c5a0729382f2a7cc5440d8a5d2ccbd171e -Author: Daniel Mustieles -Date: Sun Jan 31 22:18:40 2016 +0100 - - Updated Spanish translation - - po/es.po | 498 ++++++++++++++++++++++++++++++++------------------------------- - 1 file changed, 251 insertions(+), 247 deletions(-) - -commit 928dfa0abb0b4f30f6764a18fd159eccae676472 -Author: Dušan Kazik -Date: Sat Jan 30 14:02:54 2016 +0000 - - Updated Slovak translation - - po/sk.po | 168 ++++++++++++++++++++++++++++++++++----------------------------- - 1 file changed, 92 insertions(+), 76 deletions(-) - -commit acb58b2672d57e28aba2caef60a3fa03040f6c93 -Author: Gábor Kelemen -Date: Fri Jan 29 16:32:15 2016 +0000 - - Updated Hungarian translation - - help/hu/hu.po | 108 ++++++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 68 insertions(+), 40 deletions(-) - -commit 88fad356f74f8d93feb12da636ae001731eb9756 -Author: Balázs Meskó -Date: Tue Jan 26 14:31:10 2016 +0000 - - Updated Hungarian translation - - po/hu.po | 99 ++++++++++++++++++++++++++++++++++------------------------------ - 1 file changed, 53 insertions(+), 46 deletions(-) - -commit 096b1586e42aee319dca745a068454787d04ec5b -Author: Mario Blättermann -Date: Mon Jan 25 21:01:14 2016 +0100 - - Updated German translation - - po/de.po | 89 ++++++++++++++++++++++++++++++++++------------------------------ - 1 file changed, 48 insertions(+), 41 deletions(-) - -commit 037c7797cecb870eb069777639e17377d52fda2b -Author: Richard Hughes -Date: Mon Jan 25 15:40:57 2016 +0000 - - Add a missing tag to the AppData file - - data/epiphany.appdata.xml.in | 1 + - 1 file changed, 1 insertion(+) - -commit 56e9ef77df2377bc4d0ca39a4900641eba2421cd -Author: Michael Catanzaro -Date: Sun Jan 24 22:07:39 2016 -0600 - - Move ephy-web-dom-utils to embed/web-extension - - Since it's only usable from the web extension. - - Also, remove an old #include from window-commands, a holdover from - WebKit1 I suppose. - - https://bugzilla.gnome.org/show_bug.cgi?id=761074 - - embed/web-extension/Makefile.am | 2 ++ - {lib => embed/web-extension}/ephy-web-dom-utils.c | 0 - {lib => embed/web-extension}/ephy-web-dom-utils.h | 0 - lib/Makefile.am | 2 -- - src/window-commands.c | 1 - - 5 files changed, 2 insertions(+), 3 deletions(-) - -commit cc67c5f394a94e3b5e1cf232772d73a9cb2e90f5 -Author: Michael Catanzaro -Date: Sun Jan 24 19:23:43 2016 -0600 - - web-view: Add mnemonics for error page buttons - - Unfortunately WebKit does not actually render the access key, so there's - no way to know it's there, but it's better than not having any access - key. - - https://bugzilla.gnome.org/show_bug.cgi?id=761069 - - embed/ephy-web-view.c | 14 ++++++++++++-- - src/resources/error.html | 2 +- - 2 files changed, 13 insertions(+), 3 deletions(-) - -commit ff58bf0e64a261eb6cb295f256803f11ca4a5dad -Author: Michael Catanzaro -Date: Sun Jan 24 22:47:29 2016 -0600 - - web-dom-utils: Add another FIXME - - lib/ephy-web-dom-utils.c | 3 +++ - 1 file changed, 3 insertions(+) - -commit 7992222e0f3ab1b1b46e29ed919abe994adfb962 -Author: Michael Catanzaro -Date: Sun Jan 24 22:16:35 2016 -0600 - - web-dom-utils: Add a FIXME comment - - lib/ephy-web-dom-utils.c | 3 +++ - 1 file changed, 3 insertions(+) - -commit 46ee95ba2bacbb5106bbaf1e652ab04fdd25dd6b -Author: Michael Catanzaro -Date: Sun Jan 24 22:11:45 2016 -0600 - - encoding-dialog: Placate -Wdiscarded-qualifiers - - src/ephy-encoding-dialog.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -commit 70ae1bb851c916af0005b28d739ce25b7a4247cd -Author: Michael Catanzaro -Date: Sun Jan 24 19:30:07 2016 -0600 - - web-view: Add an assertion - - An early return here leads to memory leaks. We should never hit this - because (a) we'd better have an error page for every error type, and (b) - if we don't there will be a compiler warning thanks to the new warning - flags. - - embed/ephy-web-view.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -commit a253d063ee4b6b87e65abcded14990a7d540949e -Author: Michael Catanzaro -Date: Sun Jan 24 18:22:25 2016 -0600 - - Clean the sass cache - - Mostly to get it out of my git status output - - src/Makefile.am | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -commit 7a7e4c43c25bdf37050a92fdbb92dcab785744f9 -Author: Balázs Meskó -Date: Sun Jan 24 12:59:31 2016 +0000 - - Updated Hungarian translation - - po/hu.po | 1166 +++++++++++++++++++++++++++++++++----------------------------- - 1 file changed, 619 insertions(+), 547 deletions(-) - -commit 28578843ab6633a4b8a9c29cf8443f315d17c7ee -Author: Michael Catanzaro -Date: Sat Jan 23 17:03:27 2016 -0600 - - web-view: Remove obsolete ifdefs - - We already require 2.11.4 - - embed/ephy-web-view.c | 4 ---- - 1 file changed, 4 deletions(-) - -commit 53a6683661fec779820e1076be0ac85997e2a328 -Author: Michael Catanzaro -Date: Sat Jan 23 13:06:40 2016 -0600 - - Fixup for the previous commit - - Not sure how I missed all the warnings the previous commit - introduced.... - - embed/web-extension/ephy-web-extension-main.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) diff -Nru epiphany-browser-3.22.6/configure epiphany-browser-3.22.7/configure --- epiphany-browser-3.22.6/configure 2017-02-03 14:23:58.000000000 -0500 +++ epiphany-browser-3.22.7/configure 2017-03-19 17:21:15.000000000 -0400 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNOME Web Browser 3.22.6. +# Generated by GNU Autoconf 2.69 for GNOME Web Browser 3.22.7. # # Report bugs to . # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='GNOME Web Browser' PACKAGE_TARNAME='epiphany' -PACKAGE_VERSION='3.22.6' -PACKAGE_STRING='GNOME Web Browser 3.22.6' +PACKAGE_VERSION='3.22.7' +PACKAGE_STRING='GNOME Web Browser 3.22.7' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany' PACKAGE_URL='' @@ -1454,7 +1454,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNOME Web Browser 3.22.6 to adapt to many kinds of systems. +\`configure' configures GNOME Web Browser 3.22.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1524,7 +1524,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNOME Web Browser 3.22.6:";; + short | recursive ) echo "Configuration of GNOME Web Browser 3.22.7:";; esac cat <<\_ACEOF @@ -1672,7 +1672,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNOME Web Browser configure 3.22.6 +GNOME Web Browser configure 3.22.7 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2041,7 +2041,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNOME Web Browser $as_me 3.22.6, which was +It was created by GNOME Web Browser $as_me 3.22.7, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -6044,7 +6044,7 @@ # Define the identity of the package. PACKAGE='epiphany' - VERSION='3.22.6' + VERSION='3.22.7' cat >>confdefs.h <<_ACEOF @@ -17359,7 +17359,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNOME Web Browser $as_me 3.22.6, which was +This file was extended by GNOME Web Browser $as_me 3.22.7, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17425,7 +17425,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNOME Web Browser config.status 3.22.6 +GNOME Web Browser config.status 3.22.7 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru epiphany-browser-3.22.6/configure.ac epiphany-browser-3.22.7/configure.ac --- epiphany-browser-3.22.6/configure.ac 2017-02-03 14:23:28.000000000 -0500 +++ epiphany-browser-3.22.7/configure.ac 2017-03-19 17:20:21.000000000 -0400 @@ -16,7 +16,7 @@ m4_define([epiphany_version_major],[3]) m4_define([epiphany_version_minor],[22]) -m4_define([epiphany_version_micro],[6]) +m4_define([epiphany_version_micro],[7]) m4_define([epiphany_version],[epiphany_version_major.epiphany_version_minor.epiphany_version_micro]) AC_INIT([GNOME Web Browser],[epiphany_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany]) diff -Nru epiphany-browser-3.22.6/debian/changelog epiphany-browser-3.22.7/debian/changelog --- epiphany-browser-3.22.6/debian/changelog 2017-02-04 15:20:17.000000000 -0500 +++ epiphany-browser-3.22.7/debian/changelog 2017-03-19 18:08:09.000000000 -0400 @@ -1,3 +1,9 @@ +epiphany-browser (3.22.7-1) unstable; urgency=medium + + * New upstream release. + + -- Michael Biebl Sun, 19 Mar 2017 23:08:09 +0100 + epiphany-browser (3.22.6-1) unstable; urgency=medium * New upstream release. diff -Nru epiphany-browser-3.22.6/debian/patches/00_epiphany-browser.patch epiphany-browser-3.22.7/debian/patches/00_epiphany-browser.patch --- epiphany-browser-3.22.6/debian/patches/00_epiphany-browser.patch 2017-02-04 15:11:43.000000000 -0500 +++ epiphany-browser-3.22.7/debian/patches/00_epiphany-browser.patch 2017-03-19 18:04:34.000000000 -0400 @@ -3,7 +3,7 @@ --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ - m4_define([epiphany_version_micro],[6]) + m4_define([epiphany_version_micro],[7]) m4_define([epiphany_version],[epiphany_version_major.epiphany_version_minor.epiphany_version_micro]) -AC_INIT([GNOME Web Browser],[epiphany_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=epiphany],[epiphany]) diff -Nru epiphany-browser-3.22.6/embed/ephy-embed.c epiphany-browser-3.22.7/embed/ephy-embed.c --- epiphany-browser-3.22.6/embed/ephy-embed.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/embed/ephy-embed.c 2017-03-19 17:17:31.000000000 -0400 @@ -219,15 +219,6 @@ } static void -ephy_embed_destroy_top_widgets (EphyEmbed *embed) -{ - GSList *iter; - - for (iter = embed->destroy_on_transition_list; iter; iter = iter->next) - gtk_widget_destroy (GTK_WIDGET (iter->data)); -} - -static void remove_from_destroy_list_cb (GtkWidget *widget, EphyEmbed *embed) { GSList *list; @@ -238,6 +229,19 @@ } static void +ephy_embed_destroy_top_widgets (EphyEmbed *embed) +{ + GSList *iter; + + for (iter = embed->destroy_on_transition_list; iter; iter = iter->next) { + g_signal_handlers_disconnect_by_func (iter->data, remove_from_destroy_list_cb, embed); + gtk_widget_destroy (GTK_WIDGET (iter->data)); + } + + embed->destroy_on_transition_list = NULL; +} + +static void ephy_embed_set_title (EphyEmbed *embed, const char *title) { diff -Nru epiphany-browser-3.22.6/embed/ephy-embed-shell.c epiphany-browser-3.22.7/embed/ephy-embed-shell.c --- epiphany-browser-3.22.6/embed/ephy-embed-shell.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/embed/ephy-embed-shell.c 2017-03-19 17:17:31.000000000 -0400 @@ -343,7 +343,8 @@ static void delayed_thumbnail_update_data_free (DelayedThumbnailUpdateData *data) { - g_object_remove_weak_pointer (G_OBJECT (data->extension), (gpointer *)&data->extension); + if (data->extension) + g_object_remove_weak_pointer (G_OBJECT (data->extension), (gpointer *)&data->extension); g_free (data->url); g_free (data->path); g_free (data); @@ -452,10 +453,16 @@ if (priv->global_history_service == NULL) { char *filename; + EphySQLiteConnectionMode mode; + + if (priv->mode == EPHY_EMBED_SHELL_MODE_INCOGNITO || + priv->mode == EPHY_EMBED_SHELL_MODE_SEARCH_PROVIDER) + mode = EPHY_SQLITE_CONNECTION_MODE_READ_ONLY; + else + mode = EPHY_SQLITE_CONNECTION_MODE_READWRITE; filename = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL); - priv->global_history_service = ephy_history_service_new (filename, - priv->mode == EPHY_EMBED_SHELL_MODE_INCOGNITO); + priv->global_history_service = ephy_history_service_new (filename, mode); g_free (filename); g_return_val_if_fail (priv->global_history_service, NULL); g_signal_connect (priv->global_history_service, "urls-visited", diff -Nru epiphany-browser-3.22.6/embed/ephy-web-view.c epiphany-browser-3.22.7/embed/ephy-web-view.c --- epiphany-browser-3.22.6/embed/ephy-web-view.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/embed/ephy-web-view.c 2017-03-19 17:17:31.000000000 -0400 @@ -1275,7 +1275,7 @@ const char *host) { PermissionRequestData *data; - data = g_new (PermissionRequestData, 1); + data = g_slice_new (PermissionRequestData); data->web_view = web_view; /* Ref the decision to keep it alive while we decide */ data->request = g_object_ref (request); diff -Nru epiphany-browser-3.22.6/lib/ephy-profile-migrator.c epiphany-browser-3.22.7/lib/ephy-profile-migrator.c --- epiphany-browser-3.22.6/lib/ephy-profile-migrator.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/ephy-profile-migrator.c 2017-03-19 17:17:31.000000000 -0400 @@ -492,7 +492,7 @@ GError *error = NULL; filename = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL); - history_database = ephy_sqlite_connection_new (); + history_database = ephy_sqlite_connection_new (EPHY_SQLITE_CONNECTION_MODE_READWRITE); ephy_sqlite_connection_open (history_database, filename, &error); if (error) { diff -Nru epiphany-browser-3.22.6/lib/ephy-snapshot-service.c epiphany-browser-3.22.7/lib/ephy-snapshot-service.c --- epiphany-browser-3.22.6/lib/ephy-snapshot-service.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/ephy-snapshot-service.c 2017-03-19 17:17:31.000000000 -0400 @@ -565,6 +565,23 @@ g_object_unref (task); } +static void +take_fresh_snapshot_in_background_if_stale (EphySnapshotService *service, + SnapshotAsyncData *data) +{ + GTask *task; + + /* We schedule a new snapshot now, which will complete eventually. It won't be + * used now. This is just to ensure we get a newer snapshot in the future. */ + if (ephy_snapshot_service_lookup_snapshot_freshness (service, data->url) == SNAPSHOT_STALE) { + task = g_task_new (service, NULL, NULL, NULL); + g_task_set_task_data (task, + data, + (GDestroyNotify)snapshot_async_data_free); + ephy_snapshot_service_take_from_webview (task); + } +} + char * ephy_snapshot_service_get_snapshot_path_for_url_finish (EphySnapshotService *service, GAsyncResult *result, @@ -585,20 +602,12 @@ path = ephy_snapshot_service_get_snapshot_path_for_url_finish (service, result, NULL); if (path) { + take_fresh_snapshot_in_background_if_stale (service, snapshot_async_data_copy (data)); g_task_return_pointer (task, path, g_free); g_object_unref (task); - - if (ephy_snapshot_service_lookup_snapshot_freshness (service, data->url) == SNAPSHOT_FRESH) - return; - - /* Take a fresh snapshot in the background. */ - task = g_task_new (service, NULL, NULL, NULL); - g_task_set_task_data (task, - snapshot_async_data_copy (data), - (GDestroyNotify)snapshot_async_data_free); + } else { + ephy_snapshot_service_take_from_webview (task); } - - ephy_snapshot_service_take_from_webview (task); } void @@ -623,6 +632,8 @@ path = ephy_snapshot_service_lookup_cached_snapshot_path (service, uri); if (path) { + take_fresh_snapshot_in_background_if_stale (service, + snapshot_async_data_new (service, NULL, web_view, mtime, uri)); g_task_return_pointer (task, g_strdup (path), g_free); g_object_unref (task); } else { diff -Nru epiphany-browser-3.22.6/lib/ephy-sqlite-connection.c epiphany-browser-3.22.7/lib/ephy-sqlite-connection.c --- epiphany-browser-3.22.6/lib/ephy-sqlite-connection.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/ephy-sqlite-connection.c 2017-03-19 17:17:31.000000000 -0400 @@ -18,15 +18,27 @@ #include "config.h" #include "ephy-sqlite-connection.h" +#include "ephy-lib-type-builtins.h" + #include struct _EphySQLiteConnection { GObject parent_instance; + sqlite3 *database; + EphySQLiteConnectionMode mode; }; G_DEFINE_TYPE (EphySQLiteConnection, ephy_sqlite_connection, G_TYPE_OBJECT); +enum { + PROP_0, + PROP_MODE, + LAST_PROP +}; + +static GParamSpec *obj_properties[LAST_PROP]; + static void ephy_sqlite_connection_finalize (GObject *self) { @@ -35,10 +47,40 @@ } static void +ephy_sqlite_connection_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + EphySQLiteConnection *self = EPHY_SQLITE_CONNECTION (object); + + switch (property_id) { + case PROP_MODE: + self->mode = g_value_get_enum (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (self, property_id, pspec); + break; + } +} + +static void ephy_sqlite_connection_class_init (EphySQLiteConnectionClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->finalize = ephy_sqlite_connection_finalize; + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + + gobject_class->finalize = ephy_sqlite_connection_finalize; + gobject_class->set_property = ephy_sqlite_connection_set_property; + + obj_properties[PROP_MODE] = + g_param_spec_enum ("mode", + "SQLite connection mode", + "Whether the SQLite connection is read-only or writable", + EPHY_TYPE_SQ_LITE_CONNECTION_MODE, + EPHY_SQLITE_CONNECTION_MODE_READWRITE, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS); + + g_object_class_install_properties (gobject_class, LAST_PROP, obj_properties); } static void @@ -47,7 +89,7 @@ self->database = NULL; } -static GQuark get_ephy_sqlite_quark (void) +GQuark ephy_sqlite_error_quark (void) { return g_quark_from_static_string ("ephy-sqlite"); } @@ -56,13 +98,15 @@ set_error_from_string (const char *string, GError **error) { if (error) - *error = g_error_new_literal (get_ephy_sqlite_quark (), 0, string); + *error = g_error_new_literal (ephy_sqlite_error_quark (), 0, string); } EphySQLiteConnection * -ephy_sqlite_connection_new (void) +ephy_sqlite_connection_new (EphySQLiteConnectionMode mode) { - return EPHY_SQLITE_CONNECTION (g_object_new (EPHY_TYPE_SQLITE_CONNECTION, NULL)); + return EPHY_SQLITE_CONNECTION (g_object_new (EPHY_TYPE_SQLITE_CONNECTION, + "mode", mode, + NULL)); } gboolean @@ -73,7 +117,11 @@ return FALSE; } - if (sqlite3_open (filename, &self->database) != SQLITE_OK) { + if (sqlite3_open_v2 (filename, + &self->database, + self->mode == EPHY_SQLITE_CONNECTION_MODE_READ_ONLY ? SQLITE_OPEN_READONLY + : SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, + NULL) != SQLITE_OK) { ephy_sqlite_connection_get_error (self, error); self->database = NULL; return FALSE; @@ -95,7 +143,7 @@ ephy_sqlite_connection_get_error (EphySQLiteConnection *self, GError **error) { if (error) - *error = g_error_new_literal (get_ephy_sqlite_quark (), 0, sqlite3_errmsg (self->database)); + *error = g_error_new_literal (ephy_sqlite_error_quark (), sqlite3_errcode (self->database), sqlite3_errmsg (self->database)); } gboolean @@ -106,7 +154,11 @@ return FALSE; } - return sqlite3_exec (self->database, sql, NULL, NULL, NULL) == SQLITE_OK; + if (sqlite3_exec (self->database, sql, NULL, NULL, NULL) != SQLITE_OK) { + ephy_sqlite_connection_get_error (self, error); + return FALSE; + } + return TRUE; } EphySQLiteStatement * @@ -139,18 +191,24 @@ gboolean ephy_sqlite_connection_begin_transaction (EphySQLiteConnection *self, GError **error) { + if (self->mode == EPHY_SQLITE_CONNECTION_MODE_READ_ONLY) + return TRUE; return ephy_sqlite_connection_execute (self, "BEGIN TRANSACTION", error); } gboolean ephy_sqlite_connection_rollback_transaction (EphySQLiteConnection *self, GError **error) { + if (self->mode == EPHY_SQLITE_CONNECTION_MODE_READ_ONLY) + return TRUE; return ephy_sqlite_connection_execute (self, "ROLLBACK", error); } gboolean ephy_sqlite_connection_commit_transaction (EphySQLiteConnection *self, GError **error) { + if (self->mode == EPHY_SQLITE_CONNECTION_MODE_READ_ONLY) + return TRUE; return ephy_sqlite_connection_execute (self, "COMMIT", error); } diff -Nru epiphany-browser-3.22.6/lib/ephy-sqlite-connection.h epiphany-browser-3.22.7/lib/ephy-sqlite-connection.h --- epiphany-browser-3.22.6/lib/ephy-sqlite-connection.h 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/ephy-sqlite-connection.h 2017-03-19 17:17:31.000000000 -0400 @@ -21,13 +21,20 @@ #include #include "ephy-sqlite-statement.h" +#include + G_BEGIN_DECLS #define EPHY_TYPE_SQLITE_CONNECTION (ephy_sqlite_connection_get_type ()) G_DECLARE_FINAL_TYPE (EphySQLiteConnection, ephy_sqlite_connection, EPHY, SQLITE_CONNECTION, GObject) -EphySQLiteConnection * ephy_sqlite_connection_new (void); +typedef enum { + EPHY_SQLITE_CONNECTION_MODE_READ_ONLY, + EPHY_SQLITE_CONNECTION_MODE_READWRITE +} EphySQLiteConnectionMode; + +EphySQLiteConnection * ephy_sqlite_connection_new (EphySQLiteConnectionMode mode); gboolean ephy_sqlite_connection_open (EphySQLiteConnection *self, const gchar *filename, GError **error); void ephy_sqlite_connection_close (EphySQLiteConnection *self); @@ -44,6 +51,10 @@ gboolean ephy_sqlite_connection_table_exists (EphySQLiteConnection *self, const char *table_name); +GQuark ephy_sqlite_error_quark (void); + +#define EPHY_SQLITE_ERROR ephy_sqlite_error_quark () + G_END_DECLS #endif /* EPHY_SQLITE_CONNECTION_H */ diff -Nru epiphany-browser-3.22.6/lib/history/ephy-history-service.c epiphany-browser-3.22.7/lib/history/ephy-history-service.c --- epiphany-browser-3.22.6/lib/history/ephy-history-service.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/history/ephy-history-service.c 2017-03-19 17:17:31.000000000 -0400 @@ -152,6 +152,36 @@ G_OBJECT_CLASS (ephy_history_service_parent_class)->dispose (object); } +static void +ephy_history_service_constructed (GObject *object) +{ + EphyHistoryService *self = EPHY_HISTORY_SERVICE (object); + + G_OBJECT_CLASS (ephy_history_service_parent_class)->constructed (object); + + self->queue = g_async_queue_new (); + + /* This value is checked in several functions to verify that they are only + * ever run on the history thread. Accordingly, we'd better be sure it's set + * before it is checked for the first time. That requires a lock here. */ + g_mutex_lock (&self->history_thread_mutex); + self->history_thread = g_thread_new ("EphyHistoryService", (GThreadFunc)run_history_service_thread, self); + + /* Additionally, make sure the SQLite connection has really been opened before + * returning. We need this so that we can test that using a read-only service + * at the same time as a read/write service does not cause the read/write + * service to break. This delay is required because we need to be sure the + * read/write service has completed initialization before attempting to open + * the read-only service, or initializing the read-only service will fail. + * This isn't needed except in test mode, because only tests might run + * multiple history services, but it's harmless and cleaner to do always. + */ + while (!self->history_thread_initialized) + g_cond_wait (&self->history_thread_initialized_condition, &self->history_thread_mutex); + + g_mutex_unlock (&self->history_thread_mutex); +} + static gboolean emit_urls_visited (EphyHistoryService *self) { @@ -178,6 +208,7 @@ gobject_class->finalize = ephy_history_service_finalize; gobject_class->dispose = ephy_history_service_dispose; + gobject_class->constructed = ephy_history_service_constructed; gobject_class->get_property = ephy_history_service_get_property; gobject_class->set_property = ephy_history_service_set_property; @@ -265,17 +296,15 @@ static void ephy_history_service_init (EphyHistoryService *self) { - self->history_thread = g_thread_new ("EphyHistoryService", (GThreadFunc)run_history_service_thread, self); - self->queue = g_async_queue_new (); } EphyHistoryService * -ephy_history_service_new (const char *history_filename, - gboolean read_only) +ephy_history_service_new (const char *history_filename, + EphySQLiteConnectionMode mode) { return EPHY_HISTORY_SERVICE (g_object_new (EPHY_TYPE_HISTORY_SERVICE, "history-filename", history_filename, - "read-only", read_only, + "read-only", mode == EPHY_SQLITE_CONNECTION_MODE_READ_ONLY, NULL)); } @@ -326,29 +355,37 @@ } static void -ephy_history_service_commit (EphyHistoryService *self) +ephy_history_service_open_transaction (EphyHistoryService *self) { GError *error = NULL; g_assert (self->history_thread == g_thread_self ()); - if (NULL == self->history_database) + if (self->history_database == NULL || + self->read_only) return; - if (self->read_only) + ephy_sqlite_connection_begin_transaction (self->history_database, &error); + if (error != NULL) { + g_warning ("Could not open history database transaction: %s", error->message); + g_error_free (error); + } +} + +static void +ephy_history_service_commit_transaction (EphyHistoryService *self) +{ + GError *error = NULL; + g_assert (self->history_thread == g_thread_self ()); + + if (self->history_database == NULL || + self->read_only) return; ephy_sqlite_connection_commit_transaction (self->history_database, &error); - if (NULL != error) { - g_warning ("Could not commit idle history database transaction: %s", error->message); - g_error_free (error); - } - ephy_sqlite_connection_begin_transaction (self->history_database, &error); - if (NULL != error) { - g_warning ("Could not start long-running history database transaction: %s", error->message); + if (error != NULL) { + g_warning ("Could not commit history database transaction: %s", error->message); g_error_free (error); } - - self->scheduled_to_commit = FALSE; } static void @@ -356,7 +393,7 @@ { GError *error = NULL; - if (NULL == self->history_database) + if (self->history_database == NULL) return; ephy_sqlite_connection_execute (self->history_database, @@ -375,31 +412,33 @@ g_assert (self->history_thread == g_thread_self ()); - self->history_database = ephy_sqlite_connection_new (); + if (self->history_database != NULL) + g_object_unref (self->history_database); + + self->history_database = ephy_sqlite_connection_new (self->read_only ? EPHY_SQLITE_CONNECTION_MODE_READ_ONLY + : EPHY_SQLITE_CONNECTION_MODE_READWRITE); ephy_sqlite_connection_open (self->history_database, self->history_filename, &error); if (error) { g_object_unref (self->history_database); self->history_database = NULL; - g_warning ("Could not open history database at %s: %s", self->history_filename, error->message); - g_error_free (error); - return FALSE; - } - - ephy_history_service_enable_foreign_keys (self); - ephy_sqlite_connection_begin_transaction (self->history_database, &error); - if (error) { - g_warning ("Could not begin long running transaction in history database: %s", error->message); + /* Opening the database is expected to fail if it's being opened in read- + * only mode and does not already exist. Otherwise, this is bad. */ + if (!self->read_only || + !g_error_matches (error, EPHY_SQLITE_ERROR, SQLITE_CANTOPEN) || + g_file_test (self->history_filename, G_FILE_TEST_EXISTS)) { + g_warning ("Could not open history database at %s: %s", self->history_filename, error->message); + } g_error_free (error); return FALSE; } - if (ephy_history_service_initialize_hosts_table (self) == FALSE || - ephy_history_service_initialize_urls_table (self) == FALSE || - ephy_history_service_initialize_visits_table (self) == FALSE) - return FALSE; + ephy_history_service_enable_foreign_keys (self); - return TRUE; + return self->read_only || + (ephy_history_service_initialize_hosts_table (self) && + ephy_history_service_initialize_urls_table (self) && + ephy_history_service_initialize_visits_table (self)); } static void @@ -412,57 +451,11 @@ self->history_database = NULL; } -static void -ephy_history_service_clear_all (EphyHistoryService *self) -{ - char *journal_filename; - - if (self->history_database == NULL) - return; - - if (self->read_only) - return; - - ephy_sqlite_connection_close (self->history_database); - - if (g_unlink (self->history_filename) == -1) - g_warning ("Failed to delete %s: %s", self->history_filename, g_strerror (errno)); - - journal_filename = g_strdup_printf ("%s-journal", self->history_filename); - if (g_unlink (journal_filename) == -1 && errno != ENOENT) - g_warning ("Failed to delete %s: %s", journal_filename, g_strerror (errno)); - g_free (journal_filename); - - ephy_history_service_open_database_connections (self); -} - -static gboolean -ephy_history_service_is_scheduled_to_quit (EphyHistoryService *self) -{ - return self->scheduled_to_quit; -} - -static gboolean -ephy_history_service_is_scheduled_to_commit (EphyHistoryService *self) -{ - return self->scheduled_to_commit; -} - -void -ephy_history_service_schedule_commit (EphyHistoryService *self) -{ - if (!self->read_only) - self->scheduled_to_commit = TRUE; -} - static gboolean ephy_history_service_execute_quit (EphyHistoryService *self, gpointer data, gpointer *result) { g_assert (self->history_thread == g_thread_self ()); - if (ephy_history_service_is_scheduled_to_commit (self)) - ephy_history_service_commit (self); - g_async_queue_unref (self->queue); self->scheduled_to_quit = TRUE; @@ -474,26 +467,35 @@ run_history_service_thread (EphyHistoryService *self) { EphyHistoryServiceMessage *message; + gboolean success; + /* Note that self->history_thread is only written once, and that's guaranteed + * to have occurred before we enter this critical section due to this mutex. + * Accordingly, we do not need to use the mutex when performing these + * assertions in other functions. + */ + g_mutex_lock (&self->history_thread_mutex); g_assert (self->history_thread == g_thread_self ()); - if (ephy_history_service_open_database_connections (self) == FALSE) + success = ephy_history_service_open_database_connections (self); + + self->history_thread_initialized = TRUE; + g_cond_signal (&self->history_thread_initialized_condition); + g_mutex_unlock (&self->history_thread_mutex); + + if (!success) return NULL; do { message = g_async_queue_try_pop (self->queue); if (!message) { - /* Schedule commit if needed. */ - if (ephy_history_service_is_scheduled_to_commit (self)) - ephy_history_service_commit (self); - /* Block the thread until there's data in the queue. */ message = g_async_queue_pop (self->queue); } /* Process item. */ ephy_history_service_process_message (self, message); - } while (!ephy_history_service_is_scheduled_to_quit (self)); + } while (!self->scheduled_to_quit); ephy_history_service_close_database_connections (self); @@ -571,7 +573,7 @@ ephy_history_service_update_host_row (self, visit->url->host); /* A NULL return here means that the URL does not yet exist in the database */ - if (NULL == ephy_history_service_get_url_row (self, visit->url->url, visit->url)) { + if (ephy_history_service_get_url_row (self, visit->url->url, visit->url) == NULL) { visit->url->last_visit_time = visit->visit_time; visit->url->visit_count = 1; @@ -621,8 +623,6 @@ visits = visits->next; } - ephy_history_service_schedule_commit (self); - return success; } @@ -635,7 +635,7 @@ /* FIXME: We don't have a good way to tell the difference between failures and empty returns */ while (current) { EphyHistoryPageVisit *visit = (EphyHistoryPageVisit *)current->data; - if (NULL == ephy_history_service_get_url_row (self, NULL, visit->url)) { + if (ephy_history_service_get_url_row (self, NULL, visit->url) == NULL) { ephy_history_page_visit_list_free (visits); g_warning ("Tried to process an orphaned page visit"); return FALSE; @@ -808,7 +808,7 @@ if (self->read_only) return FALSE; - if (NULL == ephy_history_service_get_url_row (self, NULL, url)) { + if (ephy_history_service_get_url_row (self, NULL, url) == NULL) { /* The URL is not yet in the database, so we can't update it.. */ g_free (title); return FALSE; @@ -818,7 +818,6 @@ g_free (url->title); url->title = title; ephy_history_service_update_url_row (self, url); - ephy_history_service_schedule_commit (self); ctx = signal_emission_context_new (self, ephy_history_url_copy (url), @@ -874,7 +873,6 @@ host->zoom_level = zoom_level; ephy_history_service_update_host_row (self, host); - ephy_history_service_schedule_commit (self); return TRUE; } @@ -913,13 +911,12 @@ hidden = url->hidden; - if (NULL == ephy_history_service_get_url_row (self, NULL, url)) { + if (ephy_history_service_get_url_row (self, NULL, url) == NULL) { /* The URL is not yet in the database, so we can't update it.. */ return FALSE; } else { url->hidden = hidden; ephy_history_service_update_url_row (self, url); - ephy_history_service_schedule_commit (self); return TRUE; } } @@ -959,12 +956,11 @@ thumbnail_time = url->thumbnail_time; - if (NULL == ephy_history_service_get_url_row (self, NULL, url)) + if (ephy_history_service_get_url_row (self, NULL, url) == NULL) return FALSE; else { url->thumbnail_time = thumbnail_time; ephy_history_service_update_url_row (self, url); - ephy_history_service_schedule_commit (self); return TRUE; } } @@ -1091,7 +1087,6 @@ } ephy_history_service_delete_orphan_hosts (self); - ephy_history_service_schedule_commit (self); return TRUE; } @@ -1118,7 +1113,6 @@ return FALSE; ephy_history_service_delete_host_row (self, host); - ephy_history_service_schedule_commit (self); ctx = signal_emission_context_new (self, g_strdup (host->url), (GDestroyNotify)g_free); @@ -1135,11 +1129,25 @@ gpointer pointer, gpointer *result) { - if (self->read_only) + char *journal_filename; + + if (self->history_database == NULL || + self->read_only) return FALSE; - ephy_history_service_clear_all (self); - ephy_history_service_schedule_commit (self); + ephy_history_service_commit_transaction (self); + ephy_sqlite_connection_close (self->history_database); + + if (g_unlink (self->history_filename) == -1) + g_warning ("Failed to delete %s: %s", self->history_filename, g_strerror (errno)); + + journal_filename = g_strdup_printf ("%s-journal", self->history_filename); + if (g_unlink (journal_filename) == -1 && errno != ENOENT) + g_warning ("Failed to delete %s: %s", journal_filename, g_strerror (errno)); + g_free (journal_filename); + + ephy_history_service_open_database_connections (self); + ephy_history_service_open_transaction (self); return TRUE; } @@ -1245,10 +1253,13 @@ method = methods[message->type]; message->result = NULL; - if (message->service->history_database) + if (message->service->history_database) { + ephy_history_service_open_transaction (self); message->success = method (message->service, message->method_argument, &message->result); - else + ephy_history_service_commit_transaction (self); + } else { message->success = FALSE; + } if (message->callback || message->type == CLEAR) g_idle_add ((GSourceFunc)ephy_history_service_execute_job_callback, message); diff -Nru epiphany-browser-3.22.6/lib/history/ephy-history-service.h epiphany-browser-3.22.7/lib/history/ephy-history-service.h --- epiphany-browser-3.22.6/lib/history/ephy-history-service.h 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/history/ephy-history-service.h 2017-03-19 17:17:31.000000000 -0400 @@ -22,7 +22,9 @@ #include #include + #include "ephy-history-types.h" +#include "ephy-sqlite-connection.h" G_BEGIN_DECLS @@ -32,7 +34,7 @@ typedef void (*EphyHistoryJobCallback) (EphyHistoryService *service, gboolean success, gpointer result_data, gpointer user_data); -EphyHistoryService * ephy_history_service_new (const char *history_filename, gboolean read_only); +EphyHistoryService * ephy_history_service_new (const char *history_filename, EphySQLiteConnectionMode mode); void ephy_history_service_add_visit (EphyHistoryService *self, EphyHistoryPageVisit *visit, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); void ephy_history_service_add_visits (EphyHistoryService *self, GList *visits, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); diff -Nru epiphany-browser-3.22.6/lib/history/ephy-history-service-hosts-table.c epiphany-browser-3.22.7/lib/history/ephy-history-service-hosts-table.c --- epiphany-browser-3.22.6/lib/history/ephy-history-service-hosts-table.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/history/ephy-history-service-hosts-table.c 2017-03-19 17:17:31.000000000 -0400 @@ -45,7 +45,6 @@ g_error_free (error); return FALSE; } - ephy_history_service_schedule_commit (self); return TRUE; } @@ -409,7 +408,8 @@ if (host == NULL) { host = ephy_history_host_new (host_locations->data, hostname, 0, 1.0); - ephy_history_service_add_host_row (self, host); + if (!self->read_only) + ephy_history_service_add_host_row (self, host); } g_free (hostname); @@ -423,7 +423,7 @@ EphyHistoryHost *host) { EphySQLiteStatement *statement = NULL; - gchar *sql_statement; + const char *sql_statement; GError *error = NULL; g_assert (self->history_thread == g_thread_self ()); @@ -432,13 +432,12 @@ g_assert (host->id != -1 || host->url); if (host->id != -1) - sql_statement = g_strdup ("DELETE FROM hosts WHERE id=?"); + sql_statement = "DELETE FROM hosts WHERE id=?"; else - sql_statement = g_strdup ("DELETE FROM hosts WHERE url=?"); + sql_statement = "DELETE FROM hosts WHERE url=?"; statement = ephy_sqlite_connection_create_statement (self->history_database, sql_statement, &error); - g_free (sql_statement); if (error) { g_warning ("Could not build urls table query statement: %s", error->message); diff -Nru epiphany-browser-3.22.6/lib/history/ephy-history-service-private.h epiphany-browser-3.22.7/lib/history/ephy-history-service-private.h --- epiphany-browser-3.22.6/lib/history/ephy-history-service-private.h 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/history/ephy-history-service-private.h 2017-03-19 17:17:31.000000000 -0400 @@ -25,15 +25,16 @@ GObject parent_instance; char *history_filename; EphySQLiteConnection *history_database; + GMutex history_thread_mutex; + gboolean history_thread_initialized; + GCond history_thread_initialized_condition; GThread *history_thread; GAsyncQueue *queue; gboolean scheduled_to_quit; - gboolean scheduled_to_commit; gboolean read_only; int queue_urls_visited_id; }; -void ephy_history_service_schedule_commit (EphyHistoryService *self); gboolean ephy_history_service_initialize_urls_table (EphyHistoryService *self); EphyHistoryURL * ephy_history_service_get_url_row (EphyHistoryService *self, const char *url_string, EphyHistoryURL *url); void ephy_history_service_add_url_row (EphyHistoryService *self, EphyHistoryURL *url); diff -Nru epiphany-browser-3.22.6/lib/history/ephy-history-service-urls-table.c epiphany-browser-3.22.7/lib/history/ephy-history-service-urls-table.c --- epiphany-browser-3.22.6/lib/history/ephy-history-service-urls-table.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/history/ephy-history-service-urls-table.c 2017-03-19 17:17:31.000000000 -0400 @@ -47,7 +47,6 @@ g_error_free (error); return FALSE; } - ephy_history_service_schedule_commit (self); return TRUE; } @@ -388,7 +387,7 @@ ephy_history_service_delete_url (EphyHistoryService *self, EphyHistoryURL *url) { EphySQLiteStatement *statement = NULL; - gchar *sql_statement; + const char *sql_statement; GError *error = NULL; g_assert (self->history_thread == g_thread_self ()); @@ -397,13 +396,12 @@ g_return_if_fail (url->id != -1 || url->url); if (url->id != -1) - sql_statement = g_strdup ("DELETE FROM urls WHERE id=?"); + sql_statement = "DELETE FROM urls WHERE id=?"; else - sql_statement = g_strdup ("DELETE FROM urls WHERE url=?"); + sql_statement = "DELETE FROM urls WHERE url=?"; statement = ephy_sqlite_connection_create_statement (self->history_database, sql_statement, &error); - g_free (sql_statement); if (error) { g_warning ("Could not build urls table query statement: %s", error->message); diff -Nru epiphany-browser-3.22.6/lib/history/ephy-history-service-visits-table.c epiphany-browser-3.22.7/lib/history/ephy-history-service-visits-table.c --- epiphany-browser-3.22.6/lib/history/ephy-history-service-visits-table.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/history/ephy-history-service-visits-table.c 2017-03-19 17:17:31.000000000 -0400 @@ -41,7 +41,7 @@ g_error_free (error); return FALSE; } - ephy_history_service_schedule_commit (self); + return TRUE; } @@ -81,7 +81,6 @@ visit->id = ephy_sqlite_connection_get_last_insert_id (self->history_database); } - ephy_history_service_schedule_commit (self); g_object_unref (statement); } diff -Nru epiphany-browser-3.22.6/lib/Makefile.am epiphany-browser-3.22.7/lib/Makefile.am --- epiphany-browser-3.22.6/lib/Makefile.am 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/Makefile.am 2017-03-19 17:17:31.000000000 -0400 @@ -8,7 +8,8 @@ TYPES_H_FILES = \ ephy-initial-state.h \ ephy-node.h \ - ephy-security-levels.h + ephy-security-levels.h \ + ephy-sqlite-connection.h libephymisc_la_SOURCES = \ ephy-dbus-util.c \ diff -Nru epiphany-browser-3.22.6/lib/Makefile.in epiphany-browser-3.22.7/lib/Makefile.in --- epiphany-browser-3.22.6/lib/Makefile.in 2017-02-03 14:23:59.000000000 -0500 +++ epiphany-browser-3.22.7/lib/Makefile.in 2017-03-19 17:21:16.000000000 -0400 @@ -456,7 +456,8 @@ TYPES_H_FILES = \ ephy-initial-state.h \ ephy-node.h \ - ephy-security-levels.h + ephy-security-levels.h \ + ephy-sqlite-connection.h libephymisc_la_SOURCES = \ ephy-dbus-util.c \ diff -Nru epiphany-browser-3.22.6/lib/widgets/ephy-downloads-popover.c epiphany-browser-3.22.7/lib/widgets/ephy-downloads-popover.c --- epiphany-browser-3.22.6/lib/widgets/ephy-downloads-popover.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/lib/widgets/ephy-downloads-popover.c 2017-03-19 17:17:31.000000000 -0400 @@ -75,12 +75,12 @@ GtkWidget *widget; widget = ephy_download_widget_new (download); - g_signal_connect_swapped (download, "completed", - G_CALLBACK (download_completed_cb), - popover); - g_signal_connect_swapped (download, "error", - G_CALLBACK (download_failed_cb), - popover); + g_signal_connect_object (download, "completed", + G_CALLBACK (download_completed_cb), + popover, G_CONNECT_SWAPPED); + g_signal_connect_object (download, "error", + G_CALLBACK (download_failed_cb), + popover, G_CONNECT_SWAPPED); gtk_list_box_prepend (GTK_LIST_BOX (popover->downloads_box), widget); gtk_widget_show (widget); } @@ -192,12 +192,12 @@ EphyDownload *download = (EphyDownload *)l->data; GtkWidget *widget; - g_signal_connect_swapped (download, "completed", - G_CALLBACK (download_completed_cb), - popover); - g_signal_connect_swapped (download, "error", - G_CALLBACK (download_failed_cb), - popover); + g_signal_connect_object (download, "completed", + G_CALLBACK (download_completed_cb), + popover, G_CONNECT_SWAPPED); + g_signal_connect_object (download, "error", + G_CALLBACK (download_failed_cb), + popover, G_CONNECT_SWAPPED); widget = ephy_download_widget_new (download); gtk_list_box_prepend (GTK_LIST_BOX (popover->downloads_box), widget); diff -Nru epiphany-browser-3.22.6/NEWS epiphany-browser-3.22.7/NEWS --- epiphany-browser-3.22.6/NEWS 2017-02-03 14:23:22.000000000 -0500 +++ epiphany-browser-3.22.7/NEWS 2017-03-19 17:20:17.000000000 -0400 @@ -1,4 +1,14 @@ =============== +Epiphany 3.22.7 +=============== + +- Fix history often not being saved (#778649) +- Fix crash related to downloads popover (#778659) +- Fix memory corruption issues involving permissions requests (#779180) +- Fix snapshot service not saving new snapshots +- Fix critical warnings related to snapshot service + +=============== Epiphany 3.22.6 =============== diff -Nru epiphany-browser-3.22.6/src/ephy-search-provider.c epiphany-browser-3.22.7/src/ephy-search-provider.c --- epiphany-browser-3.22.6/src/ephy-search-provider.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/src/ephy-search-provider.c 2017-03-19 17:17:31.000000000 -0400 @@ -20,6 +20,7 @@ #include "ephy-search-provider.h" #include "ephy-completion-model.h" +#include "ephy-embed-shell.h" #include "ephy-file-helpers.h" #include "ephy-prefs.h" #include "ephy-profile-utils.h" @@ -37,7 +38,6 @@ GCancellable *cancellable; GSettings *settings; - EphyHistoryService *history_service; EphyBookmarks *bookmarks; EphyCompletionModel *model; }; @@ -345,6 +345,7 @@ ephy_search_provider_init (EphySearchProvider *self) { char *filename; + EphyEmbedShell *shell = ephy_embed_shell_get_default (); g_application_set_flags (G_APPLICATION (self), G_APPLICATION_IS_SERVICE); @@ -364,9 +365,9 @@ self->settings = g_settings_new (EPHY_PREFS_SCHEMA); filename = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL); - self->history_service = ephy_history_service_new (filename, TRUE); self->bookmarks = ephy_bookmarks_new (); - self->model = ephy_completion_model_new (self->history_service, self->bookmarks); + self->model = ephy_completion_model_new (EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service (shell)), + self->bookmarks); g_free (filename); self->cancellable = g_cancellable_new (); @@ -425,7 +426,6 @@ g_clear_object (&self->settings); g_clear_object (&self->cancellable); g_clear_object (&self->model); - g_clear_object (&self->history_service); g_clear_object (&self->bookmarks); G_OBJECT_CLASS (ephy_search_provider_parent_class)->dispose (object); diff -Nru epiphany-browser-3.22.6/src/ephy-shell-search-provider-generated.c epiphany-browser-3.22.7/src/ephy-shell-search-provider-generated.c --- epiphany-browser-3.22.6/src/ephy-shell-search-provider-generated.c 2017-02-03 14:24:15.000000000 -0500 +++ epiphany-browser-3.22.7/src/ephy-shell-search-provider-generated.c 2017-03-19 17:21:34.000000000 -0400 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.51.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.51.4. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ @@ -1310,8 +1310,8 @@ GVariantIter iter; GVariant *child; GValue *paramv; - guint num_params; - guint n; + gsize num_params; + gsize n; guint signal_id; info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_ephy_shell_search_provider2_interface_info.parent_struct, signal_name); if (info == NULL) @@ -1627,9 +1627,9 @@ GVariantIter iter; GVariant *child; GValue *paramv; - guint num_params; + gsize num_params; guint num_extra; - guint n; + gsize n; guint signal_id; GValue return_value = G_VALUE_INIT; info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation); diff -Nru epiphany-browser-3.22.6/src/ephy-shell-search-provider-generated.h epiphany-browser-3.22.7/src/ephy-shell-search-provider-generated.h --- epiphany-browser-3.22.6/src/ephy-shell-search-provider-generated.h 2017-02-03 14:24:15.000000000 -0500 +++ epiphany-browser-3.22.7/src/ephy-shell-search-provider-generated.h 2017-03-19 17:21:34.000000000 -0400 @@ -1,5 +1,5 @@ /* - * Generated by gdbus-codegen 2.51.1. DO NOT EDIT. + * Generated by gdbus-codegen 2.51.4. DO NOT EDIT. * * The license of this code is the same as for the source it was derived from. */ diff -Nru epiphany-browser-3.22.6/tests/ephy-history-test.c epiphany-browser-3.22.7/tests/ephy-history-test.c --- epiphany-browser-3.22.6/tests/ephy-history-test.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/tests/ephy-history-test.c 2017-03-19 17:17:31.000000000 -0400 @@ -27,29 +27,19 @@ #include static EphyHistoryService * -ensure_empty_history (const char *filename, gboolean readonly) +ensure_empty_history (const char *filename) { if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) g_unlink (filename); - return ephy_history_service_new (filename, readonly); + return ephy_history_service_new (filename, EPHY_SQLITE_CONNECTION_MODE_READWRITE); } static void test_create_history_service (void) { gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, FALSE); - - g_free (temporary_file); - g_object_unref (service); -} - -static void -test_create_readonly_history_service (void) -{ - gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, TRUE); + EphyHistoryService *service = ensure_empty_history (temporary_file); g_free (temporary_file); g_object_unref (service); @@ -69,7 +59,7 @@ test_create_history_service_and_destroy_later (void) { gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, FALSE); + EphyHistoryService *service = ensure_empty_history (temporary_file); g_free (temporary_file); g_timeout_add (100, (GSourceFunc)destroy_history_service_and_end_main_loop, service); @@ -79,9 +69,12 @@ static void page_vist_created (EphyHistoryService *service, gboolean success, gpointer result_data, gpointer user_data) { + if (user_data != NULL) { + g_assert (EPHY_IS_HISTORY_SERVICE (user_data)); + g_object_unref (user_data); + } g_object_unref (service); g_assert (result_data == NULL); - g_assert (user_data == NULL); g_assert (success); gtk_main_quit (); } @@ -90,7 +83,7 @@ test_create_history_entry (void) { gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, FALSE); + EphyHistoryService *service = ensure_empty_history (temporary_file); EphyHistoryPageVisit *visit = ephy_history_page_visit_new ("http://www.gnome.org", 0, EPHY_PAGE_VISIT_TYPED); ephy_history_service_add_visit (service, visit, NULL, page_vist_created, NULL); @@ -100,6 +93,24 @@ gtk_main (); } +static void +test_readonly_mode (void) +{ + gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); + EphyHistoryService *service = ensure_empty_history (temporary_file); + EphyHistoryService *readonly_service = ephy_history_service_new (temporary_file, EPHY_SQLITE_CONNECTION_MODE_READ_ONLY); + + /* Having the database open read-only should not break normal connections. + * https://bugzilla.gnome.org/show_bug.cgi?id=778649 */ + EphyHistoryPageVisit *visit = ephy_history_page_visit_new ("http://www.gnome.org", 0, EPHY_PAGE_VISIT_TYPED); + ephy_history_service_add_visit (service, visit, NULL, page_vist_created, readonly_service); + ephy_history_page_visit_free (visit); + g_free (temporary_file); + + gtk_main (); +} + + static GList * create_test_page_visit_list (void) { @@ -163,7 +174,7 @@ test_create_history_entries (void) { gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, FALSE); + EphyHistoryService *service = ensure_empty_history (temporary_file); GList *visits = create_test_page_visit_list (); @@ -212,7 +223,7 @@ test_set_url_title_helper (gboolean test_results) { gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, FALSE); + EphyHistoryService *service = ensure_empty_history (temporary_file); EphyHistoryPageVisit *visit = ephy_history_page_visit_new ("http://www.gnome.org", 0, EPHY_PAGE_VISIT_TYPED); ephy_history_service_add_visit (service, visit, NULL, set_url_title_visit_created, GINT_TO_POINTER (test_results)); @@ -246,7 +257,7 @@ test_set_url_title_url_not_existent (void) { gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, FALSE); + EphyHistoryService *service = ensure_empty_history (temporary_file); g_free (temporary_file); ephy_history_service_set_url_title (service, "http://www.gnome.org", "GNOME", NULL, set_url_title_url_not_existent, NULL); @@ -288,7 +299,7 @@ test_get_url_helper (gboolean add_entry) { gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, FALSE); + EphyHistoryService *service = ensure_empty_history (temporary_file); g_free (temporary_file); if (add_entry == TRUE) { @@ -385,7 +396,7 @@ test_complex_url_query (void) { gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, FALSE); + EphyHistoryService *service = ensure_empty_history (temporary_file); GList *visits; visits = create_visits_for_complex_tests (); @@ -425,7 +436,7 @@ test_complex_url_query_with_time_range (void) { gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, FALSE); + EphyHistoryService *service = ensure_empty_history (temporary_file); GList *visits; visits = create_visits_for_complex_tests (); @@ -474,7 +485,7 @@ test_clear (void) { gchar *temporary_file = g_build_filename (g_get_tmp_dir (), "epiphany-history-test.db", NULL); - EphyHistoryService *service = ensure_empty_history (temporary_file, FALSE); + EphyHistoryService *service = ensure_empty_history (temporary_file); GList *visits = create_test_page_visit_list (); ephy_history_service_add_visits (service, visits, NULL, NULL, NULL); @@ -489,9 +500,9 @@ gtk_test_init (&argc, &argv); g_test_add_func ("/embed/history/test_create_history_service", test_create_history_service); - g_test_add_func ("/embed/history/test_create_readonly_history_service", test_create_readonly_history_service); g_test_add_func ("/embed/history/test_create_history_service_and_destroy_later", test_create_history_service_and_destroy_later); g_test_add_func ("/embed/history/test_create_history_entry", test_create_history_entry); + g_test_add_func ("/embed/history/test_readonly_mode", test_readonly_mode); g_test_add_func ("/embed/history/test_create_history_entries", test_create_history_entries); g_test_add_func ("/embed/history/test_set_url_title", test_set_url_title); g_test_add_func ("/embed/history/test_set_url_title_is_correct", test_set_url_title_is_correct); diff -Nru epiphany-browser-3.22.6/tests/ephy-sqlite-test.c epiphany-browser-3.22.7/tests/ephy-sqlite-test.c --- epiphany-browser-3.22.6/tests/ephy-sqlite-test.c 2017-02-03 14:20:31.000000000 -0500 +++ epiphany-browser-3.22.7/tests/ephy-sqlite-test.c 2017-03-19 17:17:31.000000000 -0400 @@ -29,7 +29,7 @@ static EphySQLiteConnection * ensure_empty_database (const char *filename) { - EphySQLiteConnection *connection = ephy_sqlite_connection_new (); + EphySQLiteConnection *connection = ephy_sqlite_connection_new (EPHY_SQLITE_CONNECTION_MODE_READWRITE); GError *error = NULL; if (g_file_test (filename, G_FILE_TEST_IS_REGULAR))