| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 void SourceBufferList::insert(size_t position, SourceBuffer* buffer) { | 50 void SourceBufferList::insert(size_t position, SourceBuffer* buffer) { |
| 51 m_list.insert(position, buffer); | 51 m_list.insert(position, buffer); |
| 52 scheduleEvent(EventTypeNames::addsourcebuffer); | 52 scheduleEvent(EventTypeNames::addsourcebuffer); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void SourceBufferList::remove(SourceBuffer* buffer) { | 55 void SourceBufferList::remove(SourceBuffer* buffer) { |
| 56 size_t index = m_list.find(buffer); | 56 size_t index = m_list.find(buffer); |
| 57 if (index == kNotFound) | 57 if (index == kNotFound) |
| 58 return; | 58 return; |
| 59 m_list.remove(index); | 59 m_list.erase(index); |
| 60 scheduleEvent(EventTypeNames::removesourcebuffer); | 60 scheduleEvent(EventTypeNames::removesourcebuffer); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void SourceBufferList::clear() { | 63 void SourceBufferList::clear() { |
| 64 m_list.clear(); | 64 m_list.clear(); |
| 65 scheduleEvent(EventTypeNames::removesourcebuffer); | 65 scheduleEvent(EventTypeNames::removesourcebuffer); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void SourceBufferList::scheduleEvent(const AtomicString& eventName) { | 68 void SourceBufferList::scheduleEvent(const AtomicString& eventName) { |
| 69 DCHECK(m_asyncEventQueue); | 69 DCHECK(m_asyncEventQueue); |
| 70 | 70 |
| 71 Event* event = Event::create(eventName); | 71 Event* event = Event::create(eventName); |
| 72 event->setTarget(this); | 72 event->setTarget(this); |
| 73 | 73 |
| 74 m_asyncEventQueue->enqueueEvent(event); | 74 m_asyncEventQueue->enqueueEvent(event); |
| 75 } | 75 } |
| 76 | 76 |
| 77 const AtomicString& SourceBufferList::interfaceName() const { | 77 const AtomicString& SourceBufferList::interfaceName() const { |
| 78 return EventTargetNames::SourceBufferList; | 78 return EventTargetNames::SourceBufferList; |
| 79 } | 79 } |
| 80 | 80 |
| 81 DEFINE_TRACE(SourceBufferList) { | 81 DEFINE_TRACE(SourceBufferList) { |
| 82 visitor->trace(m_asyncEventQueue); | 82 visitor->trace(m_asyncEventQueue); |
| 83 visitor->trace(m_list); | 83 visitor->trace(m_list); |
| 84 EventTargetWithInlineData::trace(visitor); | 84 EventTargetWithInlineData::trace(visitor); |
| 85 ContextClient::trace(visitor); | 85 ContextClient::trace(visitor); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace blink | 88 } // namespace blink |
| OLD | NEW |