Bug 1352575 (part 12) - Remove NP_InitializeResult. r=jimm.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 18 Apr 2017 16:56:44 +1000
changeset 367575 e609e1af56731ae68923da4380a4d2764ee381c0
parent 367574 61f16a79c955a087757a42d0d8cb137538150f41
child 367576 df2eb29996da332947433b083da2b2793de5c6a5
push id32137
push usercbook@mozilla.com
push dateThu, 06 Jul 2017 09:18:21 +0000
treeherdermozilla-central@018b3829d0a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1352575
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1352575 (part 12) - Remove NP_InitializeResult. r=jimm.
dom/plugins/ipc/PPluginModule.ipdl
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginModuleParent.h
--- a/dom/plugins/ipc/PPluginModule.ipdl
+++ b/dom/plugins/ipc/PPluginModule.ipdl
@@ -94,18 +94,16 @@ child:
 
   async SettingChanged(PluginSettings settings);
 
   async NPP_SetValue_NPNVaudioDeviceChangeDetails(NPAudioDeviceChangeDetailsIPC changeDetails);
 
   async InitPluginModuleChild(Endpoint<PPluginModuleChild> endpoint);
 
 parent:
-  async NP_InitializeResult(NPError aError);
-
   /**
    * This message is only used on X11 platforms.
    *
    * Send a dup of the plugin process's X socket to the parent
    * process.  In theory, this scheme keeps the plugin's X resources
    * around until after both the plugin process shuts down *and* the
    * parent process closes the dup fd.  This is used to prevent the
    * parent process from crashing on X errors if, e.g., the plugin
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -2263,39 +2263,25 @@ PluginModuleChromeParent::NP_Initialize(
     }
     else if (*error != NPERR_NO_ERROR) {
         Close();
         return NS_ERROR_FAILURE;
     }
     TimeStamp callNpInitEnd = TimeStamp::Now();
     mTimeBlocked += (callNpInitEnd - callNpInitStart);
 
-    RecvNP_InitializeResult(*error);
-
-    return NS_OK;
-}
-
-mozilla::ipc::IPCResult
-PluginModuleParent::RecvNP_InitializeResult(const NPError& aError)
-{
-    if (aError != NPERR_NO_ERROR) {
+    if (*error != NPERR_NO_ERROR) {
         OnInitFailure();
-        return IPC_OK();
+        return NS_OK;
     }
 
     SetPluginFuncs(mNPPIface);
 
     mNPInitialized = true;
-    return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-PluginModuleChromeParent::RecvNP_InitializeResult(const NPError& aError)
-{
-    return PluginModuleParent::RecvNP_InitializeResult(aError);
+    return NS_OK;
 }
 
 #else
 
 nsresult
 PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error)
 {
     PLUGIN_LOG_DEBUG_METHOD;
@@ -2349,37 +2335,19 @@ PluginModuleChromeParent::NP_Initialize(
 
     TimeStamp callNpInitStart = TimeStamp::Now();
     if (!CallNP_Initialize(settings, error)) {
         Close();
         return NS_ERROR_FAILURE;
     }
     TimeStamp callNpInitEnd = TimeStamp::Now();
     mTimeBlocked += (callNpInitEnd - callNpInitStart);
-    RecvNP_InitializeResult(*error);
-    return NS_OK;
-}
-
-mozilla::ipc::IPCResult
-PluginModuleParent::RecvNP_InitializeResult(const NPError& aError)
-{
-    if (aError != NPERR_NO_ERROR) {
-        OnInitFailure();
-        return IPC_OK();
-    }
-
-    mNPInitialized = true;
-    return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-PluginModuleChromeParent::RecvNP_InitializeResult(const NPError& aError)
-{
+
     bool ok = true;
-    if (aError == NPERR_NO_ERROR) {
+    if (*error == NPERR_NO_ERROR) {
         // Initialization steps for (e10s && !asyncInit) || !e10s
 #if defined XP_WIN
         // Send the info needed to join the browser process's audio session to
         // the plugin process.
         nsID id;
         nsString sessionName;
         nsString iconPath;
 
@@ -2390,19 +2358,26 @@ PluginModuleChromeParent::RecvNP_Initial
 #endif
 
 #ifdef MOZ_CRASHREPORTER_INJECTOR
         InitializeInjector();
 #endif
     }
 
     if (!ok) {
-        return IPC_FAIL_NO_REASON(this);
+        return NS_ERROR_FAILURE;
     }
-    return PluginModuleParent::RecvNP_InitializeResult(aError);
+
+    if (*error != NPERR_NO_ERROR) {
+        OnInitFailure();
+        return NS_OK;
+    }
+
+    mNPInitialized = true;
+    return NS_OK;
 }
 
 #endif
 
 bool
 PluginModuleParent::RemovePendingSurrogate(
                             const RefPtr<PluginAsyncSurrogate>& aSurrogate)
 {
--- a/dom/plugins/ipc/PluginModuleParent.h
+++ b/dom/plugins/ipc/PluginModuleParent.h
@@ -173,19 +173,16 @@ protected:
     RecvPopCursor() override;
 
     virtual mozilla::ipc::IPCResult
     RecvNPN_SetException(const nsCString& aMessage) override;
 
     virtual mozilla::ipc::IPCResult
     RecvNPN_ReloadPlugins(const bool& aReloadPages) override;
 
-    virtual mozilla::ipc::IPCResult
-    RecvNP_InitializeResult(const NPError& aError) override;
-
     static BrowserStreamParent* StreamCast(NPP instance, NPStream* s,
                                            PluginAsyncSurrogate** aSurrogate = nullptr);
 
     virtual mozilla::ipc::IPCResult
     AnswerNPN_SetValue_NPPVpluginRequiresAudioDeviceChanges(
                                         const bool& shouldRegister,
                                         NPError* result) override;
 
@@ -511,19 +508,16 @@ class PluginModuleChromeParent
     OnHangUIContinue();
 
     void
     EvaluateHangUIState(const bool aReset);
 #endif // XP_WIN
 
     virtual bool WaitForIPCConnection() override;
 
-    virtual mozilla::ipc::IPCResult
-    RecvNP_InitializeResult(const NPError& aError) override;
-
     void CachedSettingChanged();
 
     virtual mozilla::ipc::IPCResult
     AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
 
     // Proxy GetOpenFileName/GetSaveFileName on Windows.
     virtual mozilla::ipc::IPCResult
     AnswerGetFileName(const GetFileNameFunc& aFunc,