os/mm/mmlibs/mmfw/SecureDRM/src/Server/MmfDrmPluginServer.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef MMFDRMPLUGINSERVER_H
sl@0
    17
#define MMFDRMPLUGINSERVER_H
sl@0
    18
sl@0
    19
#include <e32base.h>
sl@0
    20
#include <e32std.h>
sl@0
    21
#include <mmf/common/mmfipc.h>
sl@0
    22
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
    23
#include <mmf/common/mmfipcserver.h>
sl@0
    24
#endif
sl@0
    25
class CStartAndMonitorControllerThread;
sl@0
    26
class RMMFControllerServerProxy;
sl@0
    27
sl@0
    28
class CMMFDRMPluginServer : public CMmfIpcServer
sl@0
    29
/**
sl@0
    30
*@internalTechnology
sl@0
    31
*/
sl@0
    32
	{
sl@0
    33
public:
sl@0
    34
	static CMMFDRMPluginServer* NewL();
sl@0
    35
	~CMMFDRMPluginServer();
sl@0
    36
	CMmfIpcSession* NewSessionL(const TVersion &aVersion) const;
sl@0
    37
sl@0
    38
	void IncrementSessionId();
sl@0
    39
	void DecrementSessionId();
sl@0
    40
	
sl@0
    41
	void IncrementControllerCount();
sl@0
    42
	void DecrementControllerCount();
sl@0
    43
sl@0
    44
	TInt StartControllerServer(const RThread& aClientThread, TUint aMaxHeapSize, TBool aUseSharedHeap,
sl@0
    45
							RMMFControllerServerProxy& aDevSoundSessionHandle, TThreadId& aControllerTID, TUint aStackSize) const;
sl@0
    46
							
sl@0
    47
	void PanicControllerThread(TThreadId aTid, const TDesC& aCategory,TInt aReason);
sl@0
    48
	void KillControllerThread(TThreadId aTid, TInt aReason);
sl@0
    49
	TInt SetThreadPriority(TThreadId aTid, TThreadPriority aPriority);
sl@0
    50
	void SetTimeout(TInt aTimeout) { iServerTimeout = aTimeout; };
sl@0
    51
	
sl@0
    52
private:
sl@0
    53
sl@0
    54
	class CDelayServerShutDown : public CActive
sl@0
    55
        {
sl@0
    56
    public:
sl@0
    57
        // Construct/destruct
sl@0
    58
        static CDelayServerShutDown* NewL();
sl@0
    59
        ~CDelayServerShutDown(); 
sl@0
    60
        // Request
sl@0
    61
        void SetDelay(TTimeIntervalMicroSeconds32 aDelay);   
sl@0
    62
        
sl@0
    63
    private:
sl@0
    64
        // Construct/destruct
sl@0
    65
        CDelayServerShutDown();
sl@0
    66
        void ConstructL();
sl@0
    67
    
sl@0
    68
        // From CActive
sl@0
    69
        void RunL();
sl@0
    70
        void DoCancel();   
sl@0
    71
    private:
sl@0
    72
        RTimer iShutDownTimer;      // Has
sl@0
    73
        };
sl@0
    74
sl@0
    75
private:
sl@0
    76
	CMMFDRMPluginServer();
sl@0
    77
	void ConstructL();
sl@0
    78
sl@0
    79
private:
sl@0
    80
	TInt iSessionCount;
sl@0
    81
	TInt iControllerCount;
sl@0
    82
	TInt iServerTimeout;
sl@0
    83
	CDelayServerShutDown* iDelayServerShutDown;
sl@0
    84
	mutable RPointerArray<CStartAndMonitorControllerThread> iControllerServList;
sl@0
    85
	};
sl@0
    86
sl@0
    87
class CStartAndMonitorControllerThread: public CActive
sl@0
    88
	{
sl@0
    89
public:
sl@0
    90
	static CStartAndMonitorControllerThread* NewL(CMMFDRMPluginServer* aPluginServer);
sl@0
    91
	~CStartAndMonitorControllerThread();
sl@0
    92
	TInt StartControllerServer(const RThread& aClientThread, TUint aMaxHeapSize, TBool aUseSharedHeap,
sl@0
    93
							RMMFControllerServerProxy& aControllerSessionHandle, TThreadId& aControllerTID, TUint aStackSize);
sl@0
    94
	RThread& Thread() { return iServerThread; };
sl@0
    95
private:
sl@0
    96
	// Construct
sl@0
    97
	CStartAndMonitorControllerThread(CMMFDRMPluginServer* aPluginServer);
sl@0
    98
	void ConstructL();
sl@0
    99
   
sl@0
   100
	// From CActive
sl@0
   101
	void RunL();
sl@0
   102
	void DoCancel();
sl@0
   103
private:
sl@0
   104
	CMMFDRMPluginServer* iDrmPluginServer;
sl@0
   105
	RThread iServerThread;
sl@0
   106
    };
sl@0
   107
        
sl@0
   108
class RMMFControllerServerProxy : public RMmfSessionBase
sl@0
   109
	{
sl@0
   110
public:
sl@0
   111
	TInt Open(RServer2& aControllerServerHandle);
sl@0
   112
	};
sl@0
   113
sl@0
   114
#endif