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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/task_runner.h" | 10 #include "base/task_runner.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 break; | 215 break; |
216 case CREATE_SESSION_TYPE_MP4: | 216 case CREATE_SESSION_TYPE_MP4: |
217 mime_type = "video/mp4"; | 217 mime_type = "video/mp4"; |
218 break; | 218 break; |
219 default: | 219 default: |
220 NOTREACHED(); | 220 NOTREACHED(); |
221 return; | 221 return; |
222 } | 222 } |
223 | 223 |
224 #if defined(OS_ANDROID) | 224 #if defined(OS_ANDROID) |
225 if (CommandLine::ForCurrentProcess() | 225 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
226 ->HasSwitch(switches::kDisableInfobarForProtectedMediaIdentifier)) { | 226 switches::kDisableInfobarForProtectedMediaIdentifier)) { |
227 CreateSessionIfPermitted( | 227 CreateSessionIfPermitted( |
228 render_frame_id, cdm_id, session_id, mime_type, init_data, true); | 228 render_frame_id, cdm_id, session_id, mime_type, init_data, true); |
229 return; | 229 return; |
230 } | 230 } |
231 #endif | 231 #endif |
232 | 232 |
233 BrowserCdm* cdm = GetCdm(render_frame_id, cdm_id); | 233 BrowserCdm* cdm = GetCdm(render_frame_id, cdm_id); |
234 if (!cdm) { | 234 if (!cdm) { |
235 DLOG(WARNING) << "No CDM found for: " << render_frame_id << ", " << cdm_id; | 235 DLOG(WARNING) << "No CDM found for: " << render_frame_id << ", " << cdm_id; |
236 SendSessionError(render_frame_id, cdm_id, session_id); | 236 SendSessionError(render_frame_id, cdm_id, session_id); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 DLOG(WARNING) << "No CDM found for: " << render_frame_id << ", " << cdm_id; | 415 DLOG(WARNING) << "No CDM found for: " << render_frame_id << ", " << cdm_id; |
416 SendSessionError(render_frame_id, cdm_id, session_id); | 416 SendSessionError(render_frame_id, cdm_id, session_id); |
417 return; | 417 return; |
418 } | 418 } |
419 | 419 |
420 // This could fail, in which case a SessionError will be fired. | 420 // This could fail, in which case a SessionError will be fired. |
421 cdm->CreateSession(session_id, content_type, &init_data[0], init_data.size()); | 421 cdm->CreateSession(session_id, content_type, &init_data[0], init_data.size()); |
422 } | 422 } |
423 | 423 |
424 } // namespace content | 424 } // namespace content |
OLD | NEW |