[Bug 20035] Avatar cache reference implementation

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Apr 19 18:23:29 CEST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=20035

--- Comment #6 from Xavier Claessens <xclaesse at gmail.com> 2010-04-19 09:23:28 PDT ---
I agree with Danielle, but here are my concern:

In the case we retrieved the avatar from CM, we have already the data in
memory, so I don't want to return only a filename, otherwise it will read from
disk again. I could then create a GMemoryInputStream but that means I have a
dup the data in memory because the GArray is feed when returning from
AvatarRetrieved.

So there are various solutions:
1) The solution I implemented, return a pointer to data given in
AvatarRetrieved callback directly, so no need to dup memory or re-read from
disk.

2) Return a GInputStream, that would be GFileInputStream if coming from cache,
or GMemoryInputStream if coming from AvatarRetrieved but then the memory will
be dupped, but won't be re-read from disk at least.

3) Return a GFile in all cases, so if coming from AvatarRetrieved the data is
first written on disk, then a GFile to the cache is returned so it will be
re-read from disk.

4) Combinaison from solutions above, like returning a data pointer and
GFile/GInputMemory.

What are your opinions?

Note: I updated my path for tp-glib master:
http://git.collabora.co.uk/?p=user/xclaesse/telepathy-glib.git;a=shortlog;h=refs/heads/avatar-data

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list