| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 void lock(); | 123 void lock(); |
| 124 bool tryLock(); | 124 bool tryLock(); |
| 125 void unlock(); | 125 void unlock(); |
| 126 | 126 |
| 127 // This locks the audio render thread for OfflineAudioContext rendering. | 127 // This locks the audio render thread for OfflineAudioContext rendering. |
| 128 // MUST NOT be used in the real-time audio context. | 128 // MUST NOT be used in the real-time audio context. |
| 129 void offlineLock(); | 129 void offlineLock(); |
| 130 | 130 |
| 131 #if DCHECK_IS_ON() | |
| 132 // Returns true if this thread owns the context's lock. | 131 // Returns true if this thread owns the context's lock. |
| 133 bool isGraphOwner(); | 132 bool isGraphOwner(); |
| 134 #endif | |
| 135 | 133 |
| 136 class MODULES_EXPORT AutoLocker { | 134 class MODULES_EXPORT AutoLocker { |
| 137 STACK_ALLOCATED(); | 135 STACK_ALLOCATED(); |
| 138 | 136 |
| 139 public: | 137 public: |
| 140 explicit AutoLocker(DeferredTaskHandler& handler) : m_handler(handler) { | 138 explicit AutoLocker(DeferredTaskHandler& handler) : m_handler(handler) { |
| 141 m_handler.lock(); | 139 m_handler.lock(); |
| 142 } | 140 } |
| 143 explicit AutoLocker(BaseAudioContext*); | 141 explicit AutoLocker(BaseAudioContext*); |
| 144 | 142 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 Vector<RefPtr<AudioHandler>> m_deletableOrphanHandlers; | 200 Vector<RefPtr<AudioHandler>> m_deletableOrphanHandlers; |
| 203 | 201 |
| 204 // Graph locking. | 202 // Graph locking. |
| 205 RecursiveMutex m_contextGraphMutex; | 203 RecursiveMutex m_contextGraphMutex; |
| 206 volatile ThreadIdentifier m_audioThread; | 204 volatile ThreadIdentifier m_audioThread; |
| 207 }; | 205 }; |
| 208 | 206 |
| 209 } // namespace blink | 207 } // namespace blink |
| 210 | 208 |
| 211 #endif // DeferredTaskHandler_h | 209 #endif // DeferredTaskHandler_h |
| OLD | NEW |