| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "webencryptedmediaclient_impl.h" | 5 #include "webencryptedmediaclient_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "media/base/key_systems.h" | 10 #include "media/base/key_systems.h" |
| 11 #include "media/base/media_permission.h" |
| 11 #include "net/base/mime_util.h" | 12 #include "net/base/mime_util.h" |
| 12 #include "third_party/WebKit/public/platform/WebEncryptedMediaRequest.h" | 13 #include "third_party/WebKit/public/platform/WebEncryptedMediaRequest.h" |
| 13 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h" | 14 #include "third_party/WebKit/public/platform/WebMediaKeySystemConfiguration.h" |
| 14 #include "third_party/WebKit/public/platform/WebString.h" | 15 #include "third_party/WebKit/public/platform/WebString.h" |
| 15 #include "third_party/WebKit/public/platform/WebVector.h" | 16 #include "third_party/WebKit/public/platform/WebVector.h" |
| 16 #include "webcontentdecryptionmoduleaccess_impl.h" | 17 #include "webcontentdecryptionmoduleaccess_impl.h" |
| 17 | 18 |
| 18 namespace media { | 19 namespace media { |
| 19 | 20 |
| 20 static bool IsSupportedContentType( | 21 static bool IsSupportedContentType( |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 125 } |
| 125 | 126 |
| 126 // TODO(sandersd): Prompt for distinctive identifiers and/or persistent state | 127 // TODO(sandersd): Prompt for distinctive identifiers and/or persistent state |
| 127 // if required. Make sure that future checks are silent. | 128 // if required. Make sure that future checks are silent. |
| 128 // http://crbug.com/446263. | 129 // http://crbug.com/446263. |
| 129 | 130 |
| 130 return true; | 131 return true; |
| 131 } | 132 } |
| 132 | 133 |
| 133 WebEncryptedMediaClientImpl::WebEncryptedMediaClientImpl( | 134 WebEncryptedMediaClientImpl::WebEncryptedMediaClientImpl( |
| 134 scoped_ptr<CdmFactory> cdm_factory) | 135 scoped_ptr<CdmFactory> cdm_factory, |
| 136 MediaPermission* /* media_permission */) |
| 135 : cdm_factory_(cdm_factory.Pass()) { | 137 : cdm_factory_(cdm_factory.Pass()) { |
| 138 // TODO(sandersd): Use |media_permission| to check for media permissions in |
| 139 // this class. |
| 136 } | 140 } |
| 137 | 141 |
| 138 WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() { | 142 WebEncryptedMediaClientImpl::~WebEncryptedMediaClientImpl() { |
| 139 } | 143 } |
| 140 | 144 |
| 141 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( | 145 void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( |
| 142 blink::WebEncryptedMediaRequest request) { | 146 blink::WebEncryptedMediaRequest request) { |
| 143 // TODO(jrummell): This should be asynchronous. | 147 // TODO(jrummell): This should be asynchronous. |
| 144 | 148 |
| 145 // Continued from requestMediaKeySystemAccess(), step 7, from | 149 // Continued from requestMediaKeySystemAccess(), step 7, from |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 return; | 191 return; |
| 188 } | 192 } |
| 189 } | 193 } |
| 190 | 194 |
| 191 // 7.4 Reject promise with a new DOMException whose name is NotSupportedError. | 195 // 7.4 Reject promise with a new DOMException whose name is NotSupportedError. |
| 192 request.requestNotSupported( | 196 request.requestNotSupported( |
| 193 "None of the requested configurations were supported."); | 197 "None of the requested configurations were supported."); |
| 194 } | 198 } |
| 195 | 199 |
| 196 } // namespace media | 200 } // namespace media |
| OLD | NEW |