Backed out changeset 05850dac2882 (bug 1143562) for B2G Emulator ICS M2 bustage CLOSED TREE
authorNigel Babu <nigelbabu@gmail.com>
Wed, 18 Mar 2015 12:20:57 +0530
changeset 234206 cfb59c56e963e8d386988aa304eb848ed5123811
parent 234205 6cf2a639d0b3781dc49142905c8fdd3234a2b6ab
child 234207 6799607b934eb6bd8e0004a7a7200f640a1335c8
push id28436
push usercbook@mozilla.com
push dateWed, 18 Mar 2015 12:52:36 +0000
treeherderautoland@41a61514461e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1143562
milestone39.0a1
backs out05850dac2882d31bef444f0520889e041ee2d63b
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 05850dac2882 (bug 1143562) for B2G Emulator ICS M2 bustage CLOSED TREE
dom/media/gmp/GMPService.cpp
dom/media/gmp/GMPService.h
--- a/dom/media/gmp/GMPService.cpp
+++ b/dom/media/gmp/GMPService.cpp
@@ -186,37 +186,36 @@ GeckoMediaPluginService::Init()
   MOZ_ALWAYS_TRUE(NS_SUCCEEDED(obsService->AddObserver(this, "mediakeys-request", false)));
 #endif
 
   nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
   if (prefs) {
     prefs->AddObserver("media.gmp.plugin.crash", this, false);
   }
 
+#ifndef MOZ_WIDGET_GONK
   // Directory service is main thread only, so cache the profile dir here
   // so that we can use it off main thread.
-#ifdef MOZ_WIDGET_GONK
-  nsresult rv = NS_NewLocalFile(NS_LITERAL_STRING("/data/b2g/mozilla"), false, getter_AddRefs(mStorageBaseDir));
-#else
+  // We only do this on non-B2G, as this fails in multi-process Gecko.
+  // TODO: Make this work in multi-process Gecko.
   nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(mStorageBaseDir));
-#endif
-
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = mStorageBaseDir->AppendNative(NS_LITERAL_CSTRING("gmp"));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   rv = mStorageBaseDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
   if (NS_WARN_IF(NS_FAILED(rv) && rv != NS_ERROR_FILE_ALREADY_EXISTS)) {
     return rv;
   }
+#endif
 
   // Kick off scanning for plugins
   nsCOMPtr<nsIThread> thread;
   return GetThread(getter_AddRefs(thread));
 }
 
 NS_IMETHODIMP
 GeckoMediaPluginService::Observe(nsISupports* aSubject,
@@ -949,20 +948,24 @@ GeckoMediaPluginService::ReAddOnGMPThrea
   // Schedule aOld to be destroyed.  We can't destroy it from here since we
   // may be inside ActorDestroyed() for it.
   NS_DispatchToCurrentThread(WrapRunnableNM(&Dummy, aOld));
 }
 
 NS_IMETHODIMP
 GeckoMediaPluginService::GetStorageDir(nsIFile** aOutFile)
 {
+#ifndef MOZ_WIDGET_GONK
   if (NS_WARN_IF(!mStorageBaseDir)) {
     return NS_ERROR_FAILURE;
   }
   return mStorageBaseDir->Clone(aOutFile);
+#else
+  return NS_ERROR_NOT_IMPLEMENTED;
+#endif
 }
 
 static nsresult
 WriteToFile(nsIFile* aPath,
             const nsCString& aFileName,
             const nsCString& aData)
 {
   nsCOMPtr<nsIFile> path;
@@ -1056,16 +1059,21 @@ GeckoMediaPluginService::GetNodeId(const
                                    nsACString& aOutId)
 {
   MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
   LOGD(("%s::%s: (%s, %s), %s", __CLASS__, __FUNCTION__,
        NS_ConvertUTF16toUTF8(aOrigin).get(),
        NS_ConvertUTF16toUTF8(aTopLevelOrigin).get(),
        (aInPrivateBrowsing ? "PrivateBrowsing" : "NonPrivateBrowsing")));
 
+#ifdef MOZ_WIDGET_GONK
+  NS_WARNING("GeckoMediaPluginService::GetNodeId Not implemented on B2G");
+  return NS_ERROR_NOT_IMPLEMENTED;
+#endif
+
   nsresult rv;
 
   if (aOrigin.EqualsLiteral("null") ||
       aOrigin.IsEmpty() ||
       aTopLevelOrigin.EqualsLiteral("null") ||
       aTopLevelOrigin.IsEmpty()) {
     // At least one of the (origin, topLevelOrigin) is null or empty;
     // probably a local file. Generate a random node id, and don't store
@@ -1496,16 +1504,21 @@ static bool IsNodeIdValid(GMPParent* aPa
 }
 
 void
 GeckoMediaPluginService::ClearStorage()
 {
   MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
   LOGD(("%s::%s", __CLASS__, __FUNCTION__));
 
+#ifdef MOZ_WIDGET_GONK
+  NS_WARNING("GeckoMediaPluginService::ClearStorage not implemented on B2G");
+  return;
+#endif
+
   // Kill plugins with valid nodeIDs.
   KillPlugins(mPlugins, mMutex, &IsNodeIdValid);
 
   nsCOMPtr<nsIFile> path; // $profileDir/gmp/
   nsresult rv = GetStorageDir(getter_AddRefs(path));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
--- a/dom/media/gmp/GMPService.h
+++ b/dom/media/gmp/GMPService.h
@@ -134,17 +134,19 @@ private:
   private:
     T mValue;
   };
 
   MainThreadOnly<bool> mWaitingForPluginsAsyncShutdown;
 
   nsTArray<nsRefPtr<GMPParent>> mAsyncShutdownPlugins; // GMP Thread only.
 
+#ifndef MOZ_WIDGET_GONK
   nsCOMPtr<nsIFile> mStorageBaseDir;
+#endif
 
   // Hashes of (origin,topLevelOrigin) to the node id for
   // non-persistent sessions.
   nsClassHashtable<nsUint32HashKey, nsCString> mTempNodeIds;
 
   // Hashes node id to whether that node id is allowed to store data
   // persistently on disk.
   nsDataHashtable<nsCStringHashKey, bool> mPersistentStorageAllowed;