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

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: Add CreateDecryptor in key_system.* 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
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/base/decryptor_client.h"
ddorwin 2012/06/28 22:15:38 Is this one necessary?
xhwang 2012/06/28 23:31:42 Removed.
9 #include "media/crypto/aes_decryptor.h"
7 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
8 11
9 namespace webkit_media { 12 namespace webkit_media {
10 13
11 namespace { 14 namespace {
12 15
13 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; 16 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey";
14 17
15 struct MediaFormatAndKeySystem { 18 struct MediaFormatAndKeySystem {
16 const char* mime_type; 19 const char* mime_type;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 71
69 for (size_t i = 0; i < codecs.size(); ++i) { 72 for (size_t i = 0; i < codecs.size(); ++i) {
70 if (!IsSupportedKeySystemWithContainerAndCodec( 73 if (!IsSupportedKeySystemWithContainerAndCodec(
71 mime_type, codecs[i], key_system)) 74 mime_type, codecs[i], key_system))
72 return false; 75 return false;
73 } 76 }
74 77
75 return true; 78 return true;
76 } 79 }
77 80
81 scoped_ptr<media::Decryptor> CreateDecryptor(const std::string& key_system,
82 media::DecryptorClient* client) {
83 if (key_system == kClearKeyKeySystem)
84 return scoped_ptr<media::Decryptor>(new media::AesDecryptor(client));
85 return scoped_ptr<media::Decryptor>();
86 }
87
78 } // namespace webkit_media 88 } // namespace webkit_media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698