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

Side by Side Diff: Source/platform/drm/ContentDecryptionModule.cpp

Issue 183943003: Verify MediaKeys parameter values consistently (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: One method Created 6 years, 9 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
« no previous file with comments | « Source/platform/drm/ContentDecryptionModule.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 19 matching lines...) Expand all
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "platform/drm/ContentDecryptionModule.h" 32 #include "platform/drm/ContentDecryptionModule.h"
33 33
34 #include "platform/NotImplemented.h" 34 #include "platform/NotImplemented.h"
35 #include "platform/drm/ContentDecryptionModuleSession.h" 35 #include "platform/drm/ContentDecryptionModuleSession.h"
36 #include "public/platform/Platform.h" 36 #include "public/platform/Platform.h"
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 bool ContentDecryptionModule::supportsKeySystem(const String& keySystem)
41 {
42 // FIXME: Chromium should handle this, possibly using
43 // MIMETypeRegistry::isSupportedEncryptedMediaMIMEType().
44 notImplemented();
45 return keySystem == "org.w3.clearkey";
46 }
47
48 PassOwnPtr<ContentDecryptionModule> ContentDecryptionModule::create(const String & keySystem) 40 PassOwnPtr<ContentDecryptionModule> ContentDecryptionModule::create(const String & keySystem)
49 { 41 {
50 ASSERT(!keySystem.isEmpty()); 42 ASSERT(!keySystem.isEmpty());
51 OwnPtr<blink::WebContentDecryptionModule> cdm = adoptPtr(blink::Platform::cu rrent()->createContentDecryptionModule(keySystem)); 43 OwnPtr<blink::WebContentDecryptionModule> cdm = adoptPtr(blink::Platform::cu rrent()->createContentDecryptionModule(keySystem));
52 if (!cdm) 44 if (!cdm)
53 return nullptr; 45 return nullptr;
54 return adoptPtr(new ContentDecryptionModule(cdm.release())); 46 return adoptPtr(new ContentDecryptionModule(cdm.release()));
55 } 47 }
56 48
57 ContentDecryptionModule::ContentDecryptionModule(PassOwnPtr<blink::WebContentDec ryptionModule> cdm) 49 ContentDecryptionModule::ContentDecryptionModule(PassOwnPtr<blink::WebContentDec ryptionModule> cdm)
58 : m_cdm(cdm) 50 : m_cdm(cdm)
59 { 51 {
60 ASSERT(m_cdm); 52 ASSERT(m_cdm);
61 } 53 }
62 54
63 ContentDecryptionModule::~ContentDecryptionModule() 55 ContentDecryptionModule::~ContentDecryptionModule()
64 { 56 {
65 } 57 }
66 58
67 bool ContentDecryptionModule::supportsMIMEType(const String& mimeType)
68 {
69 // FIXME: Chromium should handle this, possibly using
70 // MIMETypeRegistry::isSupportedEncryptedMediaMIMEType().
71 notImplemented();
72 return mimeType == "video/webm";
73 }
74
75 PassOwnPtr<ContentDecryptionModuleSession> ContentDecryptionModule::createSessio n(ContentDecryptionModuleSessionClient* client) 59 PassOwnPtr<ContentDecryptionModuleSession> ContentDecryptionModule::createSessio n(ContentDecryptionModuleSessionClient* client)
76 { 60 {
77 return adoptPtr(new ContentDecryptionModuleSession(m_cdm.get(), client)); 61 return adoptPtr(new ContentDecryptionModuleSession(m_cdm.get(), client));
78 } 62 }
79 63
80 } // namespace WebCore 64 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/drm/ContentDecryptionModule.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698