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

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

Issue 1905343002: Replace AllowCrossThreadAccess() + ThreadSafeRefCounted pointers with PassRefPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_3_DoNotAllow_AllowCrossThreadAccess_GCed
Patch Set: Rebase. 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 197
198 void OfflineAudioDestinationHandler::suspendOfflineRendering() 198 void OfflineAudioDestinationHandler::suspendOfflineRendering()
199 { 199 {
200 ASSERT(!isMainThread()); 200 ASSERT(!isMainThread());
201 201
202 // The actual rendering has been suspended. Notify the context. 202 // The actual rendering has been suspended. Notify the context.
203 if (context()->getExecutionContext()) { 203 if (context()->getExecutionContext()) {
204 context()->getExecutionContext()->postTask( 204 context()->getExecutionContext()->postTask(
205 BLINK_FROM_HERE, 205 BLINK_FROM_HERE,
206 createCrossThreadTask( 206 createCrossThreadTask(&OfflineAudioDestinationHandler::notifySuspend , PassRefPtr<OfflineAudioDestinationHandler>(this), context()->currentSampleFram e()));
hiroshige 2016/05/17 03:46:12 ditto.
207 &OfflineAudioDestinationHandler::notifySuspend,
208 this,
209 context()->currentSampleFrame()));
210 } 207 }
211 } 208 }
212 209
213 void OfflineAudioDestinationHandler::finishOfflineRendering() 210 void OfflineAudioDestinationHandler::finishOfflineRendering()
214 { 211 {
215 ASSERT(!isMainThread()); 212 ASSERT(!isMainThread());
216 213
217 // The actual rendering has been completed. Notify the context. 214 // The actual rendering has been completed. Notify the context.
218 if (context()->getExecutionContext()) { 215 if (context()->getExecutionContext()) {
219 context()->getExecutionContext()->postTask(BLINK_FROM_HERE, 216 context()->getExecutionContext()->postTask(BLINK_FROM_HERE,
220 createCrossThreadTask(&OfflineAudioDestinationHandler::notifyComplet e, AllowCrossThreadAccess(this))); 217 createCrossThreadTask(&OfflineAudioDestinationHandler::notifyComplet e, PassRefPtr<OfflineAudioDestinationHandler>(this)));
221 } 218 }
222 } 219 }
223 220
224 void OfflineAudioDestinationHandler::notifySuspend(size_t frame) 221 void OfflineAudioDestinationHandler::notifySuspend(size_t frame)
225 { 222 {
226 ASSERT(isMainThread()); 223 ASSERT(isMainThread());
227 224
228 if (context()) 225 if (context())
229 context()->resolveSuspendOnMainThread(frame); 226 context()->resolveSuspendOnMainThread(frame);
230 } 227 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 { 308 {
312 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); 309 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget));
313 } 310 }
314 311
315 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(AbstractAudioCo ntext* context, AudioBuffer* renderTarget) 312 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create(AbstractAudioCo ntext* context, AudioBuffer* renderTarget)
316 { 313 {
317 return new OfflineAudioDestinationNode(*context, renderTarget); 314 return new OfflineAudioDestinationNode(*context, renderTarget);
318 } 315 }
319 316
320 } // namespace blink 317 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698