| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/blink/webmediaplayer_util.h" | 5 #include "media/blink/webmediaplayer_util.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <string> |
| 8 | 9 |
| 9 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 10 #include "media/base/bind_to_current_loop.h" | 11 #include "media/base/bind_to_current_loop.h" |
| 11 #include "media/base/media_client.h" | 12 #include "media/base/media_client.h" |
| 12 #include "media/base/media_keys.h" | 13 #include "media/base/media_keys.h" |
| 13 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient.
h" | 14 #include "third_party/WebKit/public/platform/WebMediaPlayerEncryptedMediaClient.
h" |
| 14 | 15 |
| 15 namespace media { | 16 namespace media { |
| 16 | 17 |
| 17 // Compile asserts shared by all platforms. | 18 // Compile asserts shared by all platforms. |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 break; | 219 break; |
| 219 case SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_FOUND: | 220 case SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_FOUND: |
| 220 callback.web_callback_->onError(new blink::WebSetSinkIdError( | 221 callback.web_callback_->onError(new blink::WebSetSinkIdError( |
| 221 blink::WebSetSinkIdError::ErrorTypeNotFound, "Device not found")); | 222 blink::WebSetSinkIdError::ErrorTypeNotFound, "Device not found")); |
| 222 break; | 223 break; |
| 223 case SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_AUTHORIZED: | 224 case SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_AUTHORIZED: |
| 224 callback.web_callback_->onError(new blink::WebSetSinkIdError( | 225 callback.web_callback_->onError(new blink::WebSetSinkIdError( |
| 225 blink::WebSetSinkIdError::ErrorTypeSecurity, | 226 blink::WebSetSinkIdError::ErrorTypeSecurity, |
| 226 "No permission to access device")); | 227 "No permission to access device")); |
| 227 break; | 228 break; |
| 228 case SWITCH_OUTPUT_DEVICE_RESULT_ERROR_OBSOLETE: | 229 case SWITCH_OUTPUT_DEVICE_RESULT_ERROR_INTERNAL: |
| 229 callback.web_callback_->onError(new blink::WebSetSinkIdError( | 230 callback.web_callback_->onError(new blink::WebSetSinkIdError( |
| 230 blink::WebSetSinkIdError::ErrorTypeAbort, | 231 blink::WebSetSinkIdError::ErrorTypeAbort, |
| 231 "The requested operation became obsolete and was aborted")); | 232 "The requested operation could be performed and was aborted")); |
| 232 break; | |
| 233 case SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_SUPPORTED: | |
| 234 callback.web_callback_->onError(new blink::WebSetSinkIdError( | |
| 235 blink::WebSetSinkIdError::ErrorTypeAbort, | |
| 236 "The requested operation cannot be performed and was aborted")); | |
| 237 break; | 233 break; |
| 238 default: | 234 default: |
| 239 NOTREACHED(); | 235 NOTREACHED(); |
| 240 } | 236 } |
| 241 | 237 |
| 242 callback.web_callback_ = nullptr; | 238 callback.web_callback_ = nullptr; |
| 243 } | 239 } |
| 244 | 240 |
| 245 } // namespace | 241 } // namespace |
| 246 | 242 |
| 247 SwitchOutputDeviceCB ConvertToSwitchOutputDeviceCB( | 243 SwitchOutputDeviceCB ConvertToSwitchOutputDeviceCB( |
| 248 WebSetSinkIdCB* web_callbacks) { | 244 WebSetSinkIdCB* web_callbacks) { |
| 249 return media::BindToCurrentLoop( | 245 return media::BindToCurrentLoop( |
| 250 base::Bind(RunSetSinkIdCallback, SetSinkIdCallback(web_callbacks))); | 246 base::Bind(RunSetSinkIdCallback, SetSinkIdCallback(web_callbacks))); |
| 251 } | 247 } |
| 252 | 248 |
| 253 } // namespace media | 249 } // namespace media |
| OLD | NEW |