webengine/osswebengine/WebCore/platform/network/symbian/HttpCacheDataSupplier.cpp
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Data supplier for responses loaded from cache
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "HttpCacheDataSupplier.h"
       
    21 
       
    22 // EXTERNAL DATA STRUCTURES
       
    23 
       
    24 // EXTERNAL FUNCTION PROTOTYPES
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // MACROS
       
    29 
       
    30 // LOCAL CONSTANTS AND MACROS
       
    31 
       
    32 // MODULE DATA STRUCTURES
       
    33 
       
    34 // LOCAL FUNCTION PROTOTYPES
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 
       
    38 // ============================= LOCAL FUNCTIONS ===============================
       
    39 
       
    40 
       
    41 // ============================ MEMBER FUNCTIONS ===============================
       
    42 
       
    43 // -----------------------------------------------------------------------------
       
    44 // CHttpCacheDataSupplier::CHttpCacheDataSupplier
       
    45 // C++ default constructor can NOT contain any code, that
       
    46 // might leave.
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 CHttpCacheDataSupplier::CHttpCacheDataSupplier(
       
    50     HBufC8* aBody ) 
       
    51     : m_body( aBody )
       
    52     {
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CHttpCacheDataSupplier::NewL
       
    57 // Two-phased constructor.
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 CHttpCacheDataSupplier* CHttpCacheDataSupplier::NewL(
       
    61     HBufC8* aBody )
       
    62     {
       
    63     CHttpCacheDataSupplier* self = new(ELeave) CHttpCacheDataSupplier( aBody );
       
    64     return self;
       
    65     }
       
    66 
       
    67 // Destructor
       
    68 CHttpCacheDataSupplier::~CHttpCacheDataSupplier()
       
    69     {
       
    70     ReleaseData();
       
    71     }
       
    72 
       
    73 // -----------------------------------------------------------------------------
       
    74 // CHttpCacheDataSupplier::GetNextDataPart
       
    75 // Return the next chunk of response body from the Cache
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 TBool CHttpCacheDataSupplier::GetNextDataPart(
       
    79     TPtrC8 &aDataChunk )
       
    80     {
       
    81     aDataChunk.Set( *m_body );
       
    82     return ETrue;
       
    83     }
       
    84 
       
    85 //  End of File