Bug 1449736: Properly detect failure in receiving plugin NPObjects (r=jmathies)

We need to recognize IPDL errors in order to return the proper error status when the right PluginScriptableObject could not be found.

Differential Revision: https://phabricator.services.mozilla.com/D15469

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Parks 2019-01-09 16:36:59 +00:00
Родитель 17b5ec3dd2
Коммит 4ff2f5dfa4
1 изменённых файлов: 5 добавлений и 5 удалений

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

@ -268,14 +268,14 @@ int PluginInstanceChild::GetQuirks() {
NPError PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,
NPObject** aObject) {
PluginScriptableObjectChild* actor = nullptr;
NPError result = NPERR_NO_ERROR;
NPError result = NPERR_GENERIC_ERROR;
switch (aValue) {
case NPNVWindowNPObject:
if (!(actor = mCachedWindowActor)) {
PPluginScriptableObjectChild* actorProtocol;
CallNPN_GetValue_NPNVWindowNPObject(&actorProtocol, &result);
if (result == NPERR_NO_ERROR) {
if (CallNPN_GetValue_NPNVWindowNPObject(&actorProtocol, &result) &&
(result == NPERR_NO_ERROR)) {
actor = mCachedWindowActor =
static_cast<PluginScriptableObjectChild*>(actorProtocol);
NS_ASSERTION(actor, "Null actor!");
@ -288,8 +288,8 @@ NPError PluginInstanceChild::InternalGetNPObjectForValue(NPNVariable aValue,
case NPNVPluginElementNPObject:
if (!(actor = mCachedElementActor)) {
PPluginScriptableObjectChild* actorProtocol;
CallNPN_GetValue_NPNVPluginElementNPObject(&actorProtocol, &result);
if (result == NPERR_NO_ERROR) {
if (CallNPN_GetValue_NPNVPluginElementNPObject(&actorProtocol, &result) &&
(result == NPERR_NO_ERROR)) {
actor = mCachedElementActor =
static_cast<PluginScriptableObjectChild*>(actorProtocol);
NS_ASSERTION(actor, "Null actor!");