| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "modules/webaudio/AudioScheduledSourceNode.h" | 26 #include "modules/webaudio/AudioScheduledSourceNode.h" |
| 27 | 27 |
| 28 #include <algorithm> | 28 #include <algorithm> |
| 29 #include "bindings/core/v8/ExceptionState.h" | 29 #include "bindings/core/v8/ExceptionState.h" |
| 30 #include "core/dom/ExceptionCode.h" | 30 #include "core/dom/ExceptionCode.h" |
| 31 #include "core/dom/TaskRunnerHelper.h" | 31 #include "core/dom/TaskRunnerHelper.h" |
| 32 #include "modules/EventModules.h" | 32 #include "modules/EventModules.h" |
| 33 #include "modules/webaudio/BaseAudioContext.h" | 33 #include "modules/webaudio/BaseAudioContext.h" |
| 34 #include "platform/CrossThreadFunctional.h" | 34 #include "platform/CrossThreadFunctional.h" |
| 35 #include "platform/audio/AudioUtilities.h" | 35 #include "platform/audio/AudioUtilities.h" |
| 36 #include "wtf/MathExtras.h" | 36 #include "platform/wtf/MathExtras.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 const double AudioScheduledSourceHandler::kUnknownTime = -1; | 40 const double AudioScheduledSourceHandler::kUnknownTime = -1; |
| 41 | 41 |
| 42 AudioScheduledSourceHandler::AudioScheduledSourceHandler(NodeType node_type, | 42 AudioScheduledSourceHandler::AudioScheduledSourceHandler(NodeType node_type, |
| 43 AudioNode& node, | 43 AudioNode& node, |
| 44 float sample_rate) | 44 float sample_rate) |
| 45 : AudioHandler(node_type, node, sample_rate), | 45 : AudioHandler(node_type, node, sample_rate), |
| 46 start_time_(0), | 46 start_time_(0), |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 // playback state if the context is closed. | 283 // playback state if the context is closed. |
| 284 if (context()->IsContextClosed()) | 284 if (context()->IsContextClosed()) |
| 285 return false; | 285 return false; |
| 286 | 286 |
| 287 // If a node is scheduled or playing, do not collect the node prematurely | 287 // If a node is scheduled or playing, do not collect the node prematurely |
| 288 // even its reference is out of scope. Then fire onended event if assigned. | 288 // even its reference is out of scope. Then fire onended event if assigned. |
| 289 return GetAudioScheduledSourceHandler().IsPlayingOrScheduled(); | 289 return GetAudioScheduledSourceHandler().IsPlayingOrScheduled(); |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace blink | 292 } // namespace blink |
| OLD | NEW |