Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: Source/modules/mediarecorder/MediaRecorder.cpp

Issue 1354863002: MediaRecorder: Adding BlobEvent and connecting it in MediaRecorderHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: BlobEvent in global-interface-listing-expected.txt, and rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/mediarecorder/MediaRecorder.h ('k') | Source/modules/mediarecorder/MediaRecorder.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediarecorder/MediaRecorder.cpp
diff --git a/Source/modules/mediarecorder/MediaRecorder.cpp b/Source/modules/mediarecorder/MediaRecorder.cpp
index 3183ca6005282f21e176fabf76c8c5c3bf8d7d43..bd0f537e8404c265c3a32a1513cec7c5e50fd441 100644
--- a/Source/modules/mediarecorder/MediaRecorder.cpp
+++ b/Source/modules/mediarecorder/MediaRecorder.cpp
@@ -9,6 +9,7 @@
#include "core/fileapi/Blob.h"
#include "modules/EventModules.h"
#include "modules/EventTargetModules.h"
+#include "modules/mediarecorder/BlobEvent.h"
#include "modules/mediarecorder/MediaRecorderErrorEvent.h"
#include "platform/NotImplemented.h"
#include "platform/blob/BlobData.h"
@@ -152,7 +153,7 @@ void MediaRecorder::requestData(ExceptionState& exceptionState)
return;
}
- createBlobEvent(BlobData::create());
+ createBlobEvent(nullptr);
}
String MediaRecorder::canRecordMimeType(const String& mimeType)
@@ -212,10 +213,9 @@ void MediaRecorder::writeData(const char* data, size_t length, bool lastInSlice)
// TODO(mcasas): Act as |m_ignoredMutedMedia| instructs if |m_stream| track(s) is in muted() state.
// TODO(mcasas): Use |lastInSlice| to indicate to JS that recording is done.
-
OwnPtr<BlobData> blobData = BlobData::create();
blobData->appendBytes(data, length);
- createBlobEvent(blobData.release());
+ createBlobEvent(Blob::create(BlobDataHandle::create(blobData.release(), length)));
}
void MediaRecorder::failOutOfMemory(const WebString& message)
@@ -245,10 +245,10 @@ void MediaRecorder::failOtherRecordingError(const WebString& message)
stopRecording();
}
-void MediaRecorder::createBlobEvent(PassOwnPtr<BlobData> blobData)
+void MediaRecorder::createBlobEvent(Blob* blob)
{
- // TODO(mcasas): Launch a BlobEvent when that class is landed, but also see https://github.com/w3c/mediacapture-record/issues/17.
- notImplemented();
+ // TODO(mcasas): Consider launching an Event with a TypedArray inside, see https://github.com/w3c/mediacapture-record/issues/17.
+ scheduleDispatchEvent(BlobEvent::create(EventTypeNames::dataavailable, blob));
}
void MediaRecorder::stopRecording()
@@ -258,7 +258,7 @@ void MediaRecorder::stopRecording()
m_recorderHandler->stop();
- createBlobEvent(BlobData::create());
+ createBlobEvent(nullptr);
scheduleDispatchEvent(Event::create(EventTypeNames::stop));
}
« no previous file with comments | « Source/modules/mediarecorder/MediaRecorder.h ('k') | Source/modules/mediarecorder/MediaRecorder.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698