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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.cpp

Issue 1954663002: Initialize DeferredTaskHandler's audio thread ID once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: out-of-line setter Created 4 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // Need to check if the context actually alive. Otherwise the subsequent 54 // Need to check if the context actually alive. Otherwise the subsequent
55 // steps will fail. If the context is not alive somehow, return immediately 55 // steps will fail. If the context is not alive somehow, return immediately
56 // and do nothing. 56 // and do nothing.
57 // 57 //
58 // TODO(hongchan): because the context can go away while rendering, so this 58 // TODO(hongchan): because the context can go away while rendering, so this
59 // check cannot guarantee the safe execution of the following steps. 59 // check cannot guarantee the safe execution of the following steps.
60 ASSERT(context()); 60 ASSERT(context());
61 if (!context()) 61 if (!context())
62 return; 62 return;
63 63
64 context()->deferredTaskHandler().setAudioThread(currentThread()); 64 context()->deferredTaskHandler().setAudioThreadToCurrentThread();
65 65
66 // If the destination node is not initialized, pass the silence to the final 66 // If the destination node is not initialized, pass the silence to the final
67 // audio destination (one step before the FIFO). This check is for the case 67 // audio destination (one step before the FIFO). This check is for the case
68 // where the destination is in the middle of tearing down process. 68 // where the destination is in the middle of tearing down process.
69 if (!isInitialized()) { 69 if (!isInitialized()) {
70 destinationBus->zero(); 70 destinationBus->zero();
71 return; 71 return;
72 } 72 }
73 73
74 // Let the context take care of any business at the start of each render qua ntum. 74 // Let the context take care of any business at the start of each render qua ntum.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 return static_cast<AudioDestinationHandler&>(handler()); 117 return static_cast<AudioDestinationHandler&>(handler());
118 } 118 }
119 119
120 unsigned long AudioDestinationNode::maxChannelCount() const 120 unsigned long AudioDestinationNode::maxChannelCount() const
121 { 121 {
122 return audioDestinationHandler().maxChannelCount(); 122 return audioDestinationHandler().maxChannelCount();
123 } 123 }
124 124
125 } // namespace blink 125 } // namespace blink
126 126
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/DeferredTaskHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698