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

Side by Side Diff: chromecast/media/cdm/browser_cdm_cast.cc

Issue 1165513004: Chromecast: adds MessageType to BrowserCdmCast::OnSessionMessage API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « chromecast/media/cdm/browser_cdm_cast.h ('k') | 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 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 "chromecast/media/cdm/browser_cdm_cast.h" 5 #include "chromecast/media/cdm/browser_cdm_cast.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "media/base/cdm_key_information.h" 10 #include "media/base/cdm_key_information.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 legacy_session_error_cb_.Run( 62 legacy_session_error_cb_.Run(
63 session_id, ::media::MediaKeys::Exception::NOT_SUPPORTED_ERROR, 0, 63 session_id, ::media::MediaKeys::Exception::NOT_SUPPORTED_ERROR, 0,
64 std::string()); 64 std::string());
65 } 65 }
66 66
67 ::media::CdmContext* BrowserCdmCast::GetCdmContext() { 67 ::media::CdmContext* BrowserCdmCast::GetCdmContext() {
68 NOTREACHED(); 68 NOTREACHED();
69 return nullptr; 69 return nullptr;
70 } 70 }
71 71
72 void BrowserCdmCast::OnSessionMessage(const std::string& session_id, 72 void BrowserCdmCast::OnSessionMessage(
73 const std::vector<uint8_t>& message, 73 const std::string& session_id,
74 const GURL& destination_url) { 74 const std::vector<uint8_t>& message,
75 // Note: Message type is not supported in Chromecast. Do our best guess here. 75 const GURL& destination_url,
76 ::media::MediaKeys::MessageType message_type = 76 ::media::MediaKeys::MessageType message_type) {
77 destination_url.is_empty() ? ::media::MediaKeys::LICENSE_REQUEST
78 : ::media::MediaKeys::LICENSE_RENEWAL;
79 session_message_cb_.Run(session_id, 77 session_message_cb_.Run(session_id,
80 message_type, 78 message_type,
81 message, 79 message,
82 destination_url); 80 destination_url);
83 } 81 }
84 82
85 void BrowserCdmCast::OnSessionClosed(const std::string& session_id) { 83 void BrowserCdmCast::OnSessionClosed(const std::string& session_id) {
86 session_closed_cb_.Run(session_id); 84 session_closed_cb_.Run(session_id);
87 } 85 }
88 86
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 return nullptr; 196 return nullptr;
199 } 197 }
200 198
201 // A default empty implementation for subclasses that don't need to provide 199 // A default empty implementation for subclasses that don't need to provide
202 // any key system specific initialization. 200 // any key system specific initialization.
203 void BrowserCdmCast::InitializeInternal() { 201 void BrowserCdmCast::InitializeInternal() {
204 } 202 }
205 203
206 } // namespace media 204 } // namespace media
207 } // namespace chromecast 205 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/cdm/browser_cdm_cast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698