зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
e16a82150d
Коммит
97745f1b66
|
@ -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
|
static bool
|
||||||
GetJavaVersionFromMimetype(nsPluginTag* pluginTag, nsCString& version)
|
GetJavaVersionFromMimetype(nsPluginTag* pluginTag, nsCString& version)
|
||||||
{
|
{
|
||||||
|
|
|
@ -302,10 +302,6 @@ public:
|
||||||
NPError FinalizeAsyncSurface(NPAsyncSurface *surface);
|
NPError FinalizeAsyncSurface(NPAsyncSurface *surface);
|
||||||
void SetCurrentAsyncSurface(NPAsyncSurface *surface, NPRect *changed);
|
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.
|
// Returns the contents scale factor of the screen the plugin is drawn on.
|
||||||
double GetContentsScaleFactor();
|
double GetContentsScaleFactor();
|
||||||
|
|
||||||
|
|
|
@ -262,11 +262,6 @@ parent:
|
||||||
|
|
||||||
async RedrawPlugin();
|
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.
|
// Notifies the parent of its NPP_New result code.
|
||||||
async AsyncNPP_NewResult(NPError aResult);
|
async AsyncNPP_NewResult(NPError aResult);
|
||||||
|
|
||||||
|
|
|
@ -262,25 +262,9 @@ PluginInstanceChild::DoNPP_New()
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
Initialize();
|
if (!Initialize()) {
|
||||||
|
rv = NPERR_MODULE_LOAD_FAILED_ERROR;
|
||||||
#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;
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,12 +371,14 @@ PluginInstanceChild::NPN_GetValue(NPNVariable aVar,
|
||||||
case NPNVxDisplay:
|
case NPNVxDisplay:
|
||||||
if (!mWsInfo.display) {
|
if (!mWsInfo.display) {
|
||||||
// We are called before Initialize() so we have to call it now.
|
// 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!");
|
NS_ASSERTION(mWsInfo.display, "We should have a valid display!");
|
||||||
}
|
}
|
||||||
*(void **)aValue = mWsInfo.display;
|
*(void **)aValue = mWsInfo.display;
|
||||||
return NPERR_NO_ERROR;
|
return NPERR_NO_ERROR;
|
||||||
|
|
||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
case NPNVToolkit:
|
case NPNVToolkit:
|
||||||
return NPERR_GENERIC_ERROR;
|
return NPERR_GENERIC_ERROR;
|
||||||
|
@ -1428,7 +1414,7 @@ PluginInstanceChild::Initialize()
|
||||||
|
|
||||||
if (mWsInfo.display) {
|
if (mWsInfo.display) {
|
||||||
// Already initialized
|
// Already initialized
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request for windowless plugins is set in newp(), before this call.
|
// Request for windowless plugins is set in newp(), before this call.
|
||||||
|
@ -1448,7 +1434,18 @@ PluginInstanceChild::Initialize()
|
||||||
else {
|
else {
|
||||||
mWsInfo.display = xt_client_get_display();
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2086,17 +2086,6 @@ PluginInstanceParent::RecvRedrawPlugin()
|
||||||
return IPC_OK();
|
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*
|
nsPluginInstanceOwner*
|
||||||
PluginInstanceParent::GetOwner()
|
PluginInstanceParent::GetOwner()
|
||||||
{
|
{
|
||||||
|
|
|
@ -251,9 +251,6 @@ public:
|
||||||
virtual mozilla::ipc::IPCResult
|
virtual mozilla::ipc::IPCResult
|
||||||
RecvRedrawPlugin() override;
|
RecvRedrawPlugin() override;
|
||||||
|
|
||||||
virtual mozilla::ipc::IPCResult
|
|
||||||
RecvNegotiatedCarbon() override;
|
|
||||||
|
|
||||||
virtual mozilla::ipc::IPCResult
|
virtual mozilla::ipc::IPCResult
|
||||||
RecvAsyncNPP_NewResult(const NPError& aResult) override;
|
RecvAsyncNPP_NewResult(const NPError& aResult) override;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче