1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WebContentDecryptionModuleResult_h
6 #define WebContentDecryptionModuleResult_h
9 #include "WebContentDecryptionModuleException.h"
10 #include "WebPrivatePtr.h"
14 class ContentDecryptionModuleResult
;
15 class WebContentDecryptionModule
;
18 class WebContentDecryptionModuleResult
{
21 // New session has been initialized.
24 // CDM could not find the requested session.
27 // CDM already has a non-closed session that matches the provided
32 WebContentDecryptionModuleResult(const WebContentDecryptionModuleResult
& o
)
37 ~WebContentDecryptionModuleResult()
42 WebContentDecryptionModuleResult
& operator=(const WebContentDecryptionModuleResult
& o
)
48 // Called when the CDM completes an operation and has no additional data to
50 BLINK_PLATFORM_EXPORT
void complete();
52 // Called when a CDM is created.
53 BLINK_PLATFORM_EXPORT
void completeWithContentDecryptionModule(WebContentDecryptionModule
*);
55 // Called when the CDM completes a session operation.
56 BLINK_PLATFORM_EXPORT
void completeWithSession(SessionStatus
);
58 // Called when the operation fails.
59 BLINK_PLATFORM_EXPORT
void completeWithError(WebContentDecryptionModuleException
, unsigned long systemCode
, const WebString
& message
);
62 BLINK_PLATFORM_EXPORT
explicit WebContentDecryptionModuleResult(ContentDecryptionModuleResult
*);
66 BLINK_PLATFORM_EXPORT
void reset();
67 BLINK_PLATFORM_EXPORT
void assign(const WebContentDecryptionModuleResult
&);
69 WebPrivatePtr
<ContentDecryptionModuleResult
, WebPrivatePtrDestructionCrossThread
> m_impl
;
74 #endif // WebContentDecryptionModuleSession_h