| 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 #include "platform/audio/HRTFDatabaseLoader.h" | 33 #include "platform/audio/HRTFDatabaseLoader.h" |
| 34 | 34 |
| 35 #include "platform/Task.h" | 35 #include "platform/Task.h" |
| 36 #include "platform/TaskSynchronizer.h" | 36 #include "platform/TaskSynchronizer.h" |
| 37 #include "public/platform/Platform.h" | 37 #include "public/platform/Platform.h" |
| 38 #include "wtf/MainThread.h" | 38 #include "wtf/MainThread.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 typedef HeapHashMap<double, WeakMember<HRTFDatabaseLoader> > LoaderMap; | 42 typedef HeapHashMap<double, WeakMember<HRTFDatabaseLoader>> LoaderMap; |
| 43 | 43 |
| 44 static LoaderMap& loaderMap() | 44 static LoaderMap& loaderMap() |
| 45 { | 45 { |
| 46 DEFINE_STATIC_LOCAL(Persistent<LoaderMap>, map, (new LoaderMap)); | 46 DEFINE_STATIC_LOCAL(Persistent<LoaderMap>, map, (new LoaderMap)); |
| 47 return *map; | 47 return *map; |
| 48 } | 48 } |
| 49 | 49 |
| 50 HRTFDatabaseLoader* HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(f
loat sampleRate) | 50 HRTFDatabaseLoader* HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(f
loat sampleRate) |
| 51 { | 51 { |
| 52 ASSERT(isMainThread()); | 52 ASSERT(isMainThread()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 TaskSynchronizer sync; | 124 TaskSynchronizer sync; |
| 125 m_thread->postTask(new Task(WTF::bind(&HRTFDatabaseLoader::cleanupTask, this
, &sync))); | 125 m_thread->postTask(new Task(WTF::bind(&HRTFDatabaseLoader::cleanupTask, this
, &sync))); |
| 126 sync.waitForTaskCompletion(); | 126 sync.waitForTaskCompletion(); |
| 127 m_thread.clear(); | 127 m_thread.clear(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace blink | 130 } // namespace blink |
| 131 | 131 |
| 132 #endif // ENABLE(WEB_AUDIO) | 132 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |