httpfilters/cookie/ManagerSrc/CookieClientData.cpp
branchRCL_3
changeset 15 bdd8a827a7de
parent 8 73e95e652591
equal deleted inserted replaced
13:26ce6fb6aee2 15:bdd8a827a7de
     7 //User Includes
     7 //User Includes
     8 #include "CookieClientData.h"
     8 #include "CookieClientData.h"
     9 #include "cookie.h"
     9 #include "cookie.h"
    10 #include "CookieArray.h"
    10 #include "CookieArray.h"
    11 #include "CookieLogger.h"
    11 #include "CookieLogger.h"
    12 
    12 #include "CookieCommonConstants.h"
       
    13 #include <uri8.h>
    13 
    14 
    14 // ---------------------------------------------------------
    15 // ---------------------------------------------------------
    15 // CCookieGroupData::NewL
    16 // CCookieGroupData::NewL
    16 // ---------------------------------------------------------
    17 // ---------------------------------------------------------
    17 //
    18 //
   120 //
   121 //
   121 void CCookieClientData::StoreCookieAtClientSideL(const CCookie* aCookie,const TDesC8& aUri )
   122 void CCookieClientData::StoreCookieAtClientSideL(const CCookie* aCookie,const TDesC8& aUri )
   122     {
   123     {
   123     CLOG(( EClient, 0, _L("-> RCookieManager::StoreCookieAtClientSideL: aUri:%S"), &aUri ));
   124     CLOG(( EClient, 0, _L("-> RCookieManager::StoreCookieAtClientSideL: aUri:%S"), &aUri ));
   124     //Creates a clone of the passed cookie objects as the ownership of this object is held by Clint of Cookie Manager Dll
   125     //Creates a clone of the passed cookie objects as the ownership of this object is held by Clint of Cookie Manager Dll
       
   126     TUriParser8 uriParser;
   125     
   127     
   126     CCookie* clone = CCookie::CloneL( *aCookie );
   128     TInt err = uriParser.Parse( aUri );
   127     CleanupStack::PushL( clone );
   129     CCookie* clone(NULL);
       
   130     if (err !=KErrNone)
       
   131         return;
       
   132     else
       
   133         {
       
   134         // first get the details of the current requestUri,
       
   135         // that is, Domain, Path and port
       
   136         TPtrC8 requestPath( uriParser.IsPresent( EUriPath ) ?
       
   137                             uriParser.Extract( EUriPath ) : KNullDesC8() );
       
   138         TPtrC8 requestDomain( uriParser.IsPresent( EUriHost ) ?
       
   139                             uriParser.Extract( EUriHost ) : KNullDesC8() );
       
   140         TPtrC8 requestPort( uriParser.IsPresent( EUriPort ) ?
       
   141                 uriParser.Extract( EUriPort ) : KCookieDefaultRequestPort() );
       
   142 
       
   143         clone = CCookie::CloneL( *aCookie,requestDomain,requestPath,requestPort);
       
   144         CleanupStack::PushL( clone );
       
   145         }
       
   146 
       
   147     //CCookie* clone = CCookie::CloneL( *aCookie,requestDomain,requestPath);
       
   148     //CleanupStack::PushL( clone );
   128   
   149   
   129     TInt index(0);
   150     TInt index(0);
   130     CCookieArray* perscookiearray = CookieArray();
   151     CCookieArray* perscookiearray = CookieArray();
   131         if ( perscookiearray->DoesAlreadyExists( clone, index ) )
   152         if ( perscookiearray->DoesAlreadyExists( clone, index ) )
   132         { // must overwrite !!!
   153         { // must overwrite !!!