applayerpluginsandutils/httptransportplugins/httptransporthandler/chttpasyncwaiter.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 12 Mar 2010 15:45:46 +0200
branchRCL_3
changeset 7 337070b4fa18
parent 0 b16258d2340f
permissions -rw-r--r--
Revision: 201004 Kit: 201008

// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

#include "chttpasyncwaiter.h"
 
CHttpAsyncWaiter* CHttpAsyncWaiter::New()
    {
     return ( new CHttpAsyncWaiter() );
    }
 
 CHttpAsyncWaiter::CHttpAsyncWaiter()
     : CActive(EPriorityStandard)	
     {
     CActiveScheduler::Add(this);
     }   
 
 CHttpAsyncWaiter::~CHttpAsyncWaiter()
     {
     Cancel();
    }
     
 void CHttpAsyncWaiter::StartAndWait()
     {
     SetActive();
     CActiveScheduler::Start();
     }
     
 TInt CHttpAsyncWaiter::Result() const
     {
     return iError;
     }
     
 void CHttpAsyncWaiter::RunL()
     {
     iError = iStatus.Int();
     CActiveScheduler::Stop();
     }
     
 void CHttpAsyncWaiter::DoCancel()
     {
     iError = KErrCancel;
     CActiveScheduler::Stop();
     }