зеркало из 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 : 41845cf5e25aa7b4a94e29a327b4d3cd4a1eb9bd extra : histedit_source : 4009dbade841826e32a0d6b5e9f23ef479122900
This commit is contained in:
Родитель
40c656c1ef
Коммит
6e0e846224
|
@ -1589,49 +1589,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)
|
||||
{
|
||||
|
|
|
@ -301,10 +301,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);
|
||||
|
||||
|
|
|
@ -264,25 +264,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;
|
||||
}
|
||||
|
||||
|
@ -389,12 +373,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;
|
||||
|
@ -1430,7 +1416,7 @@ PluginInstanceChild::Initialize()
|
|||
|
||||
if (mWsInfo.display) {
|
||||
// Already initialized
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Request for windowless plugins is set in newp(), before this call.
|
||||
|
@ -1450,7 +1436,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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче