|
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 * |
|
16 */ |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 |
|
24 #include "tranhandleserver.h" |
|
25 #include "tranhandlesession.h" |
|
26 #include "tranhandleserversecuritypolicy.h" |
|
27 #include "tranhandleserverconsts.h" |
|
28 #include "OstTraceDefinitions.h" |
|
29 #ifdef OST_TRACE_COMPILER_IN_USE |
|
30 #include "tranhandleserverTraces.h" |
|
31 #endif |
|
32 #include "general.h" |
|
33 |
|
34 |
|
35 |
|
36 CTranHandleServer* CTranHandleServer::NewL(CActiveControl& aControl) |
|
37 { |
|
38 OstTrace0(TRACE_NORMAL, CTRANHANDLESERVER_NEWL, "CTranHandleServer::NewL"); |
|
39 CTranHandleServer* self = new(ELeave) CTranHandleServer(aControl); |
|
40 CleanupStack::PushL(self); |
|
41 TInt err = self->Start(KTranHandleServerName); |
|
42 |
|
43 if ( err != KErrAlreadyExists ) |
|
44 { |
|
45 User::LeaveIfError(err); |
|
46 } |
|
47 CleanupStack::Pop(self); |
|
48 return self; |
|
49 } |
|
50 |
|
51 CTranHandleServer::~CTranHandleServer() |
|
52 { |
|
53 OstTrace0(TRACE_NORMAL, CTRANHANDLESERVER_DCTRANHANDLESERVER, "CTranHandleServer::~CTranHandleServer"); |
|
54 } |
|
55 |
|
56 CTranHandleServer::CTranHandleServer(CActiveControl& aControl) |
|
57 : CPolicyServer(CActive::EPriorityStandard, KTranHandleServerPolicy, ESharableSessions), |
|
58 iActiveControl(aControl) |
|
59 { |
|
60 } |
|
61 |
|
62 CSession2* CTranHandleServer::NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const |
|
63 { |
|
64 //Validate session as coming from UsbSvr |
|
65 OstTrace0(TRACE_NORMAL, CTRANHANDLESERVER_NEWSESSIONL, "CTranHandleServer::NewSessionL"); |
|
66 CTranHandleSession* sess = CTranHandleSession::NewL(iActiveControl); |
|
67 return sess; |
|
68 } |