Kaydet (Commit) 9081e07c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Enable NPP_Initialize/Shutdown again

...calling which had erroneously been dropped in
bdead69d "Add switch for system/internal
npapi.h."  This makes the npsoplugin browser plugin work again.

(Also, init write_fd to -1 instead of 0, so that a missing do_init_pipe does not
accidentally cause writing to write_fd succeed in writing to stdin.)

Change-Id: Iced734512a43c8dfea46088f7ac16f159e7dd807
üst ce629d95
...@@ -32,6 +32,7 @@ $(eval $(call gb_Library_Library,npsoplugin)) ...@@ -32,6 +32,7 @@ $(eval $(call gb_Library_Library,npsoplugin))
$(eval $(call gb_Library_use_packages,npsoplugin,\ $(eval $(call gb_Library_use_packages,npsoplugin,\
comphelper_inc \ comphelper_inc \
np_sdk_inc \
)) ))
$(eval $(call gb_Library_use_external,npsoplugin,mozilla_headers)) $(eval $(call gb_Library_use_external,npsoplugin,mozilla_headers))
...@@ -94,8 +95,6 @@ $(eval $(call gb_Library_add_defs,npsoplugin,\ ...@@ -94,8 +95,6 @@ $(eval $(call gb_Library_add_defs,npsoplugin,\
ifeq ($(COM),MSC) ifeq ($(COM),MSC)
$(eval $(call gb_Library_add_ldflags,npsoplugin,\ $(eval $(call gb_Library_add_ldflags,npsoplugin,\
/EXPORT:NPP_GetMIMEDescription \ /EXPORT:NPP_GetMIMEDescription \
/EXPORT:NPP_Initialize \
/EXPORT:NPP_Shutdown \
/EXPORT:NPP_New \ /EXPORT:NPP_New \
/EXPORT:NPP_Destroy \ /EXPORT:NPP_Destroy \
/EXPORT:NPP_SetWindow \ /EXPORT:NPP_SetWindow \
......
...@@ -83,6 +83,8 @@ ...@@ -83,6 +83,8 @@
#include "nsp_func.hxx" #include "nsp_func.hxx"
#include "npsdk/plugin.h"
#include <comphelper/documentconstants.hxx> #include <comphelper/documentconstants.hxx>
#ifdef _MSC_VER #ifdef _MSC_VER
...@@ -98,7 +100,7 @@ ...@@ -98,7 +100,7 @@
***********************************************************************/ ***********************************************************************/
static NSP_Mute_Obj send_lock = NSP_New_Mute_Obj(); static NSP_Mute_Obj send_lock = NSP_New_Mute_Obj();
static NSP_PIPE_FD write_fd = 0; static NSP_PIPE_FD write_fd = -1;
long int NSP_WriteToPipe(NSP_PIPE_FD fp, void* buf, unsigned long int len) long int NSP_WriteToPipe(NSP_PIPE_FD fp, void* buf, unsigned long int len)
...@@ -417,7 +419,7 @@ dupMimeType(NPMIMEType type) ...@@ -417,7 +419,7 @@ dupMimeType(NPMIMEType type)
} }
#endif // end of UNIX #endif // end of UNIX
NP_DLLPUBLIC NPError NPError
NPP_Initialize(void) NPP_Initialize(void)
{ {
debug_fprintf(NSP_LOG_NEW, "NS Plugin begin initialize.\n"); debug_fprintf(NSP_LOG_NEW, "NS Plugin begin initialize.\n");
...@@ -432,7 +434,7 @@ NPP_GetJavaClass() ...@@ -432,7 +434,7 @@ NPP_GetJavaClass()
} }
#endif #endif
NP_DLLPUBLIC void void
NPP_Shutdown(void) NPP_Shutdown(void)
{ {
PLUGIN_MSG msg; PLUGIN_MSG msg;
......
...@@ -31,5 +31,6 @@ $(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jri.h,mozsrc/jri.h)) ...@@ -31,5 +31,6 @@ $(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jri.h,mozsrc/jri.h))
$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jri_md.h,mozsrc/jri_md.h)) $(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jri_md.h,mozsrc/jri_md.h))
$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jritypes.h,mozsrc/jritypes.h)) $(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/jritypes.h,mozsrc/jritypes.h))
$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/npupp.h,mozsrc/npupp.h)) $(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/npupp.h,mozsrc/npupp.h))
$(eval $(call gb_Package_add_file,np_sdk_inc,inc/npsdk/plugin.h,mozsrc/plugin.h))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
#include <stdio.h> #include <stdio.h>
#include "npapi.h" #include "npapi.h"
#include "npupp.h" #include "npupp.h"
#include "plugin.h"
/* /*
* Define PLUGIN_TRACE to have the wrapper functions print * Define PLUGIN_TRACE to have the wrapper functions print
...@@ -485,7 +486,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs) ...@@ -485,7 +486,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
pluginFuncs->javaClass = Private_GetJavaClass(); pluginFuncs->javaClass = Private_GetJavaClass();
#endif #endif
err = NPERR_NO_ERROR; err = NPP_Initialize();
} }
return err; return err;
...@@ -502,4 +503,5 @@ SAL_DLLPUBLIC_EXPORT void ...@@ -502,4 +503,5 @@ SAL_DLLPUBLIC_EXPORT void
NP_Shutdown(void) NP_Shutdown(void)
{ {
PLUGINDEBUGSTR("NP_Shutdown"); PLUGINDEBUGSTR("NP_Shutdown");
NPP_Shutdown();
} }
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "npapi.h" #include "npapi.h"
#include "npupp.h" #include "npupp.h"
#include "plugin.h"
//\\// DEFINE //\\// DEFINE
#define NP_EXPORT #define NP_EXPORT
...@@ -149,7 +150,7 @@ NP_Initialize(NPNetscapeFuncs* pFuncs) ...@@ -149,7 +150,7 @@ NP_Initialize(NPNetscapeFuncs* pFuncs)
} }
#endif #endif
return NPERR_NO_ERROR; return NPP_Initialize;
} }
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\. //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
...@@ -163,6 +164,7 @@ NP_Initialize(NPNetscapeFuncs* pFuncs) ...@@ -163,6 +164,7 @@ NP_Initialize(NPNetscapeFuncs* pFuncs)
void WINAPI NP_EXPORT void WINAPI NP_EXPORT
NP_Shutdown() NP_Shutdown()
{ {
NPP_Shutdown();
g_pNavigatorFuncs = NULL; g_pNavigatorFuncs = NULL;
} }
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_NP_SDK_MOZSRC_PLUGIN_H
#define INCLUDED_NP_SDK_MOZSRC_PLUGIN_H
#include "npapi.h"
/* OpenOffice.org/LibreOffice modified the implementations of NP_Initialize and
NP_Shutdown in np_sdk/mozsrc/ to call NPP_Initialize and NPP_Shutdown, resp.,
defined in extensions/source/nsplugin/source/npshell.cxx:
*/
#if defined __cplusplus
extern "C" {
#endif
NPError NPP_Initialize(void);
void NPP_Shutdown(void);
#if defined __cplusplus
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment