devicediagnosticsfw/diagresultsdb/client/src/diagresultsdatabase.cpp
branchRCL_3
changeset 13 06f47423ecee
parent 0 b497e44ab2fc
equal deleted inserted replaced
9:57a65a3a658c 13:06f47423ecee
    79 // ---------------------------------------------------------------------------
    79 // ---------------------------------------------------------------------------
    80 //
    80 //
    81 void RDiagResultsDatabase::DoConnectL (TUid aAppUid)
    81 void RDiagResultsDatabase::DoConnectL (TUid aAppUid)
    82     {
    82     {
    83     LOGME("RDiagResultsDatabase::DoConnectL");
    83     LOGME("RDiagResultsDatabase::DoConnectL");
    84     if (iBuffer==NULL)
    84     if (iBuffer==NULL) {
    85 		{
       
    86 		iBuffer = CBufFlat::NewL(KResultsDatabaseGranuality);
    85 		iBuffer = CBufFlat::NewL(KResultsDatabaseGranuality);
    87 		iBuffer->ResizeL(KResultsDatabaseBufferLength);
    86 		
    88 		if (iBuffer==NULL)
    87 		if (iBuffer==NULL) {
    89 			User::Leave( KErrNoMemory );
    88 			User::Leave( KErrNoMemory );
    90 		}
    89 		}
       
    90 		
       
    91 		iBuffer->ResizeL(KResultsDatabaseBufferLength);
       
    92 	}
    91     
    93     
    92     TInt r = DiagResultsDbCommon::StartServer();
    94     TInt r = DiagResultsDbCommon::StartServer();
    93     LOGME1("RDiagResultsDatabase::StartServer %d",r);
    95     LOGME1("RDiagResultsDatabase::StartServer %d",r);
    94 	if( r==KErrNone )
    96 	if( r==KErrNone )
    95 	    // Use default message slots
    97 	    // Use default message slots
   553     {
   555     {
   554     LOGME("RDiagResultsDatabaseRecord::DoConnectL");
   556     LOGME("RDiagResultsDatabaseRecord::DoConnectL");
   555     if (iBuffer==NULL)
   557     if (iBuffer==NULL)
   556 		{
   558 		{
   557 		iBuffer = CBufFlat::NewL(KResultsDatabaseGranuality);
   559 		iBuffer = CBufFlat::NewL(KResultsDatabaseGranuality);
       
   560 		
       
   561 		if (iBuffer==NULL) {
       
   562 			User::Leave( KErrNoMemory );
       
   563 		}
       
   564 		
   558 		iBuffer->ResizeL(KResultsDatabaseSubsessionBufferLength);
   565 		iBuffer->ResizeL(KResultsDatabaseSubsessionBufferLength);
   559 		if (iBuffer==NULL)
       
   560 			User::Leave( KErrNoMemory );
       
   561 		}
   566 		}
   562     
   567     
   563     iOpen = ETrue;
   568     iOpen = ETrue;
   564     
   569     
   565     TPckgBuf<TUid> uid( aRecordId );
   570     TPckgBuf<TUid> uid( aRecordId );
   649 void RDiagResultsDatabaseRecord::DoCreateNewRecordL (
   654 void RDiagResultsDatabaseRecord::DoCreateNewRecordL (
   650             RDiagResultsDatabase& aSession,
   655             RDiagResultsDatabase& aSession,
   651             TUid& aRecordId,
   656             TUid& aRecordId,
   652             CDiagResultsDbRecordEngineParam& aEngineParam )
   657             CDiagResultsDbRecordEngineParam& aEngineParam )
   653     {
   658     {
   654      if (iBuffer==NULL)
   659      if (iBuffer==NULL) {
   655 		{
       
   656 		iBuffer = CBufFlat::NewL(KResultsDatabaseGranuality);
   660 		iBuffer = CBufFlat::NewL(KResultsDatabaseGranuality);
   657 		iBuffer->ResizeL(KResultsDatabaseSubsessionBufferLength);
   661 		
   658 		if (iBuffer==NULL)
   662 		if (iBuffer==NULL) {
   659 			User::Leave( KErrNoMemory );
   663 			User::Leave( KErrNoMemory );
   660 		}
   664 		}
       
   665 		
       
   666 		iBuffer->ResizeL(KResultsDatabaseSubsessionBufferLength);
       
   667     }
   661         
   668         
   662     iBuffer->Delete( 0, iBuffer->Size() );
   669     iBuffer->Delete( 0, iBuffer->Size() );
   663     iBuffer->ResizeL( KResultsDatabaseSubsessionBufferLength );
   670     iBuffer->ResizeL( KResultsDatabaseSubsessionBufferLength );
   664     
   671     
   665     TPtr8 ptr ( iBuffer->Ptr(0) );    
   672     TPtr8 ptr ( iBuffer->Ptr(0) );