Backed out changeset 61b5398161f3 (bug 1129040)

This commit is contained in:
Carsten "Tomcat" Book 2015-04-29 16:51:40 +02:00
parent d9445a2044
commit 86f8743c94
6 changed files with 19 additions and 59 deletions

View File

@ -160,9 +160,6 @@
#include "private/pprio.h"
#include "ContentProcessManager.h"
#include "mozilla/psm/PSMContentListener.h"
#include "nsPluginHost.h"
#include "nsPluginTags.h"
#include "nsIBlocklistService.h"
#include "nsIBidiKeyboard.h"
@ -1085,25 +1082,6 @@ ContentParent::RecvConnectPluginBridge(const uint32_t& aPluginId, nsresult* aRv)
return mozilla::plugins::SetupBridge(aPluginId, this, true, aRv, &dummy);
}
bool
ContentParent::RecvGetBlocklistState(const uint32_t& aPluginId,
uint32_t* aState)
{
*aState = nsIBlocklistService::STATE_BLOCKED;
nsRefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
if (!pluginHost) {
return false;
}
nsPluginTag* tag = pluginHost->PluginWithId(aPluginId);
if (!tag) {
return false;
}
return NS_SUCCEEDED(tag->GetBlocklistState(aState));
}
bool
ContentParent::RecvFindPlugins(const uint32_t& aPluginEpoch,
nsTArray<PluginTag>* aPlugins,

View File

@ -173,7 +173,6 @@ public:
virtual bool RecvLoadPlugin(const uint32_t& aPluginId, nsresult* aRv, uint32_t* aRunID) override;
virtual bool RecvConnectPluginBridge(const uint32_t& aPluginId, nsresult* aRv) override;
virtual bool RecvGetBlocklistState(const uint32_t& aPluginId, uint32_t* aIsBlocklisted) override;
virtual bool RecvFindPlugins(const uint32_t& aPluginEpoch,
nsTArray<PluginTag>* aPlugins,
uint32_t* aNewPluginEpoch) override;

View File

@ -699,11 +699,6 @@ parent:
*/
sync ConnectPluginBridge(uint32_t aPluginId) returns (nsresult rv);
/**
* Return the current blocklist state for a particular plugin.
*/
sync GetBlocklistState(uint32_t aPluginId) returns (uint32_t aState);
/**
* This call returns the set of plugins loaded in the chrome
* process. However, in many cases this set will not have changed since the

View File

@ -110,8 +110,6 @@
#include "nsExceptionHandler.h"
#endif
#include "npapi.h"
using namespace mozilla;
using mozilla::TimeStamp;
using mozilla::plugins::PluginTag;
@ -1056,6 +1054,7 @@ nsPluginHost::GetBlocklistStateForType(const nsACString &aMimeType,
aExcludeFlags,
getter_AddRefs(tag));
NS_ENSURE_SUCCESS(rv, rv);
return tag->GetBlocklistState(aState);
}

View File

@ -11,6 +11,7 @@
#include "nsCOMPtr.h"
#include "prlink.h"
#include "prclist.h"
#include "npapi.h"
#include "nsIPluginTag.h"
#include "nsPluginsDir.h"
#include "nsPluginDirServiceProvider.h"
@ -29,7 +30,6 @@
#include "nsCRT.h"
#ifdef XP_WIN
#include <minwindef.h>
#include "nsIWindowsRegKey.h"
#endif
@ -52,10 +52,6 @@ class nsNPAPIPluginStreamListener;
class nsIPluginInstanceOwner;
class nsIInputStream;
class nsIStreamListener;
#ifndef npapi_h_
struct _NPP;
typedef _NPP* NPP;
#endif
class nsInvalidPluginTag : public nsISupports
{

View File

@ -20,7 +20,6 @@
#include "mozilla/unused.h"
#include <cctype>
#include "mozilla/dom/EncodingUtils.h"
#include "mozilla/dom/ContentChild.h"
using mozilla::dom::EncodingUtils;
using namespace mozilla;
@ -646,33 +645,27 @@ nsPluginTag::GetBlocklistState(uint32_t *aResult)
return NS_OK;
}
if (XRE_GetProcessType() != GeckoProcessType_Default) {
*aResult = nsIBlocklistService::STATE_BLOCKED;
dom::ContentChild* cp = dom::ContentChild::GetSingleton();
if (!cp->SendGetBlocklistState(mId, aResult)) {
return NS_OK;
}
} else {
nsCOMPtr<nsIBlocklistService> blocklist =
do_GetService("@mozilla.org/extensions/blocklist;1");
nsCOMPtr<nsIBlocklistService> blocklist =
do_GetService("@mozilla.org/extensions/blocklist;1");
if (!blocklist) {
*aResult = nsIBlocklistService::STATE_NOT_BLOCKED;
return NS_OK;
}
// The EmptyString()s are so we use the currently running application
// and toolkit versions
if (NS_FAILED(blocklist->GetPluginBlocklistState(this, EmptyString(),
EmptyString(), aResult))) {
*aResult = nsIBlocklistService::STATE_NOT_BLOCKED;
return NS_OK;
}
if (!blocklist) {
*aResult = nsIBlocklistService::STATE_NOT_BLOCKED;
return NS_OK;
}
MOZ_ASSERT(*aResult <= UINT16_MAX);
mCachedBlocklistState = (uint16_t) *aResult;
// The EmptyString()s are so we use the currently running application
// and toolkit versions
uint32_t state;
if (NS_FAILED(blocklist->GetPluginBlocklistState(this, EmptyString(),
EmptyString(), &state))) {
*aResult = nsIBlocklistService::STATE_NOT_BLOCKED;
return NS_OK;
}
MOZ_ASSERT(state <= UINT16_MAX);
mCachedBlocklistState = (uint16_t) state;
mCachedBlocklistStateValid = true;
*aResult = state;
return NS_OK;
}