| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 String codecs = contentType.parameter("codecs"); | 148 String codecs = contentType.parameter("codecs"); |
| 149 OwnPtr<WebSourceBuffer> webSourceBuffer = createWebSourceBuffer(contentType.
type(), codecs, exceptionState); | 149 OwnPtr<WebSourceBuffer> webSourceBuffer = createWebSourceBuffer(contentType.
type(), codecs, exceptionState); |
| 150 | 150 |
| 151 if (!webSourceBuffer) { | 151 if (!webSourceBuffer) { |
| 152 ASSERT(exceptionState.code() == NotSupportedError || exceptionState.code
() == QuotaExceededError); | 152 ASSERT(exceptionState.code() == NotSupportedError || exceptionState.code
() == QuotaExceededError); |
| 153 // 2. If type contains a MIME type that is not supported ..., then throw
a NotSupportedError exception and abort these steps. | 153 // 2. If type contains a MIME type that is not supported ..., then throw
a NotSupportedError exception and abort these steps. |
| 154 // 3. If the user agent can't handle any more SourceBuffer objects then
throw a QuotaExceededError exception and abort these steps | 154 // 3. If the user agent can't handle any more SourceBuffer objects then
throw a QuotaExceededError exception and abort these steps |
| 155 return 0; | 155 return 0; |
| 156 } | 156 } |
| 157 | 157 |
| 158 SourceBuffer* buffer = SourceBuffer::create(webSourceBuffer.release(), this,
m_asyncEventQueue.get()); | 158 SourceBuffer* buffer = SourceBuffer::create(std::move(webSourceBuffer), this
, m_asyncEventQueue.get()); |
| 159 // 6. Add the new object to sourceBuffers and fire a addsourcebuffer on that
object. | 159 // 6. Add the new object to sourceBuffers and fire a addsourcebuffer on that
object. |
| 160 m_sourceBuffers->add(buffer); | 160 m_sourceBuffers->add(buffer); |
| 161 | 161 |
| 162 // 7. Return the new object to the caller. | 162 // 7. Return the new object to the caller. |
| 163 WTF_LOG(Media, "MediaSource::addSourceBuffer(%s) %p -> %p", type.ascii().dat
a(), this, buffer); | 163 WTF_LOG(Media, "MediaSource::addSourceBuffer(%s) %p -> %p", type.ascii().dat
a(), this, buffer); |
| 164 return buffer; | 164 return buffer; |
| 165 } | 165 } |
| 166 | 166 |
| 167 void MediaSource::removeSourceBuffer(SourceBuffer* buffer, ExceptionState& excep
tionState) | 167 void MediaSource::removeSourceBuffer(SourceBuffer* buffer, ExceptionState& excep
tionState) |
| 168 { | 168 { |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 | 612 |
| 613 m_asyncEventQueue->enqueueEvent(event); | 613 m_asyncEventQueue->enqueueEvent(event); |
| 614 } | 614 } |
| 615 | 615 |
| 616 URLRegistry& MediaSource::registry() const | 616 URLRegistry& MediaSource::registry() const |
| 617 { | 617 { |
| 618 return MediaSourceRegistry::registry(); | 618 return MediaSourceRegistry::registry(); |
| 619 } | 619 } |
| 620 | 620 |
| 621 } // namespace blink | 621 } // namespace blink |
| OLD | NEW |