Bug 1352572 - Return an NPERR_GENERIC_ERROR if plugin tries to call NPN_PostURL(file=true); r?bsmedberg
NPN_PostURL(file=true) is no longer supported in NPAPI.
MozReview-Commit-ID: IyLJSj4bKRR
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -1199,16 +1199,20 @@ NPError
const char* aTarget,
uint32_t aLength,
const char* aBuffer,
NPBool aIsFile)
{
PLUGIN_LOG_DEBUG_FUNCTION;
ENSURE_PLUGIN_THREAD(NPERR_INVALID_PARAM);
+ if (aIsFile) {
+ PLUGIN_LOG_DEBUG(("NPN_PostURL with file=true is no longer supported"));
+ return NPERR_GENERIC_ERROR;
+ }
NPError err;
// FIXME what should happen when |aBuffer| is null?
InstCast(aNPP)->CallNPN_PostURL(NullableString(aRelativeURL),
NullableString(aTarget),
nsDependentCString(aBuffer, aLength),
aIsFile, &err);
return err;
}
--- a/dom/plugins/test/mochitest/test_streamNotify.html
+++ b/dom/plugins/test/mochitest/test_streamNotify.html
@@ -78,12 +78,14 @@
is(t, "World", "GET data: URI correct");
testDone();
}, null, true), "streamTest GET data: URI");
ok(!p.streamTest("data:malformed?", false, null, null,
function(r, t) {
todo(false, "Shouldn't get callback for invalid data: URI");
}, null, true), "streamTest GET bad data: URI");
+
+ ok(!p.postFileToURLTest("post.sjs"), "postFileToURLTest POST a file");
}
</script>
<embed id="plugin1" type="application/x-test" width="400" height="400"></embed>