189
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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 "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:
|
|
15 |
* Header file NTB build policy base class
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
/**
|
|
21 |
@file
|
|
22 |
@internalComponent
|
|
23 |
*/
|
|
24 |
|
|
25 |
#include "transferhandle.h"
|
|
26 |
#include "transferserver.h"
|
253
|
27 |
#include "OstTraceDefinitions.h"
|
|
28 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
29 |
#include "transferhandleTraces.h"
|
|
30 |
#endif
|
189
|
31 |
|
|
32 |
CTransferHandle* CTransferHandle::NewL(CTransferServer& aServer)
|
|
33 |
{
|
|
34 |
CTransferHandle *self=new (ELeave) CTransferHandle(aServer);
|
|
35 |
CleanupStack::PushL(self);
|
|
36 |
self->ConstructL();
|
|
37 |
CleanupStack::Pop();
|
|
38 |
return self;
|
|
39 |
}
|
|
40 |
|
|
41 |
CTransferHandle::CTransferHandle(CTransferServer& aServer)
|
|
42 |
: CActive(CActive::EPriorityStandard), iServer(aServer)
|
|
43 |
{
|
|
44 |
}
|
|
45 |
|
|
46 |
CTransferHandle::~CTransferHandle()
|
|
47 |
{
|
253
|
48 |
OstTrace0(TRACE_NORMAL, CTRANSFERHANDLE_DCTRANSFERHANDLE, "CTransferHandle::~CTransferHandle");
|
189
|
49 |
Cancel();
|
|
50 |
iTimer.Close();
|
|
51 |
}
|
|
52 |
|
|
53 |
void CTransferHandle::DoCancel()
|
|
54 |
{
|
253
|
55 |
OstTrace0(TRACE_NORMAL, CTRANSFERHANDLE_DOCANCEL, "CTransferHandle::DoCancel");
|
189
|
56 |
iTimer.Cancel();
|
|
57 |
}
|
|
58 |
|
|
59 |
void CTransferHandle::ConstructL()
|
|
60 |
{
|
|
61 |
CActiveScheduler::Add(this);
|
|
62 |
User::LeaveIfError(iTimer.CreateLocal());
|
|
63 |
}
|
|
64 |
|
|
65 |
_LIT(KPanic, "CTransferHandle");
|
|
66 |
const TInt KTimerError = 1;
|
|
67 |
|
|
68 |
|
|
69 |
void CTransferHandle::RunL()
|
|
70 |
{
|
|
71 |
if(iStatus.Int() != KErrNone)
|
|
72 |
{
|
253
|
73 |
OstTrace0(TRACE_FATAL, CTRANSFERHANDLE_RUNL, "CTransferHandle::RunL");
|
189
|
74 |
User::Panic(KPanic, KTimerError);
|
|
75 |
return;
|
|
76 |
}
|
|
77 |
iServer.TransferHandleL();
|
|
78 |
}
|
|
79 |
|
|
80 |
void CTransferHandle::StartTimer()
|
|
81 |
{
|
|
82 |
iStatus = KRequestPending;
|
|
83 |
iTimer.After(iStatus, 10000);
|
|
84 |
SetActive();
|
|
85 |
}
|
|
86 |
|
|
87 |
|