OLD | NEW |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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/renderer/pepper/pepper_platform_audio_output_dev.h" | 5 #include "content/renderer/pepper/pepper_platform_audio_output_dev.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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 switch (state_) { | 305 switch (state_) { |
306 case IPC_CLOSED: | 306 case IPC_CLOSED: |
307 main_task_runner_->PostTask( | 307 main_task_runner_->PostTask( |
308 FROM_HERE, | 308 FROM_HERE, |
309 base::Bind(&PepperPlatformAudioOutputDev::NotifyStreamCreationFailed, | 309 base::Bind(&PepperPlatformAudioOutputDev::NotifyStreamCreationFailed, |
310 this)); | 310 this)); |
311 break; | 311 break; |
312 | 312 |
313 case IDLE: | 313 case IDLE: |
314 if (did_receive_auth_.IsSignaled() && device_id_.empty() && | 314 if (did_receive_auth_.IsSignaled() && device_id_.empty() && |
315 security_origin_.unique()) { | 315 security_origin_.opaque()) { |
316 state_ = CREATING_STREAM; | 316 state_ = CREATING_STREAM; |
317 ipc_->CreateStream(this, params); | 317 ipc_->CreateStream(this, params); |
318 } else { | 318 } else { |
319 RequestDeviceAuthorizationOnIOThread(); | 319 RequestDeviceAuthorizationOnIOThread(); |
320 start_on_authorized_ = true; | 320 start_on_authorized_ = true; |
321 } | 321 } |
322 break; | 322 break; |
323 | 323 |
324 case AUTHORIZING: | 324 case AUTHORIZING: |
325 start_on_authorized_ = true; | 325 start_on_authorized_ = true; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 } | 401 } |
402 | 402 |
403 void PepperPlatformAudioOutputDev::NotifyStreamCreationFailed() { | 403 void PepperPlatformAudioOutputDev::NotifyStreamCreationFailed() { |
404 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 404 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
405 | 405 |
406 if (client_) | 406 if (client_) |
407 client_->StreamCreationFailed(); | 407 client_->StreamCreationFailed(); |
408 } | 408 } |
409 | 409 |
410 } // namespace content | 410 } // namespace content |
OLD | NEW |