Changeset 3701

Show
Ignore:
Timestamp:
06/18/08 10:42:56
Author:
jdapena
Message:

* libtinymail/tny-shared.h:

Added stream cache classes and handlers
* libtinymail/tny-stream-cache.[ch]:
Interface for streams caches. It's mostly intended for image
remote streams.
* libtinymail/tny-fs-stream-cache.[ch]:
Implementation of TnyStreamCache? interface using a local
folder for storage. This implementation tries to keep the
size of the cached streams lower than 1 MB.
* libtinymail/tny-cached-file.[ch]:
Data object to store status information of currently cached
files. It also controls the process of fetching the remote
streams, and creation of streams reading from cache.
* libtinymail/tny-cached-file-stream.[ch]:
Streams wrapping TnyFsStream, that access the cache files
waiting when they're not completely fetched yet.
* libtinymail/Makefile.am:
Added stream cache implementation files.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3699 r3701  
     12008-06-18  Jose Dapena Paz  <jdapena@igalia.com> 
     2 
     3        * libtinymail/tny-shared.h: 
     4        Added stream cache classes and handlers 
     5 
     6        * libtinymail/tny-stream-cache.[ch]: 
     7        Interface for streams caches. It's mostly intended for image 
     8        remote streams. 
     9 
     10        * libtinymail/tny-fs-stream-cache.[ch]: 
     11        Implementation of TnyStreamCache interface using a local 
     12        folder for storage. This implementation tries to keep the 
     13        size of the cached streams lower than 1 MB. 
     14 
     15        * libtinymail/tny-cached-file.[ch]: 
     16        Data object to store status information of currently cached 
     17        files. It also controls the process of fetching the remote 
     18        streams, and creation of streams reading from cache. 
     19 
     20        * libtinymail/tny-cached-file-stream.[ch]: 
     21        Streams wrapping TnyFsStream, that access the cache files 
     22        waiting when they're not completely fetched yet. 
     23 
     24        * libtinymail/Makefile.am: 
     25        Added stream cache implementation files. 
     26 
    1272008-06-10  Sergio Villar Senin  <svillar@igalia.com> 
    228 
  • trunk/libtinymail/Makefile.am

    r3601 r3701  
    5050        tny-password-getter.h \ 
    5151        tny-merge-folder.h \ 
     52        tny-stream-cache.h \ 
     53        tny-fs-stream-cache.h \ 
     54        tny-cached-file.h \ 
     55        tny-cached-file-stream.h \ 
    5256        tny-combined-account.h \ 
    5357        tny-connection-policy.h  
     
    9296        tny-send-queue.c \ 
    9397        tny-password-getter.c \ 
     98        tny-stream-cache.c \ 
     99        tny-fs-stream-cache.c \ 
     100        tny-cached-file.c \ 
     101        tny-cached-file-stream.c \ 
    94102        tny-merge-folder.c \ 
    95103        tny-combined-account.c \ 
  • trunk/libtinymail/tny-shared.h

    r3603 r3701  
    105105typedef struct _TnySeekable TnySeekable; 
    106106typedef struct _TnySeekableIface TnySeekableIface; 
     107typedef struct _TnyStreamCache TnyStreamCache; 
     108typedef struct _TnyStreamCacheIface TnyStreamCacheIface; 
     109typedef struct _TnyFsStreamCache TnyFsStreamCache; 
     110typedef struct _TnyFsStreamCacheClass TnyFsStreamCacheClass; 
     111typedef struct _TnyCachedFile TnyCachedFile; 
     112typedef struct _TnyCachedFileClass TnyCachedFileClass; 
     113typedef struct _TnyCachedFileStream TnyCachedFileStream; 
     114typedef struct _TnyCachedFileStreamClass TnyCachedFileStreamClass; 
    107115 
    108116 
     
    127135typedef void (*TnyFolderCallback) (TnyFolder *self, gboolean cancelled, GError *err, gpointer user_data); 
    128136typedef void (*TnyGetHeadersCallback) (TnyFolder *self, gboolean cancelled, TnyList *headers, GError *err, gpointer user_data); 
     137 
     138typedef TnyStream* (*TnyStreamCacheOpenStreamFetcher) (TnyStreamCache *self, gint64 *expected_size, gpointer userdata); 
     139typedef gboolean (*TnyStreamCacheRemoveFilter) (TnyStreamCache *self, const gchar *id, gpointer userdata); 
    129140 
    130141/**