OLD | NEW |
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 "content/browser/media/media_web_contents_observer.h" | 5 #include "content/browser/media/media_web_contents_observer.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "content/browser/media/cdm/browser_cdm_manager.h" | 9 #include "content/browser/media/cdm/browser_cdm_manager.h" |
10 #include "content/browser/renderer_host/render_process_host_impl.h" | 10 #include "content/browser/renderer_host/render_process_host_impl.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 // MediaPlayerAndroid runs on the same thread as BrowserCdmManager. | 136 // MediaPlayerAndroid runs on the same thread as BrowserCdmManager. |
137 BrowserCdmManager* browser_cdm_manager = | 137 BrowserCdmManager* browser_cdm_manager = |
138 BrowserCdmManager::FromProcess(render_frame_host->GetProcess()->GetID()); | 138 BrowserCdmManager::FromProcess(render_frame_host->GetProcess()->GetID()); |
139 if (!browser_cdm_manager) { | 139 if (!browser_cdm_manager) { |
140 NOTREACHED() << "OnSetCdm: CDM not found for " << cdm_id; | 140 NOTREACHED() << "OnSetCdm: CDM not found for " << cdm_id; |
141 return; | 141 return; |
142 } | 142 } |
143 | 143 |
144 media::BrowserCdm* cdm = | 144 scoped_refptr<media::MediaKeys> cdm = |
145 browser_cdm_manager->GetCdm(render_frame_host->GetRoutingID(), cdm_id); | 145 browser_cdm_manager->GetCdm(render_frame_host->GetRoutingID(), cdm_id); |
146 if (!cdm) { | 146 if (!cdm) { |
147 NOTREACHED() << "OnSetCdm: CDM not found for " << cdm_id; | 147 NOTREACHED() << "OnSetCdm: CDM not found for " << cdm_id; |
148 return; | 148 return; |
149 } | 149 } |
150 | 150 |
151 // TODO(xhwang): This could possibly fail. In that case we should reject the | 151 // TODO(xhwang): This could possibly fail. In that case we should reject the |
152 // promise. | 152 // promise. |
153 media_player->SetCdm(cdm); | 153 media_player->SetCdm(cdm); |
154 } | 154 } |
(...skipping 15 matching lines...) Expand all Loading... |
170 iter != media_player_managers_.end(); ++iter) { | 170 iter != media_player_managers_.end(); ++iter) { |
171 BrowserMediaPlayerManager* manager = iter->second; | 171 BrowserMediaPlayerManager* manager = iter->second; |
172 manager->OnFrameInfoUpdated(); | 172 manager->OnFrameInfoUpdated(); |
173 } | 173 } |
174 } | 174 } |
175 #endif // defined(VIDEO_HOLE) | 175 #endif // defined(VIDEO_HOLE) |
176 | 176 |
177 #endif // defined(OS_ANDROID) | 177 #endif // defined(OS_ANDROID) |
178 | 178 |
179 } // namespace content | 179 } // namespace content |
OLD | NEW |