| 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/cdm/browser_cdm_manager.h" | 5 #include "content/browser/media/cdm/browser_cdm_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 IPC_MESSAGE_HANDLER(CdmHostMsg_CreateSessionAndGenerateRequest, | 177 IPC_MESSAGE_HANDLER(CdmHostMsg_CreateSessionAndGenerateRequest, |
| 178 OnCreateSessionAndGenerateRequest) | 178 OnCreateSessionAndGenerateRequest) |
| 179 IPC_MESSAGE_HANDLER(CdmHostMsg_UpdateSession, OnUpdateSession) | 179 IPC_MESSAGE_HANDLER(CdmHostMsg_UpdateSession, OnUpdateSession) |
| 180 IPC_MESSAGE_HANDLER(CdmHostMsg_CloseSession, OnCloseSession) | 180 IPC_MESSAGE_HANDLER(CdmHostMsg_CloseSession, OnCloseSession) |
| 181 IPC_MESSAGE_HANDLER(CdmHostMsg_DestroyCdm, OnDestroyCdm) | 181 IPC_MESSAGE_HANDLER(CdmHostMsg_DestroyCdm, OnDestroyCdm) |
| 182 IPC_MESSAGE_UNHANDLED(handled = false) | 182 IPC_MESSAGE_UNHANDLED(handled = false) |
| 183 IPC_END_MESSAGE_MAP() | 183 IPC_END_MESSAGE_MAP() |
| 184 return handled; | 184 return handled; |
| 185 } | 185 } |
| 186 | 186 |
| 187 media::BrowserCdm* BrowserCdmManager::GetCdm(int render_frame_id, int cdm_id) { | 187 media::BrowserCdm* BrowserCdmManager::GetCdm(int render_frame_id, |
| 188 int cdm_id) const { |
| 188 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 189 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
| 189 return cdm_map_.get(GetId(render_frame_id, cdm_id)); | 190 return cdm_map_.get(GetId(render_frame_id, cdm_id)); |
| 190 } | 191 } |
| 191 | 192 |
| 192 void BrowserCdmManager::RenderFrameDeleted(int render_frame_id) { | 193 void BrowserCdmManager::RenderFrameDeleted(int render_frame_id) { |
| 193 if (!task_runner_->RunsTasksOnCurrentThread()) { | 194 if (!task_runner_->RunsTasksOnCurrentThread()) { |
| 194 task_runner_->PostTask( | 195 task_runner_->PostTask( |
| 195 FROM_HERE, | 196 FROM_HERE, |
| 196 base::Bind(&BrowserCdmManager::RemoveAllCdmForFrame, | 197 base::Bind(&BrowserCdmManager::RemoveAllCdmForFrame, |
| 197 this, render_frame_id)); | 198 this, render_frame_id)); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 } | 548 } |
| 548 | 549 |
| 549 // Only the temporary session type is supported in browser CDM path. | 550 // Only the temporary session type is supported in browser CDM path. |
| 550 // TODO(xhwang): Add SessionType support if needed. | 551 // TODO(xhwang): Add SessionType support if needed. |
| 551 cdm->CreateSessionAndGenerateRequest(media::MediaKeys::TEMPORARY_SESSION, | 552 cdm->CreateSessionAndGenerateRequest(media::MediaKeys::TEMPORARY_SESSION, |
| 552 init_data_type, &init_data[0], | 553 init_data_type, &init_data[0], |
| 553 init_data.size(), promise.Pass()); | 554 init_data.size(), promise.Pass()); |
| 554 } | 555 } |
| 555 | 556 |
| 556 } // namespace content | 557 } // namespace content |
| OLD | NEW |