--- a/commondrm/drmui/drmuinotifications/DRMUINotifications.rss Thu Oct 14 13:45:23 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-// ============================================================================
-// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-05-24T18:48:20
-// * This file is generated by qmake and should not be modified by the
-// * user.
-// ============================================================================
-
-#include <appinfo.rh>
-#include <DRMUINotifications.loc>
-
-RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
- {
- short_caption = STRING_r_short_caption;
- caption_and_icon =
- CAPTION_AND_ICON_INFO
- {
- caption = STRING_r_caption;
- number_of_icons = 0;
- icon_file = "";
- };
- }
-
--- a/commondrm/drmui/drmuinotifications/drmuinotifications.pro Thu Oct 14 13:45:23 2010 +0300
+++ b/commondrm/drmui/drmuinotifications/drmuinotifications.pro Wed Oct 20 14:56:54 2010 +0300
@@ -14,8 +14,7 @@
inc/drmuidialogpluginkeys.h \
inc/drmuidialogplugin.h
SOURCES += src/drmuidialogsbuilder.cpp \
- src/drmuidialogplugin.cpp \
- DRMUINotifications_reg.rss
+ src/drmuidialogplugin.cpp
FORMS +=
symbian:TARGET.UID3 = 0x20026835
RESOURCES += resource/drmuinotifications.qrc
@@ -26,7 +25,7 @@
TARGET.CAPABILITY = CAP_GENERAL_DLL
TARGET.UID3 = 20026835
hblib.sources = Hb.dll
- hblib.path = \sys\bin
+ hblib.path = /sys/bin
hblib.depends = "(0xEEF9EA38), 1, 0, 0, {\"Hb\"}"
pluginstub.sources = drmuinotifications.dll
pluginstub.path = /resource/plugins/devicedialogs
--- a/commondrm/drmutility/traces/OstTraceDefinitions.h Thu Oct 14 13:45:23 2010 +0300
+++ b/commondrm/drmutility/traces/OstTraceDefinitions.h Wed Oct 20 14:56:54 2010 +0300
@@ -1,7 +1,22 @@
+/*
+* Copyright (c) 2010 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:
+*
+*/
+
+
#ifndef __OSTTRACEDEFINITIONS_H__
#define __OSTTRACEDEFINITIONS_H__
-// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler
-// REMOVE BEFORE CHECK-IN TO VERSION CONTROL
-// #define OST_TRACE_COMPILER_IN_USE
#include <opensystemtrace.h>
#endif
--- a/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp Thu Oct 14 13:45:23 2010 +0300
+++ b/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp Wed Oct 20 14:56:54 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-2010 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"
@@ -346,6 +346,7 @@
TBool protection = ETrue;
HBufC8* buffer;
TInt traperror = KErrNone;
+ TInt ret = KErrNone;
if (aDcfFile.iVersion == 2)
{
@@ -725,14 +726,16 @@
case ERightsNone:
if (aRightsClient == NULL)
{
- value = client.Connect();
- if (value != KErrCANoRights)
+ ret = client.Connect();
+ if (ret != KErrNone)
{
+ value = ret;
break;
}
TUint32 reason = 0;
- value = client.CheckRights(EPeek, *aDcfFile.iContentID, reason);
- if(value == KErrCANoRights || KErrCANoPermission)
+ value = EFalse;
+ ret = client.CheckRights(EPeek, *aDcfFile.iContentID, reason);
+ if(ret == KErrCANoRights || ret == KErrCANoPermission)
{
value = ETrue;
}
@@ -741,8 +744,9 @@
else
{
TUint32 reason = 0;
- value = aRightsClient->CheckRights(EPeek, *aDcfFile.iContentID, reason);
- if(value == KErrCANoRights || KErrCANoPermission)
+ value = EFalse;
+ ret = aRightsClient->CheckRights(EPeek, *aDcfFile.iContentID, reason);
+ if(ret == KErrCANoRights || ret == KErrCANoPermission)
{
value = ETrue;
}
@@ -751,32 +755,42 @@
case ERightsHaveExpired:
if (aRightsClient == NULL)
{
- value = client.Connect();
- if (value != KErrNone)
+ ret = client.Connect();
+ if (ret != KErrNone)
{
+ value = ret;
break;
}
value = ETrue;
TUint32 reason = 0;
- value = client.CheckRights(EPlay, *aDcfFile.iContentID, reason);
- if(value != KErrCANoRights || KErrCANoPermission)
- {
- value = EFalse;
- }
- value = client.CheckRights(EView, *aDcfFile.iContentID, reason);
- if(value != KErrCANoRights || KErrCANoPermission)
+ ret = client.CheckRights(EPlay, *aDcfFile.iContentID, reason);
+ if(ret != KErrCANoRights && ret != KErrCANoPermission)
{
value = EFalse;
}
- value = client.CheckRights(EExecute, *aDcfFile.iContentID, reason);
- if(value != KErrCANoRights || KErrCANoPermission)
- {
- value = EFalse;
+ if(value)
+ {
+ ret = client.CheckRights(EView, *aDcfFile.iContentID, reason);
+ if(ret != KErrCANoRights && ret != KErrCANoPermission)
+ {
+ value = EFalse;
+ }
}
- value = client.CheckRights(EPrint, *aDcfFile.iContentID, reason);
- if(value != KErrCANoRights || KErrCANoPermission)
+ if(value)
{
- value = EFalse;
+ ret = client.CheckRights(EExecute, *aDcfFile.iContentID, reason);
+ if(ret != KErrCANoRights && ret != KErrCANoPermission)
+ {
+ value = EFalse;
+ }
+ }
+ if(value)
+ {
+ ret = client.CheckRights(EPrint, *aDcfFile.iContentID, reason);
+ if(ret != KErrCANoRights && ret != KErrCANoPermission)
+ {
+ value = EFalse;
+ }
}
client.Close();
}
@@ -784,27 +798,35 @@
{
value = ETrue;
TUint32 reason = 0;
- value = aRightsClient->CheckRights(EPlay, *aDcfFile.iContentID, reason);
- if(value != KErrCANoRights || KErrCANoPermission)
- {
- value = EFalse;
- }
- value = aRightsClient->CheckRights(EView, *aDcfFile.iContentID, reason);
- if(value != KErrCANoRights || KErrCANoPermission)
+ ret = aRightsClient->CheckRights(EPlay, *aDcfFile.iContentID, reason);
+ if(ret != KErrCANoRights && ret != KErrCANoPermission)
{
value = EFalse;
}
- value = aRightsClient->CheckRights(EExecute, *aDcfFile.iContentID, reason);
- if(value != KErrCANoRights || KErrCANoPermission)
+ if(value)
{
- value = EFalse;
+ ret = aRightsClient->CheckRights(EView, *aDcfFile.iContentID, reason);
+ if(ret != KErrCANoRights && ret != KErrCANoPermission)
+ {
+ value = EFalse;
+ }
}
- value = aRightsClient->CheckRights(EPrint, *aDcfFile.iContentID, reason);
- if(value != KErrCANoRights || KErrCANoPermission)
+ if(value)
{
- value = EFalse;
+ ret = aRightsClient->CheckRights(EExecute, *aDcfFile.iContentID, reason);
+ if(ret != KErrCANoRights && ret != KErrCANoPermission)
+ {
+ value = EFalse;
+ }
}
-
+ if(value)
+ {
+ ret = aRightsClient->CheckRights(EPrint, *aDcfFile.iContentID, reason);
+ if(ret != KErrCANoRights && ret != KErrCANoPermission)
+ {
+ value = EFalse;
+ }
+ }
}
break;
default:
@@ -854,7 +876,6 @@
RDRMRightsClient* aRightsClient)
{
TInt err = KErrCANotSupported;
- TInt ret = KErrNone;
HBufC* b = NULL;
COma1Dcf* dcf1 = NULL;
COma2Dcf* dcf2 = NULL;
--- a/omadrm/drmengine/group/CryptoPrep.flm Thu Oct 14 13:45:23 2010 +0300
+++ b/omadrm/drmengine/group/CryptoPrep.flm Wed Oct 20 14:56:54 2010 +0300
@@ -13,38 +13,68 @@
# Description: DRM Crypto Library build configuration
#
-CREATABLEPATH:=$(EXTENSION_ROOT)/../drmengine/drmcrypto/build
-CLEANTARGETS:=$(CREATABLEPATH)/cmlacrypto.cpp $(CREATABLEPATH)/omacrypto.cpp
-
-crypto_files:=$(wildcard $(EXTENSION_ROOT)/../drmengine/drmcrypto/CMLA/*.cpp)
+ifeq ($(_CRYPTOPREP_FLM_),)
+# first instance of this FLM
+_CRYPTOPREP_FLM_:= 1
-GUARD:=done_$(call sanitise,$(CLEANTARGETS))
-ifeq ($($(GUARD)),)
-$(GUARD):=1
+# NB: abspath doesn't like Windows drive letters
+CRYPTO_SOURCE_DRIVE:=$(firstword $(subst :, ,$(EXTENSION_ROOT)))
+ifeq ($(CRYPTO_SOURCE_DRIVE),$(EXTENSION_ROOT))
+CRYPTO_ROOT:=$(abspath $(EXTENSION_ROOT)/../drmengine/drmcrypto))
+else
+CRYPTO_SOURCE_REST:=$(subst $(CRYPTO_SOURCE_DRIVE):, ,$(EXTENSION_ROOT)/../drmengine/drmcrypto)
+CRYPTO_ABSPATH:=$(abspath $(CRYPTO_SOURCE_REST))
-BITMAP :: $(CREATABLEPATH)
+#Ensure that drive letter appears in absolute path once and only once.
+ifeq (,$(findstring $(CRYPTO_SOURCE_DRIVE):,$(CRYPTO_ABSPATH)))
+CRYPTO_ROOT:=$(CRYPTO_SOURCE_DRIVE):$(CRYPTO_ABSPATH)
+else
+CRYPTO_ROOT:=$(CRYPTO_ABSPATH)
+endif
+
+endif
+
+CREATABLEPATH:=$(CRYPTO_ROOT)/build
+
+crypto_files:=$(wildcard $(CRYPTO_ROOT)/CMLA/*.cpp)
ifeq ($(crypto_files),)
- $(GNUCP) $(CREATABLEPATH)/../stub/CmlaCryptoStub.cpp $(CREATABLEPATH)/cmlacrypto.cpp
+CMLA_CRYPTO_SOURCE:=$(CRYPTO_ROOT)/stub/CmlaCryptoStub.cpp
else
- $(GNUCP) $(CREATABLEPATH)/../CMLA/CmlaCrypto.cpp $(CREATABLEPATH)/cmlacrypto.cpp
+CMLA_CRYPTO_SOURCE:=$(CRYPTO_ROOT)/CMLA/CmlaCrypto.cpp
endif
- $(GNUCP) $(CREATABLEPATH)/../src/OmaCrypto.cpp $(CREATABLEPATH)/omacrypto.cpp
- $(GNUCHMOD) u+w $(CREATABLEPATH)/cmlacrypto.cpp
- $(GNUCHMOD) u+w $(CREATABLEPATH)/omacrypto.cpp
+CLEANTARGETS:=$(CREATABLEPATH)/cmlacrypto.cpp
+
+define drmcryptoprep
+
+BITMAP:: $(CLEANTARGETS)
+ $(call startrule,drmcryptoprep) \
+ echo created $(CLEANTARGETS) \
+ $(call endrule,drmcryptoprep)
+
+
+$(CLEANTARGETS): $(CMLA_CRYPTO_SOURCE)
+ $(call startrule,drmcryptoprep) \
+ $(GNUCP) $$< $$@ && \
+ $(GNUCHMOD) u+w $$@ \
+ $(call endrule,drmcryptoprep)
+
+endef
# Create dirs
$(call makepath,$(CREATABLEPATH))
-
+$(eval $(call drmcryptoprep))
## Clean up
$(eval $(call GenerateStandardCleanTarget,$(CLEANTARGETS)))
## What
$(eval $(call whatmacro,$(CLEANTARGETS)))
+$(info <debug>$(PLATFORM) $(CFG), selecting $(CMLA_CRYPTO_SOURCE)</debug>)
else
-$(info <debug>$(PLATFORM) $(CFG), up-to-date $(CLEANTARGETS)</debug>)
+$(info <debug>$(PLATFORM) $(CFG), already handled $(CMLA_CRYPTO_SOURCE)</debug>)
+# FLM already included - don't duplicate the targets
endif
--- a/omadrm/drmengine/group/DrmCrypto.mmp Thu Oct 14 13:45:23 2010 +0300
+++ b/omadrm/drmengine/group/DrmCrypto.mmp Wed Oct 20 14:56:54 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 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"
@@ -37,8 +37,11 @@
SOURCE drmaescrypto.cpp
+SOURCEPATH ../drmcrypto/src
+SOURCE OmaCrypto.cpp
+
+
SOURCEPATH ../drmcrypto/build
-SOURCE omacrypto.cpp
SOURCE cmlacrypto.cpp
LIBRARY euser.lib
--- a/omadrm/drmhelper/src/drmhelper.cpp Thu Oct 14 13:45:23 2010 +0300
+++ b/omadrm/drmhelper/src/drmhelper.cpp Wed Oct 20 14:56:54 2010 +0300
@@ -946,18 +946,21 @@
error = stringAttributeSet.GetValue( EContentID, ptr );
if ( error == KErrNone )
{
+ // If return value is erroneous it is ignored
ptr.Set( domainRoUrl->Des() );
- stringAttributeSet.GetValue( EDomainRightsIssuerUrl, ptr );
-
+ error = stringAttributeSet.GetValue( EDomainRightsIssuerUrl, ptr );
+
+ // If return value is erroneous it is ignored
+ ptr.Set( domainId->Des() );
+ error = stringAttributeSet.GetValue( EDomainId, ptr );
+
+ // If return value is erroneous it is ignored
+ ptr.Set( riId->Des() );
+ error = stringAttributeSet.GetValue( EDomainRightsIssuerId, ptr );
+
ptr.Set( mimeType->Des() );
error = stringAttributeSet.GetValue( EMimeType, ptr );
- ptr.Set( riId->Des() );
- stringAttributeSet.GetValue( EDomainRightsIssuerId, ptr );
-
- ptr.Set( domainId->Des() );
- stringAttributeSet.GetValue( EDomainId, ptr );
-
if ( error == KErrNone )
{
ptr.Set( eta->Des() );
@@ -2216,55 +2219,10 @@
// CDRMHelper::EmbeddedPreviewCompletedL
// -----------------------------------------------------------------------------
//
-EXPORT_C TBool CDRMHelper::EmbeddedPreviewCompletedL( CData& aContent )
- {
- TBool proceeded = EFalse;
- if ( iOma2 )
- {
- TInt error = KErrNone;
- TInt canPlay;
- HBufC* rightsIssuer = NULL;
- TInt buyRights(0);
-
- error = aContent.GetAttribute( ECanPlay, canPlay );
- if ( !error && !canPlay )
- {
- TFileName fileName;
-
- // Get RI URL
- GetRightsIssuerL( aContent, rightsIssuer );
- CleanupStack::PushL( rightsIssuer );
- // Ask if user wants to buy rights
- error = aContent.GetStringAttribute( EFileName, fileName );
- if ( !error )
- {
- if ( buyRights )
- {
- // launch browser
- LaunchBrowserL( rightsIssuer );
- proceeded = ETrue;
- }
- else
- {
- proceeded = EFalse;
- }
- }
- else
- {
- User::Leave( KErrArgument );
- }
- CleanupStack::PopAndDestroy( rightsIssuer );
- }
- else
- {
- User::Leave( KErrArgument );
- }
- }
- else
- {
- User::Leave( KErrNotSupported );
- }
- return proceeded;
+EXPORT_C TBool CDRMHelper::EmbeddedPreviewCompletedL( CData& /*aContent*/ )
+ {
+ // Functionality not supported currently
+ return EFalse;
}
@@ -3279,7 +3237,11 @@
}
if ( aConstraint->GetStartTime( startTime ) == DRMCommon::EOk )
{
- aConstraint->GetEndTime( endTime );
+ if ( aConstraint->GetEndTime( endTime ) != DRMCommon::EOk )
+ {
+ // End time is not defined for the constraint
+ endTime = Time::NullTTime();
+ }
aDuration = endTime.DaysFrom( startTime );
ret |= KDRMHelperConstraintTime;
}
--- a/package_definition.xml Thu Oct 14 13:45:23 2010 +0300
+++ b/package_definition.xml Wed Oct 20 14:56:54 2010 +0300
@@ -85,6 +85,7 @@
</collection>
<collection id="commondrm" name="Common DRM" level="generic">
<!-- it looks like this collection would be better as a component. If so, move down a directory. Otherwise, split up the bld.inf -->
+ <!--
<component id="drmqtencryptor" filter="s60" name="DRM Qt Encryptor" introduced="^4">
<unit bldFile="commondrm/drmqtencryptor" qt:proFile="qt_drmencryptor.pro" />
</component>
@@ -100,6 +101,7 @@
<component id="drmrightsstoringlocation" filter="s60" name="DRM Rights Storing Location">
<unit bldFile="commondrm/drmrightsstoringlocation/group"/>
</component>
+ -->
<component id="commondrm_build" filter="s60" name="Common DRM Build">
<!-- should be split into the above files, or them collapsed into a single component -->
<unit bldFile="commondrm/group"/>
--- a/wmdrm/camese/httpfiltercamese/Src/httpfiltercamesedrmheader.cpp Thu Oct 14 13:45:23 2010 +0300
+++ b/wmdrm/camese/httpfiltercamese/Src/httpfiltercamesedrmheader.cpp Wed Oct 20 14:56:54 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007-2010 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"
@@ -36,7 +36,7 @@
const TUint32 KMusicServiceFeatureFlagSupport = 0x00000012; // referred from 5.0 MusicWapCenRepKeys.h - Album Download
_LIT8( KCameseDrmHeaderFilterName, "CameseDrmHeader" );
-_LIT8( KDataTypeCameseDRM,"application/vnd.ms-wmdrm.lic-chlg-req" );
+_LIT8( KDataTypeCameseDRM,"application/vnd.ms-wmdrm.lic-chlg-req" );
// ============================ MEMBER FUNCTIONS ===============================
@@ -49,7 +49,7 @@
: iSession(aSession),
iTransactionId(KErrNotFound),
iState(EIdle),
- iDataSupplierSet(EFalse)
+ iDataSupplierSet(EFalse)
{
}
@@ -60,46 +60,46 @@
// -----------------------------------------------------------------------------
//
void CHttpFilterCameseDrmHeader::ConstructL()
- {
+ {
iStringPool = iSession->StringPool();
iStringPool.OpenL(RHTTPSession::GetTable());
-
- // Filter Name
+
+ // Filter Name
RStringF filterName = iStringPool.OpenFStringL( KCameseDrmHeaderFilterName() );
CleanupClosePushL( filterName );
-
+
// Register the filter for the HTTP events we are interested.
iSession->FilterCollection().AddFilterL(*this, // The filter to add
- THTTPEvent::EGotResponseHeaders,
- RStringF(),
- KAnyStatusCode,
- KCameseDrmHeaderFilterPosition,
+ THTTPEvent::EGotResponseHeaders,
+ RStringF(),
+ KAnyStatusCode,
+ KCameseDrmHeaderFilterPosition,
filterName);
-
+
iSession->FilterCollection().AddFilterL(*this, // The filter to add
- THTTPEvent::EGotResponseBodyData,
- RStringF(),
- KAnyStatusCode,
- KCameseDrmHeaderFilterPosition,
+ THTTPEvent::EGotResponseBodyData,
+ RStringF(),
+ KAnyStatusCode,
+ KCameseDrmHeaderFilterPosition,
filterName);
-
+
iSession->FilterCollection().AddFilterL(*this, // The filter to add
- THTTPEvent::EResponseComplete,
- RStringF(),
- KAnyStatusCode,
- KCameseDrmHeaderFilterPosition,
+ THTTPEvent::EResponseComplete,
+ RStringF(),
+ KAnyStatusCode,
+ KCameseDrmHeaderFilterPosition,
filterName);
-
+
iSession->FilterCollection().AddFilterL(*this, // The filter to add
- THTTPEvent::ECancel,
- RStringF(),
- KAnyStatusCode,
- KCameseDrmHeaderFilterPosition,
+ THTTPEvent::ECancel,
+ RStringF(),
+ KAnyStatusCode,
+ KCameseDrmHeaderFilterPosition,
filterName);
-
- CleanupStack::PopAndDestroy(&filterName);
+
+ CleanupStack::PopAndDestroy(&filterName);
}
//------------------------------------------------------------------------------
@@ -110,23 +110,23 @@
{
CAMESE_LOG("CHttpFilterCameseDrmHeader::~CHttpFilterCameseDrmHeader");
- Reset();
- if ( iLoadCount )
- {
- // As we're already in a destructor, MHFUnload must not delete us again
- iLoadCount = -1;
+ Reset();
+ if ( iLoadCount )
+ {
+ // As we're already in a destructor, MHFUnload must not delete us again
+ iLoadCount = -1;
RStringF filterName;
- TRAPD( error, filterName = iStringPool.OpenFStringL(
+ TRAPD( error, filterName = iStringPool.OpenFStringL(
KCameseDrmHeaderFilterName ) );
- if ( !error && iSession )
+ if ( !error && iSession )
{
- iSession->FilterCollection().RemoveFilter( filterName );
+ iSession->FilterCollection().RemoveFilter( filterName );
}
- filterName.Close();
- }
+ filterName.Close();
+ }
delete iDlaHandler;
- }
+ }
// -----------------------------------------------------------------------------
// CHttpFilterCameseDrmHeader::NewL
@@ -137,8 +137,8 @@
{
ASSERT( aSession );
CAMESE_LOG( "CHttpFilterCameseDrmHeader::NewL" );
-
- CHttpFilterCameseDrmHeader* filter =
+
+ CHttpFilterCameseDrmHeader* filter =
new (ELeave) CHttpFilterCameseDrmHeader (reinterpret_cast< RHTTPSession* >( aSession ) );
CleanupStack::PushL( filter );
filter->ConstructL();
@@ -151,7 +151,7 @@
// -----------------------------------------------------------------------------
//
void CHttpFilterCameseDrmHeader::MHFLoad(
- RHTTPSession /*aSession*/,
+ RHTTPSession /*aSession*/,
THTTPFilterHandle /*aFilterHandler*/ )
{
CAMESE_LOG( "CHttpFilterCameseDrmHeader::MHFLoad" );
@@ -163,18 +163,18 @@
// -----------------------------------------------------------------------------
//
void CHttpFilterCameseDrmHeader::MHFUnload(
- RHTTPSession /*aSession*/,
+ RHTTPSession /*aSession*/,
THTTPFilterHandle /*aFilterHandler*/ )
{
CAMESE_LOG( "CHttpFilterCameseDrmHeader::MHFUnload" );
ASSERT( iLoadCount > 0 );
- if ( --iLoadCount )
- {
- return;
+ if ( --iLoadCount )
+ {
+ return;
}
-
- delete this;
+
+ delete this;
}
// -----------------------------------------------------------------------------
@@ -188,58 +188,58 @@
// Check if we are interested in the transaction
if ( (iTransactionId != KErrNotFound ) &&
(aTransaction.Id() != iTransactionId) )
- {
+ {
return;
}
- CAMESE_LOG1( "CHttpFilterCameseDrmHeader::MHFRunL aEvent=%i",
- aEvent.iStatus );
+ CAMESE_LOG1( "CHttpFilterCameseDrmHeader::MHFRunL aEvent=%i",
+ aEvent.iStatus );
switch( aEvent.iStatus )
{
- case THTTPEvent::EGotResponseHeaders:
- // Only interested in headers if in idle state.
- if ( iState == EIdle )
- {
+ case THTTPEvent::EGotResponseHeaders:
+ // Only interested in headers if in idle state.
+ if ( iState == EIdle )
+ {
CheckResponseHeadersL( aTransaction );
- }
- break;
-
- case THTTPEvent::EGotResponseBodyData:
- if ( iState == EDrmHeaderCapture )
- {
- CaptureDrmHeaderL( aTransaction );
- }
- break;
-
- case THTTPEvent::EResponseComplete:
- if ( iState == EDrmHeaderCapture )
- {
- RequestLicenseL( aTransaction );
- }
- break;
-
+ }
+ break;
+
+ case THTTPEvent::EGotResponseBodyData:
+ if ( iState == EDrmHeaderCapture )
+ {
+ CaptureDrmHeaderL( aTransaction );
+ }
+ break;
+
+ case THTTPEvent::EResponseComplete:
+ if ( iState == EDrmHeaderCapture )
+ {
+ RequestLicenseL( aTransaction );
+ }
+ break;
+
case THTTPEvent::ECancel:
- CAMESE_LOG(
+ CAMESE_LOG(
"CHttpFilterCameseDrmHeader::MHFRunL Handling Cancelation" );
if ( iState == ERequestingLicense )
{
// Asynchronous cancelation while the
// filter is blocked.
-
+
CAMESE_LOG(
"CHttpFilterCameseDrmHeader::MHFRunL Canceling Camese" );
// Need to unblock the license request.
if ( iDlaHandler )
{
iDlaHandler->CancelLicenseAcquisition();
- }
+ }
}
break;
-
- default:
- // Stray event
- ASSERT( ETrue );
- break;
+
+ default:
+ // Stray event
+ ASSERT( ETrue );
+ break;
}
}
@@ -247,61 +247,61 @@
//------------------------------------------------------------------------
// CHttpFilterCameseDrmHeader::CheckResponseHeadersL
//------------------------------------------------------------------------
-//
-void CHttpFilterCameseDrmHeader::CheckResponseHeadersL(
+//
+void CHttpFilterCameseDrmHeader::CheckResponseHeadersL(
RHTTPTransaction& aTrans )
- {
- RHTTPHeaders responseHeaders = aTrans.Response().GetHeaderCollection();
-
- RStringF contentTypeNameStr =
- iStringPool.StringF( HTTP::EContentType, RHTTPSession::GetTable() );
+ {
+ RHTTPHeaders responseHeaders = aTrans.Response().GetHeaderCollection();
- // read the first part of content-type field
- THTTPHdrVal contentTypeVal;
+ RStringF contentTypeNameStr =
+ iStringPool.StringF( HTTP::EContentType, RHTTPSession::GetTable() );
+
+ // read the first part of content-type field
+ THTTPHdrVal contentTypeVal;
- if( !responseHeaders.GetField( contentTypeNameStr, 0, contentTypeVal ) )
- {
- if ( contentTypeVal.StrF().DesC().MatchF( KDataTypeCameseDRM ) !=
+ if( !responseHeaders.GetField( contentTypeNameStr, 0, contentTypeVal ) )
+ {
+ if ( contentTypeVal.StrF().DesC().MatchF( KDataTypeCameseDRM ) !=
KErrNotFound )
- {
- CAMESE_LOG( "CHttpFilterCameseDrmHeader::CheckResponseHeaders Found Drm Header" );
+ {
+ CAMESE_LOG( "CHttpFilterCameseDrmHeader::CheckResponseHeaders Found Drm Header" );
StartDrmHeaderCaptureL( aTrans );
- }
- }
+ }
+ }
}
-
+
//------------------------------------------------------------------------
// CHttpFilterCameseDrmHeader::StartDrmHeaderCaptureL
//------------------------------------------------------------------------
-//
-void CHttpFilterCameseDrmHeader::StartDrmHeaderCaptureL(
+//
+void CHttpFilterCameseDrmHeader::StartDrmHeaderCaptureL(
RHTTPTransaction& aTrans )
- {
+ {
// Start processing the Drm Header Packet.
RHTTPHeaders responseHeaders = aTrans.Response().GetHeaderCollection();
- RStringF contentTypeNameStr =
+ RStringF contentTypeNameStr =
iStringPool.StringF( HTTP::EContentType, RHTTPSession::GetTable() );
- RStringF cacheControlStr =
+ RStringF cacheControlStr =
iStringPool.StringF( HTTP::ECacheControl, RHTTPSession::GetTable() );
- RStringF noCacheVal =
+ RStringF noCacheVal =
iStringPool.StringF( HTTP::ENoCache, RHTTPSession::GetTable() );
-
+
// Cache the transaction id
iTransactionId = aTrans.Id();
-
+
// Add a Cache-Control field indicating no-cache.
// This will keep our response from being cached.
responseHeaders.SetFieldL( cacheControlStr, THTTPHdrVal( noCacheVal ) );
- // Set the HTTP Status code as KErrCompletion -
+ // Set the HTTP Status code as KErrCompletion -
// this will avoid letting download manager finalize
// the temporary drm header download.
-
+
// Album - Album Download
-
+
TInt value( 0 );
TBool omaDdSupported( EFalse );
-
+
CRepository* repository( NULL );
TRAPD( err, repository = CRepository::NewL( KCRUidMusicShopSettings ) );
@@ -310,7 +310,7 @@
// read value of KMusicServiceFeatureFlagSupport from repository
// KCRUidMusicShopSettings and check if KSupportOmaDownloadDescriptor bit is set
// in that value
-
+
err = repository->Get( KMusicServiceFeatureFlagSupport, value );
if ( !err )
{
@@ -320,54 +320,54 @@
omaDdSupported = ETrue;
}
}
-
+
delete repository;
}
if ( !omaDdSupported )
- {
+ {
aTrans.Response().SetStatusCode( KErrCompletion );
}
-
+
// Album - Album Download
// Change state to DRM Header Capture mode.
- iState = EDrmHeaderCapture;
+ iState = EDrmHeaderCapture;
}
//------------------------------------------------------------------------
// CHttpFilterCameseDownloader::ConnectionAccessPoint
//------------------------------------------------------------------------
-//
+//
TInt CHttpFilterCameseDrmHeader::ConnectionAccessPoint(
RHTTPTransaction& aTrans )
{
TInt ap( 0 );
-
- // Retrieve connection information from the http session
+
+ // Retrieve connection information from the http session
const RHTTPConnectionInfo& connInfo = aTrans.Session().ConnectionInfo();
RConnection* connPtr = NULL;
-
+
THTTPHdrVal connHeader;
TBool hasConnValue = connInfo.Property(
- iStringPool.StringF(
+ iStringPool.StringF(
HTTP::EHttpSocketConnection, RHTTPSession::GetTable() ),
connHeader );
-
- // If we have access to the RConnection pointer, try to retrieve the IAP id.
+
+ // If we have access to the RConnection pointer, try to retrieve the IAP id.
if ( hasConnValue )
{
// Got RConnection Property
connPtr = REINTERPRET_CAST( RConnection*, connHeader.Int() );
-
+
// Now retrieve the access point id.
if ( connPtr )
- {
+ {
TConnectionInfo connectionInfo;
TUint count = 0;
if ( !connPtr->EnumerateConnections(count) )
- {
+ {
TPckg<TConnectionInfo> pkg(connectionInfo);
if ( !connPtr->GetConnectionInfo( 1, pkg ) )
{
@@ -376,91 +376,91 @@
}
}
}
-
- return ap;
+
+ return ap;
}
//------------------------------------------------------------------------
// CHttpFilterCameseDownloader::CaptureDrmHeaderL
//------------------------------------------------------------------------
-//
-void CHttpFilterCameseDrmHeader::CaptureDrmHeaderL(
+//
+void CHttpFilterCameseDrmHeader::CaptureDrmHeaderL(
RHTTPTransaction& aTrans )
- {
+ {
TPtrC8 ptr;
- MHTTPDataSupplier* dataSupplier = aTrans.Response().Body();
+ MHTTPDataSupplier* dataSupplier = aTrans.Response().Body();
dataSupplier->GetNextDataPart( ptr );
// Append to iDrmHeaderBuffer
if ( !iDrmHeaderBuffer )
{
- iDrmHeaderBuffer = ptr.AllocL();
- }
+ iDrmHeaderBuffer = ptr.AllocL();
+ }
else
- {
- iDrmHeaderBuffer = iDrmHeaderBuffer->ReAllocL(
- iDrmHeaderBuffer->Length() + ptr.Length() );
- iDrmHeaderBuffer->Des().Append( ptr );
- }
+ {
+ iDrmHeaderBuffer = iDrmHeaderBuffer->ReAllocL(
+ iDrmHeaderBuffer->Length() + ptr.Length() );
+ iDrmHeaderBuffer->Des().Append( ptr );
+ }
- if ( !iDataSupplierSet )
- {
+ if ( !iDataSupplierSet )
+ {
// Feed the actual client with our data supplier, that will feed an empty
// descriptor.
delete iClientDataSupplier;
- iClientDataSupplier = NULL;
- iClientDataSupplier =
+ iClientDataSupplier = NULL;
+ iClientDataSupplier =
CHttpFilterCameseDataSupplier::NewL( aTrans.Response().Body(),
KNullDesC8() );
-
+
aTrans.Response().SetBody( *iClientDataSupplier );
iDataSupplierSet = ETrue;
- }
+ }
}
//------------------------------------------------------------------------
// CHttpFilterCameseDrmHeader::RequestLicenseL
//------------------------------------------------------------------------
-//
+//
void CHttpFilterCameseDrmHeader::RequestLicenseL( RHTTPTransaction& aTrans )
- {
+ {
ASSERT( iDrmHeaderBuffer );
CAMESE_LOG(
"CHttpFilterCameseDrmHeader::RequestLicenseL Passing in Drm Header" );
-
+
if ( !iDlaHandler )
{
iDlaHandler = CWmDrmDlaHandler::NewL();
}
-
+
// Pass in our current access point to the drm interface.
iDlaHandler->SetIapId( ConnectionAccessPoint( aTrans ) );
-
+
// Use the Camese Interface, passing in
// the DRM header url. WMDRM DLA Handler uses it for
// error reporting.
- HBufC8* errorUrl8( aTrans.Request().URI().UriDes().AllocLC() );
+ HBufC8* errorUrl8( aTrans.Request().URI().UriDes().AllocLC() );
HBufC* errorUrl( CnvUtfConverter::ConvertToUnicodeFromUtf8L( *errorUrl8 ) );
CleanupStack::PushL( errorUrl );
-
+
HBufC* contentUrl( NULL );
HBufC* htmlData( NULL );
-
+
// Update state
iState = ERequestingLicense;
-
+
// This call blocks and only returns after Camese is done with the licensing
// process.
TRAPD( result, iDlaHandler->AcquireLicenseFromDrmHeaderL( *iDrmHeaderBuffer,
errorUrl,
contentUrl,
htmlData ) );
-
+
CAMESE_LOG("CHttpFilterCameseDrmHeader::RequestLicenseL Unblocked");
-
+
delete htmlData;
-
+
HBufC8* contentUrl8( NULL );
if ( contentUrl )
{
@@ -469,50 +469,50 @@
CleanupStack::PopAndDestroy( contentUrl );
}
CleanupStack::PushL( contentUrl8 );
-
-
+
+
// Check if the filter has not been canceled.
if ( result != KErrCancel )
- {
+ {
HandleRedirectL( result, aTrans, contentUrl8 );
}
CleanupStack::PopAndDestroy( 3, errorUrl8 ); //contentUrl8, errorUrl, errorUrl8
-
- // Reset state machine.
- Reset();
+
+ // Reset state machine.
+ Reset();
}
//------------------------------------------------------------------------
// CHttpFilterCameseDrmHeader::HandleRedirectL
//------------------------------------------------------------------------
-//
+//
void CHttpFilterCameseDrmHeader::HandleRedirectL(
- TInt aResult,
+ TInt CAMESE_LOG_DEF( aResult ),
RHTTPTransaction& aTrans,
HBufC8*& aContentUrl )
- {
+ {
// Now check if we have a content URL to redirect to,
// and if the content URL is not the DRM Header URL we
// passed in.
if ( aContentUrl && aContentUrl->CompareF( aTrans.Request().URI().UriDes() ) )
- {
+ {
TUriParser8 uri;
TInt err = uri.Parse( *aContentUrl );
-
+
if ( !err )
- {
- CAMESE_LOG(
+ {
+ CAMESE_LOG(
"CHttpFilterCameseDrmHeader::RequestLicenseL Redirecting" );
- CAMESE_LOG8_1( " > ContentUrl = %S", aContentUrl );
+ CAMESE_LOG8_1( " > ContentUrl = %S", aContentUrl );
CAMESE_LOG1( " > Licensing Result = %d", aResult );
-
+
// Cancel the Transaction.
aTrans.Cancel();
// Set new URI - could be content or error page.
aTrans.Request().SetURIL( uri );
-
-
+
+
// update for - Album Download
// Manually replace HOST firld in the HTTP header to reflect the new host
//
@@ -522,35 +522,35 @@
TInt error = headers.RemoveField(hostStr);
CAMESE_LOG1(" error for removing HOST field from header = %d", error);
if (error == KErrNone || error == KErrNotFound)
- {
- HBufC* host =aTrans.Request().URI().DisplayFormL(EUriHost);
- CleanupStack::PushL(host);
- HBufC8* host8 = HBufC8::NewL(host->Length());
- CleanupStack::PushL(host8);
- host8->Des().Copy(*host);
- CAMESE_LOG8_1(" > new host = %S", host8);
- RStringF hostValueStr = aTrans.Session().StringPool().OpenFStringL(*host8);
- CleanupClosePushL<RStringF>(hostValueStr);
- headers.SetFieldL( hostStr, THTTPHdrVal(hostValueStr) );
- CleanupStack::PopAndDestroy(3, host); // hostValueStr, host8, host
- }
+ {
+ HBufC* host =aTrans.Request().URI().DisplayFormL(EUriHost);
+ CleanupStack::PushL(host);
+ HBufC8* host8 = HBufC8::NewL(host->Length());
+ CleanupStack::PushL(host8);
+ host8->Des().Copy(*host);
+ CAMESE_LOG8_1(" > new host = %S", host8);
+ RStringF hostValueStr = aTrans.Session().StringPool().OpenFStringL(*host8);
+ CleanupClosePushL<RStringF>(hostValueStr);
+ headers.SetFieldL( hostStr, THTTPHdrVal(hostValueStr) );
+ CleanupStack::PopAndDestroy(3, host); // hostValueStr, host8, host
+ }
else
- {
- User::Leave(error);
- }
+ {
+ User::Leave(error);
+ }
CleanupStack::PopAndDestroy(&hostStr);
// update end for - Album Download
-
- // Submit the new transaction.
- aTrans.SubmitL();
+
+ // Submit the new transaction.
+ aTrans.SubmitL();
}
else
{
- CAMESE_LOG(
+ CAMESE_LOG(
"CHttpFilterCameseDrmHeader::RequestLicenseL Malformed Url" );
// Fail the transaction
aTrans.Fail();
- }
+ }
}
else
{
@@ -565,18 +565,18 @@
// -----------------------------------------------------------------------------
//
void CHttpFilterCameseDrmHeader::Reset()
- {
- CAMESE_LOG("CHttpFilterCameseDrmHeader::Reset");
+ {
+ CAMESE_LOG("CHttpFilterCameseDrmHeader::Reset");
iState = EIdle;
iTransactionId = KErrNotFound;
-
+
delete iDrmHeaderBuffer;
- iDrmHeaderBuffer = NULL;
-
+ iDrmHeaderBuffer = NULL;
+
delete iClientDataSupplier;
iClientDataSupplier = NULL;
iDataSupplierSet = EFalse;
-
+
delete iDlaHandler;
iDlaHandler = NULL;
}
@@ -586,17 +586,17 @@
// -----------------------------------------------------------------------------
//
TInt CHttpFilterCameseDrmHeader::MHFRunError(
- TInt aError,
+ TInt CAMESE_LOG_DEF( aError ),
RHTTPTransaction aTransaction,
- const THTTPEvent& aEvent )
+ const THTTPEvent& CAMESE_LOG_DEF( aEvent ) )
{
// Log errors
CAMESE_LOG2("CHttpFilterCameseDrmHeader::MHFRunError Error = %i Event = %i",
aError,
aEvent.iStatus);
-
+
aTransaction.Fail();
-
+
Reset();
return KErrNone;
}
--- a/wmdrm/camese/inc/cameselog.h Thu Oct 14 13:45:23 2010 +0300
+++ b/wmdrm/camese/inc/cameselog.h Wed Oct 20 14:56:54 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007i-2010 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"
@@ -70,6 +70,7 @@
};
// MACROS
+#define CAMESE_LOG_DEF(a) a
#define CAMESE_LOG_TDES(fmt) CameseLog::Printf1(fmt)
#define CAMESE_LOG(fmt) CameseLog::Printf1(_L(fmt))
#define CAMESE_LOG1(fmt,v1) CameseLog::Printf(_L(fmt),v1)
@@ -105,15 +106,16 @@
#else
+#define CAMESE_LOG_DEF(a)
#define CAMESE_LOG_TDES(fmt)
#define CAMESE_LOG(fmt)
#define CAMESE_LOG1(fmt,v1)
#define CAMESE_LOG2(fmt,v1,v2)
#define CAMESE_LOG3(fmt,v1,v2,v3)
#define CAMESE_HEX_DUMP(h, m, p, l)
-#define CAMESE_LOG8(fmt)
-#define CAMESE_LOG8_1(fmt,v1)
-#define CAMESE_LOG8_2(fmt,v1,v2)
+#define CAMESE_LOG8(fmt)
+#define CAMESE_LOG8_1(fmt,v1)
+#define CAMESE_LOG8_2(fmt,v1,v2)
#define CAMESE_LOG8_3(fmt,v1,v2,v3)
#endif
--- a/wmdrm/wmdrmengine/wmdrmserver/server/src/wmdrmsession.cpp Thu Oct 14 13:45:23 2010 +0300
+++ b/wmdrm/wmdrmengine/wmdrmserver/server/src/wmdrmsession.cpp Wed Oct 20 14:56:54 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007-2010 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"
@@ -42,23 +42,23 @@
//---------------------------------------------------------------------------
//
CWmDrmSession::CWmDrmSession()
- {
- }
+ {
+ }
//---------------------------------------------------------------------------
// CWmDrmSession::~CWmDrmSession
// Destructor
//---------------------------------------------------------------------------
-//
+//
CWmDrmSession::~CWmDrmSession()
- {
- LOGFN( "CWmDrmSession::~CWmDrmSession" );
+ {
+ LOGFN( "CWmDrmSession::~CWmDrmSession" );
//Server().Cache()->FlushL();
- delete iEnumerator;
- iEnumerator = NULL;
+ delete iEnumerator;
+ iEnumerator = NULL;
delete iSlot;
- iSlot = NULL;
- }
+ iSlot = NULL;
+ }
//---------------------------------------------------------------------------
// CWmDrmSession::InitStoreL
@@ -68,7 +68,7 @@
{
TInt r = KErrNone;
TBuf8<KMaxWmDrmStoreNameSize> store;
-
+
LOGFNR( "CWmDrmSession::InitStoreL", r );
if ( aMessage.GetDesLength( 0 ) > KMaxWmDrmStoreNameSize || aMessage.GetDesLength( 0 ) <= 0 )
{
@@ -86,12 +86,12 @@
//---------------------------------------------------------------------------
// CWmDrmSession::RemoveStoreL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::RemoveStoreL( const RMessage2& aMessage )
{
TInt r = KErrNone;
TBuf8<KMaxWmDrmStoreNameSize> store;
-
+
LOGFNR( "CWmDrmSession::RemoveStoreL", r );
if ( aMessage.GetDesLength( 0 ) > KMaxWmDrmStoreNameSize || aMessage.GetDesLength( 0 ) <= 0 )
{
@@ -106,13 +106,13 @@
//---------------------------------------------------------------------------
// CWmDrmSession::InitNamespaceL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::InitNamespaceL( const RMessage2& aMessage )
{
TInt r = KErrNone;
TBuf8<KMaxWmDrmStoreNameSize> store;
TBuf8<KMaxWmDrmNamespaceNameSize> nameSpace;
-
+
LOGFNR( "CWmDrmSession::InitNamespaceL", r );
// :KLUDGE: Note: store length of zero is allowed
if ( aMessage.GetDesLengthL( 0 ) > KMaxWmDrmStoreNameSize ||
@@ -139,13 +139,13 @@
//---------------------------------------------------------------------------
// CWmDrmSession::RemoveNamespaceL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::RemoveNamespaceL( const RMessage2& aMessage )
{
TInt r = KErrNone;
TBuf8<KMaxWmDrmStoreNameSize> store;
TBuf8<KMaxWmDrmNamespaceNameSize> nameSpace;
-
+
LOGFNR( "CWmDrmSession::RemoveNamespaceL", r );
// :KLUDGE: Note: store length of zero is allowed
if ( aMessage.GetDesLengthL( 0 ) > KMaxWmDrmStoreNameSize ||
@@ -172,13 +172,13 @@
//---------------------------------------------------------------------------
// CWmDrmSession::SlotOpenL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::SlotOpenL( const RMessage2& aMessage )
{
TInt r = KErrNone;
RBuf8 messageBuffer;
- TInt size;
-
+ TInt size;
+
LOGFNR( "CWmDrmSession::SlotOpenL", r );
if ( aMessage.GetDesLength( 0 ) > KMaxSlotNameSize || aMessage.GetDesLength( 0 ) <= 0 )
{
@@ -202,13 +202,13 @@
//---------------------------------------------------------------------------
// CWmDrmSession::SlotCreateL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::SlotCreateL( const RMessage2& aMessage )
{
TInt r = KErrNone;
RBuf8 messageBuffer;
- TInt size;
-
+ TInt size;
+
LOGFNR( "CWmDrmSession::SlotCreateL", r );
if ( aMessage.GetDesLength( 0 ) > KMaxSlotNameSize || aMessage.GetDesLength( 0 ) <= 0 )
{
@@ -223,7 +223,7 @@
delete iSlot;
iSlot = NULL;
}
-
+
iSlot = CSlot::NewL( &Server(), messageBuffer );
iSlot->CreateL( size );
CleanupStack::PopAndDestroy( &messageBuffer );
@@ -233,14 +233,14 @@
//---------------------------------------------------------------------------
// CWmDrmSession::SlotSeekL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::SlotSeekL( const RMessage2& aMessage )
{
TInt r = KErrNone;
TSeek whence = ESeekStart;
TInt pos = aMessage.Int0();
TInt size;
-
+
LOGFNR( "CWmDrmSession::SlotSeekL", r );
if ( iSlot == NULL )
{
@@ -278,13 +278,13 @@
//---------------------------------------------------------------------------
// CWmDrmSession::SlotReadL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::SlotReadL( const RMessage2& aMessage )
{
TInt r = KErrNone;
RBuf8 buf;
TInt amountRead = 0;
-
+
LOGFNR( "CWmDrmSession::SlotReadL", r );
if ( iSlot == NULL )
{
@@ -306,12 +306,12 @@
//---------------------------------------------------------------------------
// CWmDrmSession::SlotWriteL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::SlotWriteL( const RMessage2& aMessage )
{
TInt r = KErrNone;
RBuf8 buf;
-
+
LOGFNR( "CWmDrmSession::SlotWriteL", r );
if ( iSlot == NULL )
{
@@ -324,11 +324,11 @@
CleanupStack::PopAndDestroy( &buf );
return r;
}
-
+
TInt CWmDrmSession::SlotResizeL( const RMessage2& aMessage )
{
TInt r = KErrNone;
-
+
LOGFNR( "CWmDrmSession::SlotResizeL", r );
if ( iSlot == NULL )
{
@@ -341,12 +341,12 @@
//---------------------------------------------------------------------------
// CWmDrmSession::SlotDeleteL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::SlotDeleteL( const RMessage2& aMessage )
{
TInt r = KErrNone;
RBuf8 messageBuffer;
-
+
LOGFNR( "CWmDrmSession::SlotDeleteL", r );
if ( aMessage.GetDesLength( 0 ) > KMaxSlotNameSize )
{
@@ -371,11 +371,11 @@
//---------------------------------------------------------------------------
// CWmDrmSession::SlotCloseL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::SlotCloseL( const RMessage2& /*aMessage*/ )
{
TInt r = KErrNone;
-
+
LOGFNR( "CWmDrmSession::SlotCloseL", r );
if ( iSlot == NULL )
{
@@ -389,12 +389,12 @@
//---------------------------------------------------------------------------
// CWmDrmSession::EnumerateStartL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::EnumerateStartL( const RMessage2& aMessage )
{
TInt r = KErrNone;
RBuf8 messageBuffer;
-
+
LOGFNR( "CWmDrmSession::EnumerateStartL", r );
if ( aMessage.GetDesLength( 0 ) > KMaxSlotNameSize || aMessage.GetDesLength( 0 ) <= 0 )
{
@@ -422,13 +422,13 @@
//---------------------------------------------------------------------------
// CWmDrmSession::EnumerateReloadL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::EnumerateReloadL( const RMessage2& aMessage )
{
TInt r = KErrNone;
TBuf8<KWmDrmIdSize> hash;
TBuf8<KWmDrmIdSize> id;
-
+
LOGFNR( "CWmDrmSession::EnumerateReloadL", r );
if ( iEnumerator == NULL )
{
@@ -448,13 +448,13 @@
//---------------------------------------------------------------------------
// CWmDrmSession::EnumerateNextL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::EnumerateNextL( const RMessage2& aMessage )
{
TInt r = KErrNone;
TBuf8<KWmDrmIdSize> hash;
TBuf8<KWmDrmIdSize> id;
-
+
LOGFNR( "CWmDrmSession::EnumerateNextL", r );
if ( iEnumerator == NULL )
{
@@ -478,11 +478,11 @@
//---------------------------------------------------------------------------
// CWmDrmSession::EnumerateDeleteL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::EnumerateDeleteL ( const RMessage2& /*aMessage*/ )
{
TInt r = KErrNone;
-
+
LOGFNR( "CWmDrmSession::EnumerateDeleteL", r );
if ( iEnumerator == NULL )
{
@@ -499,7 +499,7 @@
TInt CWmDrmSession::EnumerateEndL ( const RMessage2& /*aMessage*/ )
{
TInt r = KErrNone;
-
+
LOGFNR( "CWmDrmSession::EnumerateEndL", r );
if ( iEnumerator == NULL )
{
@@ -518,7 +518,7 @@
TInt CWmDrmSession::EmptyCacheL( const RMessage2& aMessage )
{
TInt r = KErrNone;
-
+
LOGFNR( "CWmDrmSession::EmptyCacheL", r );
TRAP_IGNORE( EnumerateEndL( aMessage ) );
TRAP_IGNORE( SlotCloseL( aMessage ) );
@@ -529,19 +529,19 @@
//---------------------------------------------------------------------------
// CWmDrmSession::LogStats
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::LogStats( const RMessage2& /*aMessage*/ )
{
TInt r = KErrNone;
-#ifdef _LOGGING
+#ifdef _LOGGING
TInt cells;
TInt amount;
TInt i;
TInt j;
_LIT( KStatsDir, "wmdrm" );
_LIT( KStatsFile, "wmdrmserver.txt" );
-
+
LOGFNR( "CWmDrmSession::LogStatsL", r );
cells = User::AllocSize( amount );
RFileLogger::Write( KStatsDir, KStatsFile, EFileLoggingModeAppend, _L( "Statistics:" ) );
@@ -584,7 +584,7 @@
}
}
#endif
-
+
return r;
}
@@ -595,7 +595,7 @@
TInt CWmDrmSession::TimeValid( const RMessage2& /*aMessage*/ )
{
TInt r = KErrNone;
-
+
LOGFNR( "CWmDrmSession::TimeValid", r );
r = Server().Clock()->TimeIsGood();
return r;
@@ -604,52 +604,52 @@
//---------------------------------------------------------------------------
// CWmDrmSession::SetTimeAsValidL
//---------------------------------------------------------------------------
-//
+//
void CWmDrmSession::SetTimeAsValidL( const RMessage2& aMessage )
{
LOGFN( "CWmDrmSession::TimeValid" );
Server().Clock()->SetTimeAsGoodL( aMessage.Int0() == 0 ? EFalse : ETrue );
}
-
+
//---------------------------------------------------------------------------
// CWmDrmSession::DeleteRightsL
//---------------------------------------------------------------------------
-//
+//
TInt CWmDrmSession::DeleteRightsL( const RMessage2& /*aMessage*/ )
{
TInt r = KErrNone;
TBool wmDrmRightsConfigFound( EFalse );
TChar driveLetter;
TDrmScheme drmScheme( EDrmSchemeWmDrm );
-
+
LOGFNR( "CWmDrmSession::DeleteRightsL", r );
// Close EVERYTHING down, clear cache etc, so that we have nothing going on
// When we start to delete stuff
Server().ResetCacheL();
-
+
wmDrmRightsConfigFound = DrmRightsStoringLocation::CheckDrmRightsStorageDriveL(
- Server().Fs(), drmScheme, driveLetter );
-
+ Server().Fs(), drmScheme, driveLetter );
+
// If WM DRM rights storage configuration is found, update both databases
if ( wmDrmRightsConfigFound )
{
- Server().DataStore()->UpdateDummyDbFileL(
- Server().DataStore()->DummyDBSizeL( ETrue ), ETrue );
- }
- Server().DataStore()->UpdateDummyDbFileL(
+ Server().DataStore()->UpdateDummyDbFileL(
+ Server().DataStore()->DummyDBSizeL( ETrue ), ETrue );
+ }
+ Server().DataStore()->UpdateDummyDbFileL(
Server().DataStore()->DummyDBSizeL( EFalse ), EFalse );
-
+
// Delete license store
Server().Db()->DeleteLicenseStoreL();
-
- // If WM DRM rights storage configuration is found, update both databases
+
+ // If WM DRM rights storage configuration is found, update both databases
if ( wmDrmRightsConfigFound )
- {
- Server().DataStore()->UpdateDummyDbFileL( 0, ETrue );
- }
+ {
+ Server().DataStore()->UpdateDummyDbFileL( 0, ETrue );
+ }
Server().DataStore()->UpdateDummyDbFileL( 0, EFalse );
-
+
return r;
}
@@ -660,7 +660,7 @@
void CWmDrmSession::StoreStateL( const RMessage2& aMessage )
{
TWmDrmStoreState state;
-
+
LOGFN( "CWmDrmSession::StoreStateL" );
state = Server().DataStore()->DataStoreStateL();
aMessage.WriteL( 0, TPckg<TWmDrmStoreState>( state ) );
@@ -676,12 +676,12 @@
TBool validity = EFalse;
TPckg<TTime> timePckg(time);
TPckg<TBool> validityPckg(validity);
-
+
LOGFN( "CWmDrmSession::GetTimeL" );
-
+
// Get the time from the clock
Server().Clock()->GetTimeL( time, validity );
-
+
aMessage.WriteL(0, timePckg);
aMessage.WriteL(1, validityPckg);
}
@@ -691,29 +691,29 @@
// CWmDrmSession::CommitDataL
//---------------------------------------------------------------------------
//
-void CWmDrmSession::CommitDataL( const RMessage2& aMessage )
+void CWmDrmSession::CommitDataL( const RMessage2& /*aMessage*/ )
{
-
+
LOGFN( "CWmDrmSession::CommitDataL" );
-
+
// Force a commit on the database
Server().Db()->CheckDatabaseCommitL( ETrue );
}
-
+
//---------------------------------------------------------------------------
// CWmDrmSession::ServiceL
//---------------------------------------------------------------------------
-//
+//
void CWmDrmSession::ServiceL( const RMessage2& aMessage )
- {
- TInt r = KErrNone;
- TInt trap = KErrNone;
- _LIT_SECURITY_POLICY_C1(drmCheck, ECapabilityDRM);
+ {
+ TInt r = KErrNone;
+ TInt trap = KErrNone;
+ _LIT_SECURITY_POLICY_C1(drmCheck, ECapabilityDRM);
RThread client;
-
- LOGFNR( "CWmDrmSession::ServiceL", r );
+
+ LOGFNR( "CWmDrmSession::ServiceL", r );
#ifdef _LOGGING
TInt c;
TInt s;
@@ -802,10 +802,10 @@
break;
case EGetTime:
TRAP( trap, GetTimeL( aMessage ) );
- break;
+ break;
case ECommitData:
TRAP( trap, CommitDataL( aMessage ) );
- break;
+ break;
default:
r = KErrArgument;
break;
@@ -822,24 +822,24 @@
client.Close();
LOG2( "** ServiceL error: %d", r );
aMessage.Complete( r );
- }
+ }
//---------------------------------------------------------------------------
// CWmDrmSession::ServiceError
//---------------------------------------------------------------------------
//
void CWmDrmSession::ServiceError( const RMessage2& aMessage, TInt aError )
- {
- LOGFN( "CWmDrmSession::ServiceError" );
- LOG2( "** Error: %d", aError );
- CSession2::ServiceError( aMessage, aError );
- }
+ {
+ LOGFN( "CWmDrmSession::ServiceError" );
+ LOG2( "** Error: %d", aError );
+ CSession2::ServiceError( aMessage, aError );
+ }
//---------------------------------------------------------------------------
// CWmDrmSession::Server
//---------------------------------------------------------------------------
//
CWmDrmServer& CWmDrmSession::Server()
- {
- return *static_cast<CWmDrmServer*>( const_cast<CServer2*>( CSession2::Server() ) );
- }
+ {
+ return *static_cast<CWmDrmServer*>( const_cast<CServer2*>( CSession2::Server() ) );
+ }