| OLD | NEW |
| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 size_t index = safeCast<size_t>(it - m_list.begin()); | 90 size_t index = safeCast<size_t>(it - m_list.begin()); |
| 91 SECURITY_DCHECK(index <= m_list.size()); | 91 SECURITY_DCHECK(index <= m_list.size()); |
| 92 return index; | 92 return index; |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool TextTrackCueList::remove(TextTrackCue* cue) { | 95 bool TextTrackCueList::remove(TextTrackCue* cue) { |
| 96 size_t index = m_list.find(cue); | 96 size_t index = m_list.find(cue); |
| 97 if (index == kNotFound) | 97 if (index == kNotFound) |
| 98 return false; | 98 return false; |
| 99 | 99 |
| 100 m_list.remove(index); | 100 m_list.erase(index); |
| 101 invalidateCueIndex(index); | 101 invalidateCueIndex(index); |
| 102 cue->invalidateCueIndex(); | 102 cue->invalidateCueIndex(); |
| 103 return true; | 103 return true; |
| 104 } | 104 } |
| 105 | 105 |
| 106 void TextTrackCueList::updateCueIndex(TextTrackCue* cue) { | 106 void TextTrackCueList::updateCueIndex(TextTrackCue* cue) { |
| 107 if (!remove(cue)) | 107 if (!remove(cue)) |
| 108 return; | 108 return; |
| 109 add(cue); | 109 add(cue); |
| 110 } | 110 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 135 DEFINE_TRACE(TextTrackCueList) { | 135 DEFINE_TRACE(TextTrackCueList) { |
| 136 visitor->trace(m_list); | 136 visitor->trace(m_list); |
| 137 } | 137 } |
| 138 | 138 |
| 139 DEFINE_TRACE_WRAPPERS(TextTrackCueList) { | 139 DEFINE_TRACE_WRAPPERS(TextTrackCueList) { |
| 140 for (auto cue : m_list) { | 140 for (auto cue : m_list) { |
| 141 visitor->traceWrappers(cue); | 141 visitor->traceWrappers(cue); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 } // namespace blink | 144 } // namespace blink |
| OLD | NEW |