OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/remoting/rpc/proto_utils.h" | 5 #include "media/remoting/rpc/proto_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/big_endian.h" | 9 #include "base/big_endian.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 key_info_msg.system_code())); | 378 key_info_msg.system_code())); |
379 key_information->push_back(std::move(key)); | 379 key_information->push_back(std::move(key)); |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
383 void ConvertCdmPromiseToProto(const CdmPromiseResult& result, | 383 void ConvertCdmPromiseToProto(const CdmPromiseResult& result, |
384 pb::CdmPromise* promise_message) { | 384 pb::CdmPromise* promise_message) { |
385 promise_message->set_success(result.success()); | 385 promise_message->set_success(result.success()); |
386 if (!result.success()) { | 386 if (!result.success()) { |
387 promise_message->set_exception( | 387 promise_message->set_exception( |
388 ToProtoMediaKeysException(result.exception()).value()); | 388 ToProtoCdmException(result.exception()).value()); |
389 promise_message->set_system_code(result.system_code()); | 389 promise_message->set_system_code(result.system_code()); |
390 promise_message->set_error_message(result.error_message()); | 390 promise_message->set_error_message(result.error_message()); |
391 } | 391 } |
392 } | 392 } |
393 | 393 |
394 void ConvertCdmPromiseWithSessionIdToProto(const CdmPromiseResult& result, | 394 void ConvertCdmPromiseWithSessionIdToProto(const CdmPromiseResult& result, |
395 const std::string& session_id, | 395 const std::string& session_id, |
396 pb::CdmPromise* promise_message) { | 396 pb::CdmPromise* promise_message) { |
397 ConvertCdmPromiseToProto(result, promise_message); | 397 ConvertCdmPromiseToProto(result, promise_message); |
398 promise_message->set_session_id(session_id); | 398 promise_message->set_session_id(session_id); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 464 |
465 CdmPromiseResult CdmPromiseResult::SuccessResult() { | 465 CdmPromiseResult CdmPromiseResult::SuccessResult() { |
466 CdmPromiseResult result(static_cast<::media::CdmPromise::Exception>(0), 0, | 466 CdmPromiseResult result(static_cast<::media::CdmPromise::Exception>(0), 0, |
467 ""); | 467 ""); |
468 result.success_ = true; | 468 result.success_ = true; |
469 return result; | 469 return result; |
470 } | 470 } |
471 | 471 |
472 } // namespace remoting | 472 } // namespace remoting |
473 } // namespace media | 473 } // namespace media |
OLD | NEW |