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

Side by Side Diff: media/mojo/services/mojo_cdm.cc

Issue 813683005: Add |legacy_destination_url| back to SessionMessage for EME (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes Created 5 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 | « media/mojo/services/mojo_cdm.h ('k') | media/mojo/services/mojo_cdm_service.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 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 "media/mojo/services/mojo_cdm.h" 5 #include "media/mojo/services/mojo_cdm.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "media/base/cdm_key_information.h" 9 #include "media/base/cdm_key_information.h"
10 #include "media/base/cdm_promise.h" 10 #include "media/base/cdm_promise.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 base::Passed(&promise))); 115 base::Passed(&promise)));
116 } 116 }
117 117
118 CdmContext* MojoCdm::GetCdmContext() { 118 CdmContext* MojoCdm::GetCdmContext() {
119 NOTIMPLEMENTED(); 119 NOTIMPLEMENTED();
120 return nullptr; 120 return nullptr;
121 } 121 }
122 122
123 void MojoCdm::OnSessionMessage(const mojo::String& session_id, 123 void MojoCdm::OnSessionMessage(const mojo::String& session_id,
124 mojo::CdmMessageType message_type, 124 mojo::CdmMessageType message_type,
125 mojo::Array<uint8_t> message) { 125 mojo::Array<uint8_t> message,
126 const mojo::String& legacy_destination_url) {
127 GURL verified_gurl = GURL(legacy_destination_url);
128 if (!verified_gurl.is_valid() && !verified_gurl.is_empty()) {
129 DLOG(WARNING) << "SessionMessage destination_url is invalid : "
130 << verified_gurl.possibly_invalid_spec();
131 verified_gurl = GURL::EmptyGURL(); // Replace invalid destination_url.
132 }
133
126 session_message_cb_.Run(session_id, 134 session_message_cb_.Run(session_id,
127 static_cast<MediaKeys::MessageType>(message_type), 135 static_cast<MediaKeys::MessageType>(message_type),
128 message.storage()); 136 message.storage(), verified_gurl);
129 } 137 }
130 138
131 void MojoCdm::OnSessionClosed(const mojo::String& session_id) { 139 void MojoCdm::OnSessionClosed(const mojo::String& session_id) {
132 session_closed_cb_.Run(session_id); 140 session_closed_cb_.Run(session_id);
133 } 141 }
134 142
135 void MojoCdm::OnSessionError(const mojo::String& session_id, 143 void MojoCdm::OnSessionError(const mojo::String& session_id,
136 mojo::CdmException exception, 144 mojo::CdmException exception,
137 uint32_t system_code, 145 uint32_t system_code,
138 const mojo::String& error_message) { 146 const mojo::String& error_message) {
(...skipping 26 matching lines...) Expand all
165 void MojoCdm::OnPromiseResult(scoped_ptr<CdmPromiseTemplate<T...>> promise, 173 void MojoCdm::OnPromiseResult(scoped_ptr<CdmPromiseTemplate<T...>> promise,
166 mojo::CdmPromiseResultPtr result, 174 mojo::CdmPromiseResultPtr result,
167 typename MojoTypeTrait<T>::MojoType... args) { 175 typename MojoTypeTrait<T>::MojoType... args) {
168 if (result->success) 176 if (result->success)
169 promise->resolve(args.template To<T>()...); // See ISO C++03 14.2/4. 177 promise->resolve(args.template To<T>()...); // See ISO C++03 14.2/4.
170 else 178 else
171 RejectPromise(promise.Pass(), result.Pass()); 179 RejectPromise(promise.Pass(), result.Pass());
172 } 180 }
173 181
174 } // namespace media 182 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_cdm.h ('k') | media/mojo/services/mojo_cdm_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698