| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/mediarecorder/MediaRecorder.h" | 5 #include "modules/mediarecorder/MediaRecorder.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Dictionary.h" | 7 #include "bindings/core/v8/Dictionary.h" |
| 8 #include "core/events/Event.h" | 8 #include "core/events/Event.h" |
| 9 #include "core/fileapi/Blob.h" | 9 #include "core/fileapi/Blob.h" |
| 10 #include "core/inspector/ConsoleMessage.h" | 10 #include "core/inspector/ConsoleMessage.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 if (!m_blobData) | 299 if (!m_blobData) |
| 300 m_blobData = BlobData::create(); | 300 m_blobData = BlobData::create(); |
| 301 if (data) | 301 if (data) |
| 302 m_blobData->appendBytes(data, length); | 302 m_blobData->appendBytes(data, length); |
| 303 | 303 |
| 304 if (!lastInSlice) | 304 if (!lastInSlice) |
| 305 return; | 305 return; |
| 306 | 306 |
| 307 // Cache |m_blobData->length()| before release()ng it. | 307 // Cache |m_blobData->length()| before release()ng it. |
| 308 const long long blobDataLength = m_blobData->length(); | 308 const long long blobDataLength = m_blobData->length(); |
| 309 createBlobEvent(Blob::create(BlobDataHandle::create(m_blobData.release(), bl
obDataLength))); | 309 createBlobEvent(Blob::create(BlobDataHandle::create(std::move(m_blobData), b
lobDataLength))); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void MediaRecorder::onError(const WebString& message) | 312 void MediaRecorder::onError(const WebString& message) |
| 313 { | 313 { |
| 314 // TODO(mcasas): Beef up the Error Event and add the |message|, see https://
github.com/w3c/mediacapture-record/issues/31 | 314 // TODO(mcasas): Beef up the Error Event and add the |message|, see https://
github.com/w3c/mediacapture-record/issues/31 |
| 315 scheduleDispatchEvent(Event::create(EventTypeNames::error)); | 315 scheduleDispatchEvent(Event::create(EventTypeNames::error)); |
| 316 } | 316 } |
| 317 | 317 |
| 318 void MediaRecorder::createBlobEvent(Blob* blob) | 318 void MediaRecorder::createBlobEvent(Blob* blob) |
| 319 { | 319 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 DEFINE_TRACE(MediaRecorder) | 351 DEFINE_TRACE(MediaRecorder) |
| 352 { | 352 { |
| 353 visitor->trace(m_stream); | 353 visitor->trace(m_stream); |
| 354 visitor->trace(m_dispatchScheduledEventRunner); | 354 visitor->trace(m_dispatchScheduledEventRunner); |
| 355 visitor->trace(m_scheduledEvents); | 355 visitor->trace(m_scheduledEvents); |
| 356 EventTargetWithInlineData::trace(visitor); | 356 EventTargetWithInlineData::trace(visitor); |
| 357 ActiveDOMObject::trace(visitor); | 357 ActiveDOMObject::trace(visitor); |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace blink | 360 } // namespace blink |
| OLD | NEW |