| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 m_mode = newMode; | 156 m_mode = newMode; |
| 157 } | 157 } |
| 158 | 158 |
| 159 PassRefPtr<TimeRanges> SourceBuffer::buffered(ExceptionState& exceptionState) co
nst | 159 PassRefPtr<TimeRanges> SourceBuffer::buffered(ExceptionState& exceptionState) co
nst |
| 160 { | 160 { |
| 161 // Section 3.1 buffered attribute steps. | 161 // Section 3.1 buffered attribute steps. |
| 162 // 1. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an | 162 // 1. If this object has been removed from the sourceBuffers attribute of th
e parent media source then throw an |
| 163 // InvalidStateError exception and abort these steps. | 163 // InvalidStateError exception and abort these steps. |
| 164 if (isRemoved()) { | 164 if (isRemoved()) { |
| 165 exceptionState.throwDOMException(InvalidStateError, "This SourceBuffer h
as been removed from the parent media source."); | 165 exceptionState.throwDOMException(InvalidStateError, "This SourceBuffer h
as been removed from the parent media source."); |
| 166 return 0; | 166 return nullptr; |
| 167 } | 167 } |
| 168 | 168 |
| 169 // 2. Return a new static normalized TimeRanges object for the media segment
s buffered. | 169 // 2. Return a new static normalized TimeRanges object for the media segment
s buffered. |
| 170 return TimeRanges::create(m_webSourceBuffer->buffered()); | 170 return TimeRanges::create(m_webSourceBuffer->buffered()); |
| 171 } | 171 } |
| 172 | 172 |
| 173 double SourceBuffer::timestampOffset() const | 173 double SourceBuffer::timestampOffset() const |
| 174 { | 174 { |
| 175 return m_timestampOffset; | 175 return m_timestampOffset; |
| 176 } | 176 } |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 | 423 |
| 424 void SourceBuffer::removedFromMediaSource() | 424 void SourceBuffer::removedFromMediaSource() |
| 425 { | 425 { |
| 426 if (isRemoved()) | 426 if (isRemoved()) |
| 427 return; | 427 return; |
| 428 | 428 |
| 429 abortIfUpdating(); | 429 abortIfUpdating(); |
| 430 | 430 |
| 431 m_webSourceBuffer->removedFromMediaSource(); | 431 m_webSourceBuffer->removedFromMediaSource(); |
| 432 m_webSourceBuffer.clear(); | 432 m_webSourceBuffer.clear(); |
| 433 m_source = 0; | 433 m_source = nullptr; |
| 434 m_asyncEventQueue = 0; | 434 m_asyncEventQueue = 0; |
| 435 } | 435 } |
| 436 | 436 |
| 437 bool SourceBuffer::hasPendingActivity() const | 437 bool SourceBuffer::hasPendingActivity() const |
| 438 { | 438 { |
| 439 return m_source; | 439 return m_source; |
| 440 } | 440 } |
| 441 | 441 |
| 442 void SourceBuffer::suspend() | 442 void SourceBuffer::suspend() |
| 443 { | 443 { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 // 14. Queue a task to fire a simple event named updateend at this SourceBuf
fer object. | 670 // 14. Queue a task to fire a simple event named updateend at this SourceBuf
fer object. |
| 671 scheduleEvent(EventTypeNames::updateend); | 671 scheduleEvent(EventTypeNames::updateend); |
| 672 TRACE_EVENT_ASYNC_END0("media", "SourceBuffer::appendStream", this); | 672 TRACE_EVENT_ASYNC_END0("media", "SourceBuffer::appendStream", this); |
| 673 } | 673 } |
| 674 | 674 |
| 675 void SourceBuffer::clearAppendStreamState() | 675 void SourceBuffer::clearAppendStreamState() |
| 676 { | 676 { |
| 677 m_streamMaxSizeValid = false; | 677 m_streamMaxSizeValid = false; |
| 678 m_streamMaxSize = 0; | 678 m_streamMaxSize = 0; |
| 679 m_loader.clear(); | 679 m_loader.clear(); |
| 680 m_stream = 0; | 680 m_stream = nullptr; |
| 681 } | 681 } |
| 682 | 682 |
| 683 void SourceBuffer::didStartLoading() | 683 void SourceBuffer::didStartLoading() |
| 684 { | 684 { |
| 685 WTF_LOG(Media, "SourceBuffer::didStartLoading() %p", this); | 685 WTF_LOG(Media, "SourceBuffer::didStartLoading() %p", this); |
| 686 } | 686 } |
| 687 | 687 |
| 688 void SourceBuffer::didReceiveDataForClient(const char* data, unsigned dataLength
) | 688 void SourceBuffer::didReceiveDataForClient(const char* data, unsigned dataLength
) |
| 689 { | 689 { |
| 690 WTF_LOG(Media, "SourceBuffer::didReceiveDataForClient(%d) %p", dataLength, t
his); | 690 WTF_LOG(Media, "SourceBuffer::didReceiveDataForClient(%d) %p", dataLength, t
his); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 705 WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); | 705 WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this); |
| 706 appendStreamDone(false); | 706 appendStreamDone(false); |
| 707 } | 707 } |
| 708 | 708 |
| 709 void SourceBuffer::trace(Visitor* visitor) | 709 void SourceBuffer::trace(Visitor* visitor) |
| 710 { | 710 { |
| 711 visitor->trace(m_source); | 711 visitor->trace(m_source); |
| 712 } | 712 } |
| 713 | 713 |
| 714 } // namespace WebCore | 714 } // namespace WebCore |
| OLD | NEW |