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

Side by Side Diff: webkit/media/crypto/key_systems.cc

Issue 10575026: Add ProxyDecryptor which wraps concrete Decryptor implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits and rebased. Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « webkit/media/crypto/key_systems.h ('k') | webkit/media/crypto/proxy_decryptor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/media/key_systems.h" 5 #include "webkit/media/crypto/key_systems.h"
6 6
7 #include "media/base/decryptor.h"
8 #include "media/crypto/aes_decryptor.h"
7 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
8 10
9 namespace webkit_media { 11 namespace webkit_media {
10 12
11 namespace { 13 namespace {
12 14
13 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; 15 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey";
14 16
15 struct MediaFormatAndKeySystem { 17 struct MediaFormatAndKeySystem {
16 const char* mime_type; 18 const char* mime_type;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 70
69 for (size_t i = 0; i < codecs.size(); ++i) { 71 for (size_t i = 0; i < codecs.size(); ++i) {
70 if (!IsSupportedKeySystemWithContainerAndCodec( 72 if (!IsSupportedKeySystemWithContainerAndCodec(
71 mime_type, codecs[i], key_system)) 73 mime_type, codecs[i], key_system))
72 return false; 74 return false;
73 } 75 }
74 76
75 return true; 77 return true;
76 } 78 }
77 79
80 scoped_ptr<media::Decryptor> CreateDecryptor(const std::string& key_system,
81 media::DecryptorClient* client) {
82 if (key_system == kClearKeyKeySystem)
83 return scoped_ptr<media::Decryptor>(new media::AesDecryptor(client));
84 return scoped_ptr<media::Decryptor>();
85 }
86
78 } // namespace webkit_media 87 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/crypto/key_systems.h ('k') | webkit/media/crypto/proxy_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698