Bug 1352572 - Return NPERR_GENERIC_ERROR if plugin calls NPN_PostURLNotify(file=true); r?bsmedberg draft
authorLie Ryan <lie.1296@gmail.com>
Sat, 06 May 2017 07:27:08 +0000
changeset 573676 93258555bc2230c9f60ad0f5448a074d2c4a2a81
parent 569540 ebea78e67e1662f8c5b768abe95bee8b0777ef1e
child 573677 a7190fed4d62c22c524acc7ad7823c227da7b313
push id57461
push userbmo:lie.1296@gmail.com
push dateSat, 06 May 2017 07:31:03 +0000
reviewersbsmedberg
bugs1352572
milestone55.0a1
Bug 1352572 - Return NPERR_GENERIC_ERROR if plugin calls NPN_PostURLNotify(file=true); r?bsmedberg NPN_PostURLNotify(file=true) is no longer supported in NPAPI. MozReview-Commit-ID: 12JlYduC7R8
dom/plugins/ipc/PluginModuleChild.cpp
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -1171,16 +1171,21 @@ NPError
                void* aNotifyData)
 {
     PLUGIN_LOG_DEBUG_FUNCTION;
     ENSURE_PLUGIN_THREAD(NPERR_INVALID_PARAM);
 
     if (!aBuffer)
         return NPERR_INVALID_PARAM;
 
+    if (aIsFile) {
+      PLUGIN_LOG_DEBUG(("NPN_PostURLNotify with file=true is no longer supported"));
+      return NPERR_GENERIC_ERROR;
+    }
+
     nsCString url = NullableString(aRelativeURL);
     auto* sn = new StreamNotifyChild(url);
 
     NPError err;
     InstCast(aNPP)->CallPStreamNotifyConstructor(
         sn, url, NullableString(aTarget), true,
         nsCString(aBuffer, aLength), aIsFile, &err);