applayerpluginsandutils/httptransportplugins/httptransporthandler/chttpasyncwaiter.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 00:53:08 +0300
changeset 50 753e9b859ae7
parent 0 b16258d2340f
permissions -rw-r--r--
Revision: 201037 Kit: 201039

// 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();
     }