webengine/osswebengine/cache/inc/HttpCacheEntry.h
changeset 1 7c90e6132015
parent 0 dd21522fd290
child 10 a359256acfc6
equal deleted inserted replaced
0:dd21522fd290 1:7c90e6132015
    18 #ifndef CHTTPCACHEENTRY_H
    18 #ifndef CHTTPCACHEENTRY_H
    19 #define CHTTPCACHEENTRY_H
    19 #define CHTTPCACHEENTRY_H
    20 
    20 
    21 //  INCLUDES
    21 //  INCLUDES
    22 #include <e32base.h>
    22 #include <e32base.h>
       
    23 #include <f32file.h>
    23 
    24 
    24 // CONSTANTS
    25 // CONSTANTS
       
    26 const TInt KBufferSize32k = 32768;
       
    27 const TInt KBufferSizeZero = 0;
    25 
    28 
    26 // MACROS
    29 // MACROS
    27 
    30 
    28 // DATA TYPES
    31 // DATA TYPES
    29 
    32 
   153         * 
   156         * 
   154         * @since 3.1
   157         * @since 3.1
   155         * @param 
   158         * @param 
   156         * @return 
   159         * @return 
   157         */
   160         */
   158         inline TUint Size() const { return iSize; }
   161         inline TUint BodySize() const { return iBodySize; }
   159 
   162 
   160         /**
   163         /**
   161         * 
   164         * 
   162         * @since 3.1
   165         * @since 3.1
   163         * @param 
   166         * @param 
   164         * @return 
   167         * @return 
   165         */
   168         */
   166         void SetSize( TUint aSize );
   169         void SetBodySize( TUint aSize );
   167 
   170 
   168         /**
   171         /**
   169         * 
   172         * 
   170         * @since 3.1
   173         * @since 3.1
   171         * @param 
   174         * @param 
   181         */
   184         */
   182         inline void SetHeaderSize( TUint16 aHeaderSize ) { iHeaderSize = aHeaderSize; }
   185         inline void SetHeaderSize( TUint16 aHeaderSize ) { iHeaderSize = aHeaderSize; }
   183 
   186 
   184         /**
   187         /**
   185         * 
   188         * 
       
   189         * @since 7.1
       
   190         * @param 
       
   191         * @return 
       
   192         */
       
   193         inline RFile& HeaderFile() { return iHeaderFile; }
       
   194 
       
   195         /**
       
   196         * 
       
   197         * @since 7.1
       
   198         * @param 
       
   199         * @return 
       
   200         */
       
   201         inline RFile& BodyFile() { return iBodyFile; }
       
   202 
       
   203         /**
       
   204         * 
       
   205         * @since 7.1
       
   206         * @param 
       
   207         * @return 
       
   208         */
       
   209         TPtr8 CacheBuffer();
       
   210         
       
   211         /**
       
   212         * 
       
   213         * @since 7.1
       
   214         * @param 
       
   215         * @return 
       
   216         */
       
   217         void SetCacheBufferL( TInt aCacheBufferSize );
       
   218 
       
   219         /**
       
   220         * 
   186         * @since 3.1
   221         * @since 3.1
   187         * @param 
   222         * @param 
   188         * @return 
   223         * @return 
   189         */
   224         */
   190         inline TBool Protected() const { return iProtected; }
   225         inline TBool Protected() const { return iProtected; }
   218         * @since 3.1
   253         * @since 3.1
   219         * @param 
   254         * @param 
   220         * @return 
   255         * @return 
   221         */
   256         */
   222         void Accessed(TInt64 aLastAccessed, TUint16 aRef);
   257         void Accessed(TInt64 aLastAccessed, TUint16 aRef);
       
   258 
       
   259         /**
       
   260         * 
       
   261         * @since 7.1
       
   262         * @param 
       
   263         * @return 
       
   264         */
       
   265         inline TBool BodyFileDeleteNeeded() { return iBodyFileDeleteNeeded; }
       
   266 
       
   267         /**
       
   268         * 
       
   269         * @since 7.1
       
   270         * @param 
       
   271         * @return 
       
   272         */
       
   273         inline void SetBodyFileDeleteNeeded( TBool aBodyFileDeleteNeeded )
       
   274                     {
       
   275                     iBodyFileDeleteNeeded = aBodyFileDeleteNeeded;
       
   276                     }
       
   277 
       
   278         /**
       
   279         * 
       
   280         * @since 7.1
       
   281         * @param 
       
   282         * @return 
       
   283         */
       
   284         TBool CacheFilesOpened() { return iCacheFilesOpened; }
       
   285 
       
   286         /**
       
   287         * 
       
   288         * @since 7.1
       
   289         * @param 
       
   290         * @return 
       
   291         */
       
   292         void SetCacheFilesOpened( TBool aCacheFilesOpened );
   223 
   293 
   224     public : 
   294     public : 
   225 
   295 
   226         // support linked list
   296         // support linked list
   227         static const TInt iOffset;
   297         static const TInt iOffset;
   243         void ConstructL( const TDesC8& aUrl );    
   313         void ConstructL( const TDesC8& aUrl );    
   244 
   314 
   245     private:    // Data
   315     private:    // Data
   246 
   316 
   247         //
   317         //
   248         HBufC8*                         iUrl;       // owned
   318         HBufC8*                         iUrl;               // owned
   249         // if empty, then use url to get filename
   319         // if empty, then use url to get filename
   250         HBufC*                          iFileName; // owned
   320         HBufC*                          iFileName;          // owned
   251         //
   321         //
   252         TCacheEntryState                iState;
   322         TCacheEntryState                iState;
   253         //
   323         //
   254         TInt64                          iLastAccessed;
   324         TInt64                          iLastAccessed;
   255         // ref counter
   325         // ref counter
   256         TUint16                         iRef;
   326         TUint16                         iRef;
   257         // content size
   327         // content size
   258         TUint                           iSize;
   328         TUint                           iBodySize;
   259         // header size
   329         // header size
   260         TUint16                         iHeaderSize;
   330         TUint16                         iHeaderSize;
   261         // protected content like css, script
   331         // protected content like css, script
   262         TUint8                          iProtected;
   332         TUint8                          iProtected;
   263         //
   333         //
   264         TSglQueLink                     iSlink;
   334         TSglQueLink                     iSqlQueLink;
   265         //
   335         //
   266         CHttpCacheEvictionHandler*      iEvictionHandler;         // not owned
   336         CHttpCacheEvictionHandler*      iEvictionHandler;   // not owned
   267         // Etrue if added to the eviction table
   337         // Etrue if added to the eviction table
   268         TUint8                          iVictim;
   338         TUint8                          iEvictionCandidate;
       
   339         //
       
   340         TBool                           iBodyFileDeleteNeeded;
       
   341         //
       
   342         RFile                           iHeaderFile;        // owned
       
   343         //
       
   344         RFile                           iBodyFile;          // owned
       
   345         //
       
   346         HBufC8*                         iCacheBuffer;       // owned
       
   347         // ETrue if files open (and attached to StreamHandler) for read/write
       
   348         TBool                           iCacheFilesOpened;
   269     };
   349     };
   270 
   350 
   271 #endif      // CHTTPCACHEENTRY_H
   351 #endif      // CHTTPCACHEENTRY_H
   272             
   352             
   273 // End of File
   353 // End of File