Bug 1083373 part 1: Remove unused member-variable mHost from ClearKeySession and ClearKeyDecryptionManager. r=edwin
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 27 Oct 2014 18:11:55 -0700
changeset 212582 a6e6e78b033874adee6293f306ff3e4fed713b1e
parent 212581 ecf4df03029a90eae1b553306cc9ca5867850f36
child 212583 c7e523e3d339410de77475c74a87c12ab53be880
push id27721
push usercbook@mozilla.com
push dateTue, 28 Oct 2014 14:55:05 +0000
treeherdermozilla-central@c0ddb1b098ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1083373
milestone36.0a1
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
Bug 1083373 part 1: Remove unused member-variable mHost from ClearKeySession and ClearKeyDecryptionManager. r=edwin
media/gmp-clearkey/0.1/ClearKeyDecryptionManager.cpp
media/gmp-clearkey/0.1/ClearKeyDecryptionManager.h
media/gmp-clearkey/0.1/ClearKeySession.cpp
media/gmp-clearkey/0.1/ClearKeySession.h
media/gmp-clearkey/0.1/gmp-clearkey.cpp
--- a/media/gmp-clearkey/0.1/ClearKeyDecryptionManager.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeyDecryptionManager.cpp
@@ -74,18 +74,17 @@ private:
 
   GMPDecryptorCallback* mCallback;
   GMPThread* mThread;
 
   Key mKey;
 };
 
 
-ClearKeyDecryptionManager::ClearKeyDecryptionManager(GMPDecryptorHost* aHost)
-  : mHost(aHost)
+ClearKeyDecryptionManager::ClearKeyDecryptionManager()
 {
   CK_LOGD("ClearKeyDecryptionManager ctor");
 }
 
 ClearKeyDecryptionManager::~ClearKeyDecryptionManager()
 {
   CK_LOGD("ClearKeyDecryptionManager dtor");
 }
@@ -127,17 +126,17 @@ ClearKeyDecryptionManager::CreateSession
     mCallback->RejectPromise(aPromiseId, kGMPNotSupportedError,
                              nullptr /* message */, 0 /* messageLen */);
     return;
   }
 
   string sessionId = GetNewSessionId();
   assert(mSessions.find(sessionId) == mSessions.end());
 
-  ClearKeySession* session = new ClearKeySession(sessionId, mHost, mCallback);
+  ClearKeySession* session = new ClearKeySession(sessionId, mCallback);
   session->Init(aPromiseId, aInitData, aInitDataSize);
   mSessions[sessionId] = session;
 
   const vector<KeyId>& sessionKeys = session->GetKeyIds();
   vector<KeyId> neededKeys;
   for (auto it = sessionKeys.begin(); it != sessionKeys.end(); it++) {
     if (mDecryptors.find(*it) == mDecryptors.end()) {
       // Need to request this key ID from the client.
--- a/media/gmp-clearkey/0.1/ClearKeyDecryptionManager.h
+++ b/media/gmp-clearkey/0.1/ClearKeyDecryptionManager.h
@@ -14,17 +14,17 @@
 #include "gmp-api/gmp-decryption.h"
 #include "ScopedNSSTypes.h"
 
 class ClearKeyDecryptor;
 
 class ClearKeyDecryptionManager MOZ_FINAL : public GMPDecryptor
 {
 public:
-  explicit ClearKeyDecryptionManager(GMPDecryptorHost* aHost);
+  ClearKeyDecryptionManager();
   ~ClearKeyDecryptionManager();
 
   virtual void Init(GMPDecryptorCallback* aCallback) MOZ_OVERRIDE;
 
   virtual void CreateSession(uint32_t aPromiseId,
                              const char* aInitDataType,
                              uint32_t aInitDataTypeSize,
                              const uint8_t* aInitData,
@@ -55,15 +55,14 @@ public:
 
   virtual void Decrypt(GMPBuffer* aBuffer,
                        GMPEncryptedBufferMetadata* aMetadata) MOZ_OVERRIDE;
 
   virtual void DecryptingComplete() MOZ_OVERRIDE;
 
 private:
   GMPDecryptorCallback* mCallback;
-  GMPDecryptorHost* mHost;
 
   std::map<KeyId, ClearKeyDecryptor*> mDecryptors;
   std::map<std::string, ClearKeySession*> mSessions;
 };
 
 #endif // __ClearKeyDecryptor_h__
--- a/media/gmp-clearkey/0.1/ClearKeySession.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeySession.cpp
@@ -7,20 +7,18 @@
 
 #include "gmp-api/gmp-decryption.h"
 #include "mozilla/Endian.h"
 #include "pk11pub.h"
 
 using namespace mozilla;
 
 ClearKeySession::ClearKeySession(const std::string& aSessionId,
-                                 GMPDecryptorHost* aHost,
                                  GMPDecryptorCallback* aCallback)
   : mSessionId(aSessionId)
-  , mHost(aHost)
   , mCallback(aCallback)
 {
   CK_LOGD("ClearKeySession ctor %p", this);
 }
 
 ClearKeySession::~ClearKeySession()
 {
   CK_LOGD("ClearKeySession dtor %p", this);
--- a/media/gmp-clearkey/0.1/ClearKeySession.h
+++ b/media/gmp-clearkey/0.1/ClearKeySession.h
@@ -16,25 +16,24 @@ class GMPEncryptedBufferMetadata;
  * Currently useless; will be fleshed out later with support for persistent
  * key sessions.
  */
 
 class ClearKeySession
 {
 public:
   ClearKeySession(const std::string& aSessionId,
-                  GMPDecryptorHost* aHost, GMPDecryptorCallback *aCallback);
+                  GMPDecryptorCallback* aCallback);
 
   ~ClearKeySession();
 
   const std::vector<KeyId>& GetKeyIds() { return mKeyIds; }
 
   void Init(uint32_t aPromiseId,
             const uint8_t* aInitData, uint32_t aInitDataSize);
 private:
   std::string mSessionId;
   std::vector<KeyId> mKeyIds;
 
   GMPDecryptorCallback* mCallback;
-  GMPDecryptorHost* mHost;
 };
 
 #endif // __ClearKeySession_h__
--- a/media/gmp-clearkey/0.1/gmp-clearkey.cpp
+++ b/media/gmp-clearkey/0.1/gmp-clearkey.cpp
@@ -30,17 +30,17 @@ GMPInit(GMPPlatformAPI* aPlatformAPI)
 
 MOZ_EXPORT GMPErr
 GMPGetAPI(const char* aApiName, void* aHostAPI, void** aPluginAPI)
 {
   if (strcmp(aApiName, "eme-decrypt")) {
     return GMPNotImplementedErr;
   }
 
-  *aPluginAPI = new ClearKeyDecryptionManager(static_cast<GMPDecryptorHost*>(aHostAPI));
+  *aPluginAPI = new ClearKeyDecryptionManager();
 
   return GMPNoErr;
 }
 
 MOZ_EXPORT GMPErr
 GMPShutdown(void)
 {
   return GMPNoErr;