Backed out changeset 1894b74b8931 (bug 1278198)
authorIris Hsiao <ihsiao@mozilla.com>
Fri, 22 Jul 2016 12:06:09 +0800
changeset 306206 18e628ae2f75f0aef309efee842ec9b9fa093d25
parent 306205 d00d42fc13d84dfb71a336ed77cc0ab35fc65403
child 306207 9bf111e894cbec836cb688095526a42bfbb5a64b
push id79800
push usercbook@mozilla.com
push dateFri, 22 Jul 2016 10:17:37 +0000
treeherdermozilla-inbound@30745bed2567 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1278198
milestone50.0a1
backs out1894b74b89317c32ee1f6c8d4e8ef88f64bc778a
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 1894b74b8931 (bug 1278198)
dom/media/gmp/widevine-adapter/WidevineFileIO.cpp
dom/media/gmp/widevine-adapter/WidevineFileIO.h
dom/media/gmp/widevine-adapter/moz.build
deleted file mode 100644
--- a/dom/media/gmp/widevine-adapter/WidevineFileIO.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-#include "WidevineFileIO.h"
-#include "WidevineUtils.h"
-#include "WidevineAdapter.h"
-
-using namespace cdm;
-
-namespace mozilla {
-
-void
-WidevineFileIO::Open(const char* aFilename, uint32_t aFilenameLength)
-{
-  mName = std::string(aFilename, aFilename + aFilenameLength);
-  GMPRecord* record = nullptr;
-  GMPErr err = GMPCreateRecord(aFilename, aFilenameLength, &record, static_cast<GMPRecordClient*>(this));
-  if (GMP_FAILED(err)) {
-    Log("WidevineFileIO::Open() '%s' GMPCreateRecord failed", mName.c_str());
-    mClient->OnOpenComplete(FileIOClient::kError);
-    return;
-  }
-  if (GMP_FAILED(record->Open())) {
-    Log("WidevineFileIO::Open() '%s' record open failed", mName.c_str());
-    mClient->OnOpenComplete(FileIOClient::kError);
-    return;
-  }
-
-  Log("WidevineFileIO::Open() '%s'", mName.c_str());
-  mRecord = record;
-}
-
-void
-WidevineFileIO::Read()
-{
-  if (!mRecord) {
-    Log("WidevineFileIO::Read() '%s' used uninitialized!", mName.c_str());
-    mClient->OnReadComplete(FileIOClient::kError, nullptr, 0);
-    return;
-  }
-  Log("WidevineFileIO::Read() '%s'", mName.c_str());
-  mRecord->Read();
-}
-
-void
-WidevineFileIO::Write(const uint8_t* aData, uint32_t aDataSize)
-{
-  if (!mRecord) {
-    Log("WidevineFileIO::Write() '%s' used uninitialized!", mName.c_str());
-    mClient->OnWriteComplete(FileIOClient::kError);
-    return;
-  }
-  mRecord->Write(aData, aDataSize);
-}
-
-void
-WidevineFileIO::Close()
-{
-  Log("WidevineFileIO::Close() '%s'", mName.c_str());
-  if (mRecord) {
-    mRecord->Close();
-    mRecord = nullptr;
-  }
-  delete this;
-}
-
-static FileIOClient::Status
-GMPToWidevineFileStatus(GMPErr aStatus)
-{
-  switch (aStatus) {
-    case GMPRecordInUse: return FileIOClient::kInUse;
-    case GMPNoErr: return FileIOClient::kSuccess;
-    default: return FileIOClient::kError;
-  }
-}
-
-void
-WidevineFileIO::OpenComplete(GMPErr aStatus)
-{
-  Log("WidevineFileIO::OpenComplete() '%s' status=%d", mName.c_str(), aStatus);
-  mClient->OnOpenComplete(GMPToWidevineFileStatus(aStatus));
-}
-
-void
-WidevineFileIO::ReadComplete(GMPErr aStatus,
-                             const uint8_t* aData,
-                             uint32_t aDataSize)
-{
-  Log("WidevineFileIO::OnReadComplete() '%s' status=%d", mName.c_str(), aStatus);
-  mClient->OnReadComplete(GMPToWidevineFileStatus(aStatus), aData, aDataSize);
-}
-
-void
-WidevineFileIO::WriteComplete(GMPErr aStatus)
-{
-  Log("WidevineFileIO::WriteComplete() '%s' status=%d", mName.c_str(), aStatus);
-  mClient->OnWriteComplete(GMPToWidevineFileStatus(aStatus));
-}
-
-} // namespace mozilla
deleted file mode 100644
--- a/dom/media/gmp/widevine-adapter/WidevineFileIO.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this
-* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef WidevineFileIO_h_
-#define WidevineFileIO_h_
-
-#include <stddef.h>
-#include "content_decryption_module.h"
-#include "gmp-api/gmp-storage.h"
-#include <string>
-
-namespace mozilla {
-
-class WidevineFileIO : public cdm::FileIO
-                     , public GMPRecordClient
-{
-public:
-  explicit WidevineFileIO(cdm::FileIOClient* aClient)
-    : mClient(aClient)
-    , mRecord(nullptr)
-  {}
-
-  // cdm::FileIO
-  void Open(const char* aFilename, uint32_t aFilenameLength) override;
-  void Read() override;
-  void Write(const uint8_t* aData, uint32_t aDataSize) override;
-  void Close() override;
-
-  // GMPRecordClient
-  void OpenComplete(GMPErr aStatus) override;
-  void ReadComplete(GMPErr aStatus,
-                    const uint8_t* aData,
-                    uint32_t aDataSize) override;
-  void WriteComplete(GMPErr aStatus) override;
-
-private:
-  cdm::FileIOClient* mClient;
-  GMPRecord* mRecord;
-  std::string mName;
-};
-
-} // namespace mozilla
-
-#endif // WidevineFileIO_h_
\ No newline at end of file
--- a/dom/media/gmp/widevine-adapter/moz.build
+++ b/dom/media/gmp/widevine-adapter/moz.build
@@ -2,17 +2,16 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 SOURCES += [
     'WidevineAdapter.cpp',
     'WidevineDecryptor.cpp',
-    'WidevineFileIO.cpp',
     'WidevineUtils.cpp',
     'WidevineVideoDecoder.cpp',
     'WidevineVideoFrame.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [