Bug 1338172 part B - remove the ancient carbon detection on Mac which is no longer used, r=jimm

MozReview-Commit-ID: 9UEAfPHg7fP

--HG--
extra : rebase_source : 1b9de20f37866984cd4af39b398506963ed74a3c
extra : source : e4994ab9d628dd639c95c64359fb420ca0253911
This commit is contained in:
Benjamin Smedberg 2017-02-08 14:27:49 -05:00
Родитель e16a82150d
Коммит 97745f1b66
6 изменённых файлов: 19 добавлений и 88 удалений

Просмотреть файл

@ -1578,49 +1578,6 @@ nsNPAPIPluginInstance::SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *c
}
}
class CarbonEventModelFailureEvent : public Runnable {
public:
nsCOMPtr<nsIContent> mContent;
explicit CarbonEventModelFailureEvent(nsIContent* aContent)
: mContent(aContent)
{}
~CarbonEventModelFailureEvent() {}
NS_IMETHOD Run();
};
NS_IMETHODIMP
CarbonEventModelFailureEvent::Run()
{
nsString type = NS_LITERAL_STRING("npapi-carbon-event-model-failure");
nsContentUtils::DispatchTrustedEvent(mContent->GetComposedDoc(), mContent,
type, true, true);
return NS_OK;
}
void
nsNPAPIPluginInstance::CarbonNPAPIFailure()
{
nsCOMPtr<nsIDOMElement> element;
GetDOMElement(getter_AddRefs(element));
if (!element) {
return;
}
nsCOMPtr<nsIContent> content(do_QueryInterface(element));
if (!content) {
return;
}
nsCOMPtr<nsIRunnable> e = new CarbonEventModelFailureEvent(content);
nsresult rv = NS_DispatchToCurrentThread(e);
if (NS_FAILED(rv)) {
NS_WARNING("Failed to dispatch CarbonEventModelFailureEvent.");
}
}
static bool
GetJavaVersionFromMimetype(nsPluginTag* pluginTag, nsCString& version)
{

Просмотреть файл

@ -302,10 +302,6 @@ public:
NPError FinalizeAsyncSurface(NPAsyncSurface *surface);
void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed);
// Called when the instance fails to instantiate beceause the Carbon
// event model is not supported.
void CarbonNPAPIFailure();
// Returns the contents scale factor of the screen the plugin is drawn on.
double GetContentsScaleFactor();

Просмотреть файл

@ -262,11 +262,6 @@ parent:
async RedrawPlugin();
// Send notification that a plugin tried to negotiate Carbon NPAPI so that
// users can be notified that restarting the browser in i386 mode may allow
// them to use the plugin.
sync NegotiatedCarbon();
// Notifies the parent of its NPP_New result code.
async AsyncNPP_NewResult(NPError aResult);

Просмотреть файл

@ -262,25 +262,9 @@ PluginInstanceChild::DoNPP_New()
return rv;
}
Initialize();
#if defined(XP_MACOSX) && defined(__i386__)
// If an i386 Mac OS X plugin has selected the Carbon event model then
// we have to fail. We do not support putting Carbon event model plugins
// out of process. Note that Carbon is the default model so out of process
// plugins need to actively negotiate something else in order to work
// out of process.
if (EventModel() == NPEventModelCarbon) {
// Send notification that a plugin tried to negotiate Carbon NPAPI so that
// users can be notified that restarting the browser in i386 mode may allow
// them to use the plugin.
SendNegotiatedCarbon();
// Fail to instantiate.
rv = NPERR_MODULE_LOAD_FAILED_ERROR;
if (!Initialize()) {
rv = NPERR_MODULE_LOAD_FAILED_ERROR;
}
#endif
return rv;
}
@ -387,12 +371,14 @@ PluginInstanceChild::NPN_GetValue(NPNVariable aVar,
case NPNVxDisplay:
if (!mWsInfo.display) {
// We are called before Initialize() so we have to call it now.
Initialize();
if (!Initialize()) {
return NPERR_GENERIC_ERROR;
}
NS_ASSERTION(mWsInfo.display, "We should have a valid display!");
}
*(void **)aValue = mWsInfo.display;
return NPERR_NO_ERROR;
#elif defined(OS_WIN)
case NPNVToolkit:
return NPERR_GENERIC_ERROR;
@ -1428,7 +1414,7 @@ PluginInstanceChild::Initialize()
if (mWsInfo.display) {
// Already initialized
return false;
return true;
}
// Request for windowless plugins is set in newp(), before this call.
@ -1448,7 +1434,18 @@ PluginInstanceChild::Initialize()
else {
mWsInfo.display = xt_client_get_display();
}
#endif
#endif
#if defined(XP_MACOSX) && defined(__i386__)
// If an i386 Mac OS X plugin has selected the Carbon event model then
// we have to fail. We do not support putting Carbon event model plugins
// out of process. Note that Carbon is the default model so out of process
// plugins need to actively negotiate something else in order to work
// out of process.
if (EventModel() == NPEventModelCarbon) {
return false;
}
#endif
return true;
}

Просмотреть файл

@ -2086,17 +2086,6 @@ PluginInstanceParent::RecvRedrawPlugin()
return IPC_OK();
}
mozilla::ipc::IPCResult
PluginInstanceParent::RecvNegotiatedCarbon()
{
nsNPAPIPluginInstance *inst = static_cast<nsNPAPIPluginInstance*>(mNPP->ndata);
if (!inst) {
return IPC_FAIL_NO_REASON(this);
}
inst->CarbonNPAPIFailure();
return IPC_OK();
}
nsPluginInstanceOwner*
PluginInstanceParent::GetOwner()
{

Просмотреть файл

@ -251,9 +251,6 @@ public:
virtual mozilla::ipc::IPCResult
RecvRedrawPlugin() override;
virtual mozilla::ipc::IPCResult
RecvNegotiatedCarbon() override;
virtual mozilla::ipc::IPCResult
RecvAsyncNPP_NewResult(const NPError& aResult) override;