|
1 /* |
|
2 * Copyright (c) 2008 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: WMDRM DLA Default Http PlayReady Implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <chttpformencoder.h> |
|
20 #include <httpstringconstants.h> |
|
21 #include <httperr.h> |
|
22 #include <http/rhttpheaders.h> |
|
23 #include <http/thttphdrfielditer.h> |
|
24 #include <stringpool.h> |
|
25 #include <escapeutils.h> |
|
26 #include <wmdrmdlatypes.h> |
|
27 #include <wmdrmdlauinotifier.h> |
|
28 #include "wmdrmdladefaultplayready.h" |
|
29 #include "wmdrmdladefaulthttpplugin.h" |
|
30 #include "wmdrmdladefaulthttpmanager.h" |
|
31 |
|
32 #define _LOGGING_FILE L"wmdrmdladefaulthttpplugin.txt" |
|
33 #include "logfn.h" |
|
34 |
|
35 // ======== LOCAL FUNCTIONS ======== |
|
36 |
|
37 // ======== MEMBER FUNCTIONS ======== |
|
38 |
|
39 // --------------------------------------------------------------------------- |
|
40 // CWmDrmDlaDefaultPlayReady::ConstructL |
|
41 // --------------------------------------------------------------------------- |
|
42 // |
|
43 void CWmDrmDlaDefaultPlayReady::ConstructL() |
|
44 { |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // CWmDrmDlaDefaultPlayReady::CWmDrmDlaDefaultPlayReady |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 CWmDrmDlaDefaultPlayReady::CWmDrmDlaDefaultPlayReady( |
|
52 CWmDrmDlaDefaultHttpPlugin* aPlugin ) |
|
53 : iState( CWmDrmDlaDefaultPlayReady::ENotActive ), iPlugin( aPlugin) |
|
54 { |
|
55 } |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // CWmDrmDlaDefaultPlayReady::NewL |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 CWmDrmDlaDefaultPlayReady* CWmDrmDlaDefaultPlayReady::NewL( |
|
62 CWmDrmDlaDefaultHttpPlugin* aPlugin ) |
|
63 { |
|
64 CWmDrmDlaDefaultPlayReady* self |
|
65 = new( ELeave ) CWmDrmDlaDefaultPlayReady( aPlugin ); |
|
66 CleanupStack::PushL( self ); |
|
67 self->ConstructL(); |
|
68 CleanupStack::Pop( self ); |
|
69 return self; |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // CWmDrmDlaDefaultPlayReady::~CWmDrmDlaDefaultPlayReady |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 CWmDrmDlaDefaultPlayReady::~CWmDrmDlaDefaultPlayReady() |
|
77 { |
|
78 } |
|
79 |
|
80 // --------------------------------------------------------------------------- |
|
81 // CWmDrmDlaDefaultPlayReady::SupportedInitiatorL |
|
82 // --------------------------------------------------------------------------- |
|
83 // |
|
84 TBool CWmDrmDlaDefaultPlayReady::SupportedInitiatorL( |
|
85 const TDesC8& /*aInitiator*/, |
|
86 CWmDrmDlaUiNotifier*& /*aUiNotifier*/ ) |
|
87 { |
|
88 return EFalse; |
|
89 } |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // CWmDrmDlaDefaultPlayReady::ProcessInitiatorL |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 void CWmDrmDlaDefaultPlayReady::ProcessInitiatorL( |
|
96 const TDesC8& /*aInitiator*/ ) |
|
97 { |
|
98 } |
|
99 |
|
100 // --------------------------------------------------------------------------- |
|
101 // CWmDrmDlaDefaultPlayReady::ProcessJoinDomainChallenge |
|
102 // --------------------------------------------------------------------------- |
|
103 // |
|
104 void CWmDrmDlaDefaultPlayReady::ProcessJoinDomainChallenge( |
|
105 const TDesC8& /*aJoinDomainChallenge*/, |
|
106 const TDesC& /*aUrl*/, |
|
107 TRequestStatus& aStatus ) |
|
108 { |
|
109 aStatus = KRequestPending; |
|
110 iClientStatus = &aStatus; |
|
111 CompleteClientRequest( KErrNotSupported ); |
|
112 } |
|
113 |
|
114 // --------------------------------------------------------------------------- |
|
115 // CWmDrmDlaDefaultPlayReady::ProcessLeaveDomainChallenge |
|
116 // --------------------------------------------------------------------------- |
|
117 // |
|
118 void CWmDrmDlaDefaultPlayReady::ProcessLeaveDomainChallenge( |
|
119 const TDesC8& /*aLeaveDomainChallenge*/, |
|
120 const TDesC& /*aUrl*/, |
|
121 TRequestStatus& aStatus ) |
|
122 { |
|
123 aStatus = KRequestPending; |
|
124 iClientStatus = &aStatus; |
|
125 CompleteClientRequest( KErrNotSupported ); |
|
126 } |
|
127 |
|
128 // --------------------------------------------------------------------------- |
|
129 // CWmDrmDlaDefaultHttpPlugin::SetIapId |
|
130 // --------------------------------------------------------------------------- |
|
131 // |
|
132 void CWmDrmDlaDefaultPlayReady::SetIapId( TInt /*aIapId*/ ) |
|
133 { |
|
134 } |
|
135 |
|
136 // ---------------------------------------------------------------------------- |
|
137 // CWmDrmDlaDefaultPlayReady::OnGetUsernamePasswordL |
|
138 // From MHttpManagerObserver |
|
139 // This function is called when using HTTPS authentication. Authentication is |
|
140 // not currently used in the Camese project |
|
141 // ---------------------------------------------------------------------------- |
|
142 // |
|
143 TBool CWmDrmDlaDefaultPlayReady::OnGetUsernamePasswordL( |
|
144 HBufC8*& /*aUsername*/, |
|
145 HBufC8*& /*aPassword*/) |
|
146 { |
|
147 return EFalse; |
|
148 } |
|
149 |
|
150 // ---------------------------------------------------------------------------- |
|
151 // CWmDrmDlaDefaultPlayReady::OnResponseHeadersL |
|
152 // From MHttpManagerObserver |
|
153 // ---------------------------------------------------------------------------- |
|
154 // |
|
155 void CWmDrmDlaDefaultPlayReady::OnResponseHeadersL( |
|
156 const RHTTPResponse& /*aResponse*/, |
|
157 const RHTTPHeaders& /*aHeaders*/, |
|
158 const RStringPool& /*aStringPool*/, |
|
159 TInt /*aHttpStatus*/ ) |
|
160 { |
|
161 } |
|
162 |
|
163 // ---------------------------------------------------------------------------- |
|
164 // CWmDrmDlaDefaultPlayReady::OnResponseBodyDataL |
|
165 // From MHttpManagerObserver |
|
166 // ---------------------------------------------------------------------------- |
|
167 // |
|
168 void CWmDrmDlaDefaultPlayReady::OnResponseBodyDataL( |
|
169 const TPtrC8 /*aDataChunk*/ ) |
|
170 { |
|
171 } |
|
172 |
|
173 // ---------------------------------------------------------------------------- |
|
174 // CWmDrmDlaDefaultPlayReady::OnTransactionComplete |
|
175 // From MHttpManagerObserver |
|
176 // ---------------------------------------------------------------------------- |
|
177 // |
|
178 void CWmDrmDlaDefaultPlayReady::OnTransactionComplete( TInt /*aSystemError*/ ) |
|
179 { |
|
180 } |
|
181 |
|
182 // ---------------------------------------------------------------------------- |
|
183 // CWmDrmDlaDefaultPlayReady::CompleteClientRequest |
|
184 // ---------------------------------------------------------------------------- |
|
185 // |
|
186 void CWmDrmDlaDefaultPlayReady::CompleteClientRequest( TInt aError ) |
|
187 { |
|
188 if ( iClientStatus ) |
|
189 { |
|
190 User::RequestComplete( iClientStatus, aError ); |
|
191 iClientStatus = NULL; |
|
192 } |
|
193 } |