Bug 833095 - Fix format of file notification when recording complete. r=mikeh

This commit is contained in:
Dale Harvey 2013-01-23 16:35:06 -05:00
parent f84d147557
commit cfa3d2a2b5

View File

@ -904,9 +904,8 @@ nsGonkCameraControl::StartRecordingImpl(StartRecordingTask* aStartRecording)
class RecordingComplete : public nsRunnable
{
public:
RecordingComplete(DeviceStorageFile* aFile, nsACString& aType)
RecordingComplete(DeviceStorageFile* aFile)
: mFile(aFile)
, mType(aType)
{ }
~RecordingComplete() { }
@ -915,16 +914,13 @@ public:
{
MOZ_ASSERT(NS_IsMainThread());
nsString data;
CopyASCIItoUTF16(mType, data);
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
obs->NotifyObservers(mFile, "file-watcher-notify", data.get());
obs->NotifyObservers(mFile, "file-watcher-notify", NS_LITERAL_STRING("modified").get());
return NS_OK;
}
private:
nsRefPtr<DeviceStorageFile> mFile;
nsCString mType;
};
nsresult
@ -937,8 +933,7 @@ nsGonkCameraControl::StopRecordingImpl(StopRecordingTask* aStopRecording)
mRecorder = nullptr;
// notify DeviceStorage that the new video file is closed and ready
nsCString type(mRecorderProfile->GetFileMimeType());
nsCOMPtr<nsIRunnable> recordingComplete = new RecordingComplete(mVideoFile, type);
nsCOMPtr<nsIRunnable> recordingComplete = new RecordingComplete(mVideoFile);
return NS_DispatchToMainThread(recordingComplete, NS_DISPATCH_NORMAL);
}