176c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
276c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
376c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)// found in the LICENSE file.
476c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)
576c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)#include "config.h"
676c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)#include "public/platform/WebContentDecryptionModuleResult.h"
776c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)
876c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)#include "platform/ContentDecryptionModuleResult.h"
976c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)
1076c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)namespace blink {
1176c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)
1276c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)void WebContentDecryptionModuleResult::complete()
1376c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles){
1476c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    m_impl->complete();
1576c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    reset();
1676c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)}
1776c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)
1876c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)void WebContentDecryptionModuleResult::completeWithSession(SessionStatus status)
1976c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles){
2076c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    m_impl->completeWithSession(status);
2176c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    reset();
2276c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)}
2376c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)
2476c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)void WebContentDecryptionModuleResult::completeWithError(WebContentDecryptionModuleException exception, unsigned long systemCode, const WebString& errorMessage)
2576c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles){
2676c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    m_impl->completeWithError(exception, systemCode, errorMessage);
2776c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    reset();
2876c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)}
2976c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)
30e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)WebContentDecryptionModuleResult::WebContentDecryptionModuleResult(ContentDecryptionModuleResult* impl)
3176c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    : m_impl(impl)
3276c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles){
3376c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    ASSERT(m_impl.get());
3476c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)}
3576c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)
3676c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)void WebContentDecryptionModuleResult::reset()
3776c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles){
3876c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    m_impl.reset();
3976c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)}
4076c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)
4176c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)void WebContentDecryptionModuleResult::assign(const WebContentDecryptionModuleResult& o)
4276c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles){
4376c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)    m_impl = o.m_impl;
4476c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)}
4576c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)
4676c265b59aa821ccbf8c75ab2bb0d036e97d2956Torne (Richard Coles)} // namespace blink
47