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

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

Issue 2444683002: Move MediaKeys::Exception to CdmPromise::Exception (Closed)
Patch Set: include "media/base/media_keys.h" Created 4 years, 1 month 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
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_service.h" 5 #include "media/mojo/services/mojo_cdm_service.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 void MojoCdmService::OnCdmCreated(const InitializeCallback& callback, 175 void MojoCdmService::OnCdmCreated(const InitializeCallback& callback,
176 const scoped_refptr<MediaKeys>& cdm, 176 const scoped_refptr<MediaKeys>& cdm,
177 const std::string& error_message) { 177 const std::string& error_message) {
178 mojom::CdmPromiseResultPtr cdm_promise_result(mojom::CdmPromiseResult::New()); 178 mojom::CdmPromiseResultPtr cdm_promise_result(mojom::CdmPromiseResult::New());
179 179
180 // TODO(xhwang): This should not happen when KeySystemInfo is properly 180 // TODO(xhwang): This should not happen when KeySystemInfo is properly
181 // populated. See http://crbug.com/469366 181 // populated. See http://crbug.com/469366
182 if (!cdm || !context_) { 182 if (!cdm || !context_) {
183 cdm_promise_result->success = false; 183 cdm_promise_result->success = false;
184 cdm_promise_result->exception = MediaKeys::Exception::NOT_SUPPORTED_ERROR; 184 cdm_promise_result->exception = CdmPromise::Exception::NOT_SUPPORTED_ERROR;
185 cdm_promise_result->system_code = 0; 185 cdm_promise_result->system_code = 0;
186 cdm_promise_result->error_message = error_message; 186 cdm_promise_result->error_message = error_message;
187 callback.Run(std::move(cdm_promise_result), 0, nullptr); 187 callback.Run(std::move(cdm_promise_result), 0, nullptr);
188 return; 188 return;
189 } 189 }
190 190
191 cdm_ = cdm; 191 cdm_ = cdm;
192 cdm_id_ = next_cdm_id_++; 192 cdm_id_ = next_cdm_id_++;
193 193
194 context_->RegisterCdm(cdm_id_, this); 194 context_->RegisterCdm(cdm_id_, this);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 void MojoCdmService::OnDecryptorConnectionError() { 248 void MojoCdmService::OnDecryptorConnectionError() {
249 DVLOG(2) << __FUNCTION__; 249 DVLOG(2) << __FUNCTION__;
250 250
251 // MojoDecryptorService has lost connectivity to it's client, so it can be 251 // MojoDecryptorService has lost connectivity to it's client, so it can be
252 // freed. 252 // freed.
253 decryptor_.reset(); 253 decryptor_.reset();
254 } 254 }
255 255
256 } // namespace media 256 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_cdm_promise.cc ('k') | media/remoting/proto/remoting_rpc_message.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698