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

Side by Side Diff: content/renderer/media/webcontentdecryptionmodulesession_impl.cc

Issue 138753003: Update WebContentDecryptionModuleSessionImpl to latest EME API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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 | « no previous file | 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 // 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 "content/renderer/media/webcontentdecryptionmodulesession_impl.h" 5 #include "content/renderer/media/webcontentdecryptionmodulesession_impl.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "third_party/WebKit/public/platform/WebURL.h" 10 #include "third_party/WebKit/public/platform/WebURL.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // removed. 65 // removed.
66 blink::WebString id = blink::WebString::fromUTF8(web_session_id); 66 blink::WebString id = blink::WebString::fromUTF8(web_session_id);
67 DCHECK(web_session_id_.isEmpty() || web_session_id_ == id) 67 DCHECK(web_session_id_.isEmpty() || web_session_id_ == id)
68 << "Session ID may not be changed once set."; 68 << "Session ID may not be changed once set.";
69 web_session_id_ = id; 69 web_session_id_ = id;
70 } 70 }
71 71
72 void WebContentDecryptionModuleSessionImpl::OnSessionMessage( 72 void WebContentDecryptionModuleSessionImpl::OnSessionMessage(
73 const std::vector<uint8>& message, 73 const std::vector<uint8>& message,
74 const std::string& destination_url) { 74 const std::string& destination_url) {
75 client_->keyMessage(message.empty() ? NULL : &message[0], 75 client_->message(message.empty() ? NULL : &message[0],
76 message.size(), 76 message.size(),
77 GURL(destination_url)); 77 GURL(destination_url));
78 } 78 }
79 79
80 void WebContentDecryptionModuleSessionImpl::OnSessionReady() { 80 void WebContentDecryptionModuleSessionImpl::OnSessionReady() {
81 // TODO(jrummell): Blink APIs need to be updated to the new EME API. For now, 81 client_->ready();
82 // convert the response to the old v0.1b API.
83 client_->keyAdded();
84 } 82 }
85 83
86 void WebContentDecryptionModuleSessionImpl::OnSessionClosed() { 84 void WebContentDecryptionModuleSessionImpl::OnSessionClosed() {
85 client_->close();
87 if (!session_closed_cb_.is_null()) 86 if (!session_closed_cb_.is_null())
88 base::ResetAndReturn(&session_closed_cb_).Run(session_id_); 87 base::ResetAndReturn(&session_closed_cb_).Run(session_id_);
89 } 88 }
90 89
91 void WebContentDecryptionModuleSessionImpl::OnSessionError( 90 void WebContentDecryptionModuleSessionImpl::OnSessionError(
92 media::MediaKeys::KeyError error_code, 91 media::MediaKeys::KeyError error_code,
93 int system_code) { 92 int system_code) {
94 client_->keyError(static_cast<Client::MediaKeyErrorCode>(error_code), 93 client_->error(static_cast<Client::MediaKeyErrorCode>(error_code),
95 system_code); 94 system_code);
96 } 95 }
97 96
98 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698