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

Side by Side Diff: media/blink/webcontentdecryptionmodule_impl.cc

Issue 912233004: Explicitly differentiate key system support functions by EME version. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webcontentdecryptionmodule_impl.h" 5 #include "webcontentdecryptionmodule_impl.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
(...skipping 22 matching lines...) Expand all
33 // TODO(ddorwin): Guard against this in supported types check and remove this. 33 // TODO(ddorwin): Guard against this in supported types check and remove this.
34 // Chromium only supports ASCII key systems. 34 // Chromium only supports ASCII key systems.
35 if (!base::IsStringASCII(key_system)) { 35 if (!base::IsStringASCII(key_system)) {
36 NOTREACHED(); 36 NOTREACHED();
37 result.completeWithError( 37 result.completeWithError(
38 blink::WebContentDecryptionModuleExceptionNotSupportedError, 0, 38 blink::WebContentDecryptionModuleExceptionNotSupportedError, 0,
39 "Invalid keysystem."); 39 "Invalid keysystem.");
40 return; 40 return;
41 } 41 }
42 42
43 // TODO(ddorwin): This should be a DCHECK.
43 std::string key_system_ascii = base::UTF16ToASCII(key_system); 44 std::string key_system_ascii = base::UTF16ToASCII(key_system);
44 if (!media::IsConcreteSupportedKeySystem(key_system_ascii)) { 45 if (!media::IsSupportedKeySystem(key_system_ascii)) {
45 std::string message = 46 std::string message =
46 "Keysystem '" + key_system_ascii + "' is not supported."; 47 "Keysystem '" + key_system_ascii + "' is not supported.";
47 result.completeWithError( 48 result.completeWithError(
48 blink::WebContentDecryptionModuleExceptionNotSupportedError, 0, 49 blink::WebContentDecryptionModuleExceptionNotSupportedError, 0,
49 blink::WebString::fromUTF8(message)); 50 blink::WebString::fromUTF8(message));
50 return; 51 return;
51 } 52 }
52 53
53 // If unique security origin, don't try to create the CDM. 54 // If unique security origin, don't try to create the CDM.
54 if (security_origin.isUnique() || security_origin.toString() == "null") { 55 if (security_origin.isUnique() || security_origin.toString() == "null") {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 base::saturated_cast<int>(server_certificate_length), 100 base::saturated_cast<int>(server_certificate_length),
100 scoped_ptr<SimpleCdmPromise>( 101 scoped_ptr<SimpleCdmPromise>(
101 new CdmResultPromise<>(result, std::string()))); 102 new CdmResultPromise<>(result, std::string())));
102 } 103 }
103 104
104 CdmContext* WebContentDecryptionModuleImpl::GetCdmContext() { 105 CdmContext* WebContentDecryptionModuleImpl::GetCdmContext() {
105 return adapter_->GetCdmContext(); 106 return adapter_->GetCdmContext();
106 } 107 }
107 108
108 } // namespace media 109 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/encrypted_media_player_support.cc ('k') | media/blink/webencryptedmediaclient_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698