1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/SecureDRM/src/Server/MmfDrmPluginServer.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,114 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef MMFDRMPLUGINSERVER_H
1.20 +#define MMFDRMPLUGINSERVER_H
1.21 +
1.22 +#include <e32base.h>
1.23 +#include <e32std.h>
1.24 +#include <mmf/common/mmfipc.h>
1.25 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
1.26 +#include <mmf/common/mmfipcserver.h>
1.27 +#endif
1.28 +class CStartAndMonitorControllerThread;
1.29 +class RMMFControllerServerProxy;
1.30 +
1.31 +class CMMFDRMPluginServer : public CMmfIpcServer
1.32 +/**
1.33 +*@internalTechnology
1.34 +*/
1.35 + {
1.36 +public:
1.37 + static CMMFDRMPluginServer* NewL();
1.38 + ~CMMFDRMPluginServer();
1.39 + CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
1.40 +
1.41 + void IncrementSessionId();
1.42 + void DecrementSessionId();
1.43 +
1.44 + void IncrementControllerCount();
1.45 + void DecrementControllerCount();
1.46 +
1.47 + TInt StartControllerServer(const RThread& aClientThread, TUint aMaxHeapSize, TBool aUseSharedHeap,
1.48 + RMMFControllerServerProxy& aDevSoundSessionHandle, TThreadId& aControllerTID, TUint aStackSize) const;
1.49 +
1.50 + void PanicControllerThread(TThreadId aTid, const TDesC& aCategory,TInt aReason);
1.51 + void KillControllerThread(TThreadId aTid, TInt aReason);
1.52 + TInt SetThreadPriority(TThreadId aTid, TThreadPriority aPriority);
1.53 + void SetTimeout(TInt aTimeout) { iServerTimeout = aTimeout; };
1.54 +
1.55 +private:
1.56 +
1.57 + class CDelayServerShutDown : public CActive
1.58 + {
1.59 + public:
1.60 + // Construct/destruct
1.61 + static CDelayServerShutDown* NewL();
1.62 + ~CDelayServerShutDown();
1.63 + // Request
1.64 + void SetDelay(TTimeIntervalMicroSeconds32 aDelay);
1.65 +
1.66 + private:
1.67 + // Construct/destruct
1.68 + CDelayServerShutDown();
1.69 + void ConstructL();
1.70 +
1.71 + // From CActive
1.72 + void RunL();
1.73 + void DoCancel();
1.74 + private:
1.75 + RTimer iShutDownTimer; // Has
1.76 + };
1.77 +
1.78 +private:
1.79 + CMMFDRMPluginServer();
1.80 + void ConstructL();
1.81 +
1.82 +private:
1.83 + TInt iSessionCount;
1.84 + TInt iControllerCount;
1.85 + TInt iServerTimeout;
1.86 + CDelayServerShutDown* iDelayServerShutDown;
1.87 + mutable RPointerArray<CStartAndMonitorControllerThread> iControllerServList;
1.88 + };
1.89 +
1.90 +class CStartAndMonitorControllerThread: public CActive
1.91 + {
1.92 +public:
1.93 + static CStartAndMonitorControllerThread* NewL(CMMFDRMPluginServer* aPluginServer);
1.94 + ~CStartAndMonitorControllerThread();
1.95 + TInt StartControllerServer(const RThread& aClientThread, TUint aMaxHeapSize, TBool aUseSharedHeap,
1.96 + RMMFControllerServerProxy& aControllerSessionHandle, TThreadId& aControllerTID, TUint aStackSize);
1.97 + RThread& Thread() { return iServerThread; };
1.98 +private:
1.99 + // Construct
1.100 + CStartAndMonitorControllerThread(CMMFDRMPluginServer* aPluginServer);
1.101 + void ConstructL();
1.102 +
1.103 + // From CActive
1.104 + void RunL();
1.105 + void DoCancel();
1.106 +private:
1.107 + CMMFDRMPluginServer* iDrmPluginServer;
1.108 + RThread iServerThread;
1.109 + };
1.110 +
1.111 +class RMMFControllerServerProxy : public RMmfSessionBase
1.112 + {
1.113 +public:
1.114 + TInt Open(RServer2& aControllerServerHandle);
1.115 + };
1.116 +
1.117 +#endif