Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1439)

Unified Diff: Source/modules/encryptedmedia/SimpleContentDecryptionModuleResult.h

Issue 687533004: Simplify use of ContentDecryptionModuleResult with promises (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/encryptedmedia/SimpleContentDecryptionModuleResult.h
diff --git a/Source/modules/encryptedmedia/SimpleContentDecryptionModuleResult.h b/Source/modules/encryptedmedia/SimpleContentDecryptionModuleResult.h
deleted file mode 100644
index 12ffe54d363d3b375a47f9f6415b081831193c83..0000000000000000000000000000000000000000
--- a/Source/modules/encryptedmedia/SimpleContentDecryptionModuleResult.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SimpleContentDecryptionModuleResult_h
-#define SimpleContentDecryptionModuleResult_h
-
-#include "core/dom/ExceptionCode.h"
-#include "platform/ContentDecryptionModuleResult.h"
-#include "wtf/Forward.h"
-
-namespace blink {
-
-class ScriptPromise;
-class ScriptPromiseResolver;
-class ScriptState;
-class WebString;
-
-ExceptionCode WebCdmExceptionToExceptionCode(WebContentDecryptionModuleException);
-
-// This class wraps the promise resolver and is passed (indirectly) to Chromium
-// to fullfill the promise. This implementation of complete() will resolve the
-// promise with undefined, while completeWithError() reject the promise with an
-// exception. completeWithSession() is not expected to be called, and will
-// reject the promise.
-class SimpleContentDecryptionModuleResult : public ContentDecryptionModuleResult {
-public:
- explicit SimpleContentDecryptionModuleResult(ScriptState*);
- virtual ~SimpleContentDecryptionModuleResult();
-
- // ContentDecryptionModuleResult implementation.
- virtual void complete() override;
- virtual void completeWithSession(WebContentDecryptionModuleResult::SessionStatus) override;
- virtual void completeWithError(WebContentDecryptionModuleException, unsigned long systemCode, const WebString&) override;
-
- // It is only valid to call this before completion.
- ScriptPromise promise();
-
-private:
- // Reject the promise with a DOMException.
- void completeWithDOMException(ExceptionCode, const String& errorMessage);
-
- RefPtr<ScriptPromiseResolver> m_resolver;
-};
-
-} // namespace blink
-
-#endif // SimpleContentDecryptionModuleResult_h

Powered by Google App Engine
This is Rietveld 408576698