Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.cpp

Issue 2384073002: reflow comments in platform/audio (Closed)
Patch Set: comments (heh!) Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
32 #include "platform/WaitableEvent.h" 32 #include "platform/WaitableEvent.h"
33 #include "public/platform/Platform.h" 33 #include "public/platform/Platform.h"
34 #include "public/platform/WebTaskRunner.h" 34 #include "public/platform/WebTaskRunner.h"
35 #include "public/platform/WebTraceLocation.h" 35 #include "public/platform/WebTraceLocation.h"
36 #include "wtf/PtrUtil.h" 36 #include "wtf/PtrUtil.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 using LoaderMap = HashMap<double, HRTFDatabaseLoader*>; 40 using LoaderMap = HashMap<double, HRTFDatabaseLoader*>;
41 41
42 // getLoaderMap() returns the static hash map that contains the mapping between the 42 // getLoaderMap() returns the static hash map that contains the mapping between
43 // sample rate and the corresponding HRTF database. 43 // the sample rate and the corresponding HRTF database.
44 static LoaderMap& getLoaderMap() { 44 static LoaderMap& getLoaderMap() {
45 DEFINE_STATIC_LOCAL(LoaderMap*, map, (new LoaderMap)); 45 DEFINE_STATIC_LOCAL(LoaderMap*, map, (new LoaderMap));
46 return *map; 46 return *map;
47 } 47 }
48 48
49 PassRefPtr<HRTFDatabaseLoader> 49 PassRefPtr<HRTFDatabaseLoader>
50 HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(float sampleRate) { 50 HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(float sampleRate) {
51 ASSERT(isMainThread()); 51 ASSERT(isMainThread());
52 52
53 RefPtr<HRTFDatabaseLoader> loader = getLoaderMap().get(sampleRate); 53 RefPtr<HRTFDatabaseLoader> loader = getLoaderMap().get(sampleRate);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // TODO(alexclarke): Should this be posted as a loading task? 130 // TODO(alexclarke): Should this be posted as a loading task?
131 m_thread->getWebTaskRunner()->postTask( 131 m_thread->getWebTaskRunner()->postTask(
132 BLINK_FROM_HERE, crossThreadBind(&HRTFDatabaseLoader::cleanupTask, 132 BLINK_FROM_HERE, crossThreadBind(&HRTFDatabaseLoader::cleanupTask,
133 crossThreadUnretained(this), 133 crossThreadUnretained(this),
134 crossThreadUnretained(&sync))); 134 crossThreadUnretained(&sync)));
135 sync.wait(); 135 sync.wait();
136 m_thread.reset(); 136 m_thread.reset();
137 } 137 }
138 138
139 } // namespace blink 139 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698