GNOME Bugzilla – Bug 765863
Simplifications for the snapshot service
Last modified: 2016-05-09 13:41:03 UTC
ephy-snapshot-service.c is too long and confusing. This patches removes about 200 lines of code.
Created attachment 327085 [details] [review] snapshot-service: Stop using const time_t We don't use const in C except for strings. And certainly not for pass-by-value.
Created attachment 327086 [details] [review] web-view-test: Fix return type of visit_url_cb tartan would have caught this.
Created attachment 327087 [details] [review] snapshot-service: Clarify error message The snapshot service has two caches.
Created attachment 327088 [details] [review] snapshot-service: Remove unused functions to retrieve pixbufs We have a bunch of complicated code to support retrieving GdkPixbufs from the snapshot service, but Epiphany does not use these and I don't expect it to in the future. The snapshot service is too complex right now and it's more important to simplify than to keep dead code around.
Created attachment 327089 [details] [review] snapshot-service: Make ephy_snapshot_service_save private Requires rearrangements to avoid forward declarations.
Created attachment 327090 [details] [review] snapshot-service: assert that web view has loaded at some point We should never attempt to get a snapshot from a web view that has never loaded anything ever. Instead of attempting to handle this case in a nonsensical manner, just assert that it will never happen.
Created attachment 327091 [details] [review] snapshot-service: pretty up header file
Created attachment 327092 [details] [review] snapshot-service: Rename memory cache lookup function To be more clear
Created attachment 327093 [details] [review] snapshot-service: Ensure snapshot freshness in a better location This reduces the likelihood that we'll duplicate effort in taking a snapshot twice, by ensuring we only ever call ephy_snapshot_service_take_from_webview in one location.
Created attachment 327094 [details] [review] snapshot-service: Reuse the same SnapshotAsyncData struct Having too many structs makes this file unnecessarily difficult to read.
Attachment 327085 [details] pushed as 0cbd04f - snapshot-service: Stop using const time_t Attachment 327086 [details] pushed as 050d8bb - web-view-test: Fix return type of visit_url_cb Attachment 327087 [details] pushed as 9af9fb9 - snapshot-service: Clarify error message Attachment 327088 [details] pushed as 3f0c4a9 - snapshot-service: Remove unused functions to retrieve pixbufs Attachment 327089 [details] pushed as a97b8e9 - snapshot-service: Make ephy_snapshot_service_save private Attachment 327090 [details] pushed as 3c2fc9b - snapshot-service: assert that web view has loaded at some point Attachment 327091 [details] pushed as 8f3191c - snapshot-service: pretty up header file Attachment 327092 [details] pushed as d89374e - snapshot-service: Rename memory cache lookup function Attachment 327093 [details] pushed as adc6c40 - snapshot-service: Ensure snapshot freshness in a better location Attachment 327094 [details] pushed as c6b53f5 - snapshot-service: Reuse the same SnapshotAsyncData struct