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

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

Issue 2759703002: Migrate WTF::HashMap::remove() to ::erase() (Closed)
Patch Set: rebase, fix one platform-specific reference Created 3 years, 9 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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 // If the context is going away, m_scheduledSuspends could have had all its 412 // If the context is going away, m_scheduledSuspends could have had all its
413 // entries removed. Check for that here. 413 // entries removed. Check for that here.
414 if (m_scheduledSuspends.size()) { 414 if (m_scheduledSuspends.size()) {
415 // |frame| must exist in the map. 415 // |frame| must exist in the map.
416 DCHECK(m_scheduledSuspends.contains(frame)); 416 DCHECK(m_scheduledSuspends.contains(frame));
417 417
418 SuspendMap::iterator it = m_scheduledSuspends.find(frame); 418 SuspendMap::iterator it = m_scheduledSuspends.find(frame);
419 it->value->resolve(); 419 it->value->resolve();
420 420
421 m_scheduledSuspends.remove(it); 421 m_scheduledSuspends.erase(it);
422 } 422 }
423 } 423 }
424 424
425 void OfflineAudioContext::rejectPendingResolvers() { 425 void OfflineAudioContext::rejectPendingResolvers() {
426 DCHECK(isMainThread()); 426 DCHECK(isMainThread());
427 427
428 // Wait until the suspend map is available for removal. 428 // Wait until the suspend map is available for removal.
429 AutoLocker locker(this); 429 AutoLocker locker(this);
430 430
431 // Offline context is going away so reject any promises that are still 431 // Offline context is going away so reject any promises that are still
(...skipping 15 matching lines...) Expand all
447 447
448 // Note that the GraphLock is required before this check. Since this needs 448 // Note that the GraphLock is required before this check. Since this needs
449 // to run on the audio thread, OfflineGraphAutoLocker must be used. 449 // to run on the audio thread, OfflineGraphAutoLocker must be used.
450 if (m_scheduledSuspends.contains(currentSampleFrame())) 450 if (m_scheduledSuspends.contains(currentSampleFrame()))
451 return true; 451 return true;
452 452
453 return false; 453 return false;
454 } 454 }
455 455
456 } // namespace blink 456 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698