RepositoryExternal.mk | 14 - config_host.mk.in | 4 configure.ac | 38 ++--- extensions/Executable_pluginapp.bin.mk | 2 extensions/Library_npsoplugin.mk | 2 extensions/Library_pl.mk | 2 extensions/StaticLibrary_plugcon.mk | 2 extensions/source/plugin/inc/plugin/unx/mediator.hxx | 20 -- extensions/source/plugin/unx/mediator.cxx | 49 ++++-- extensions/source/plugin/unx/npnapi.cxx | 139 ++++++++++++------- extensions/source/plugin/unx/nppapi.cxx | 17 +- extensions/source/plugin/unx/npwrap.cxx | 53 +++---- extensions/source/plugin/unx/plugcon.cxx | 4 np_sdk/Module_np_sdk.mk | 4 np_sdk/Package_mozilla_inc.mk | 35 ---- np_sdk/Package_npapi.mk | 35 ++++ np_sdk/StaticLibrary_nputils.mk | 2 sal/inc/sal/log-areas.dox | 1 18 files changed, 237 insertions(+), 186 deletions(-)
New commits: commit 13ef9dcc206d30ebd4d63afb186d379dc849b36c Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Nov 15 18:09:55 2012 +0100 Rename "Mozilla headers" to "NPAPI headers" (incl. configure option name) ...to avoid confusion what that is actually about. (Especially, it is completely unrelated to --enable-mozilla.) ATTENTION: This renames the configure option --with-system-mozilla-headers to --with-system-npapi-headers. Change-Id: I48f3c79d69c4d4f445a94e7ddbeab06ea667becc diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index d4281c9..20c9ca6 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -51,20 +51,20 @@ endef endif -ifeq ($(SYSTEM_MOZILLA_HEADERS),YES) +ifeq ($(SYSTEM_NPAPI_HEADERS),YES) -define gb_LinkTarget__use_mozilla_headers +define gb_LinkTarget__use_npapi_headers $(call gb_LinkTarget_set_include,$(1),\ - $(MOZILLA_HEADERS_CFLAGS) \ + $(NPAPI_HEADERS_CFLAGS) \ $$(INCLUDE) \ ) endef -else #!SYSTEM_MOZILLA_HEADERS +else #!SYSTEM_NPAPI_HEADERS -define gb_LinkTarget__use_mozilla_headers -$(call gb_LinkTarget_use_package,$(1),mozilla_inc) +define gb_LinkTarget__use_npapi_headers +$(call gb_LinkTarget_use_package,$(1),npapi) $(call gb_LinkTarget_set_include,$(1),\ -I$(OUTDIR)/inc/external/npsdk \ $$(INCLUDE) \ @@ -72,7 +72,7 @@ $(call gb_LinkTarget_set_include,$(1),\ endef -endif #SYSTEM_MOZILLA_HEADERS +endif #SYSTEM_NPAPI_HEADERS ifeq ($(SYSTEM_ODBC_HEADERS),YES) diff --git a/config_host.mk.in b/config_host.mk.in index d473422..d099160 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -429,7 +429,7 @@ export ML_EXE=@ML_EXE@ export MOC4=@MOC4@ export MOC=@MOC@ export MOZILLABUILD=@MOZILLABUILD@ -export MOZILLA_HEADERS_CFLAGS=$(gb_SPACE)@MOZILLA_HEADERS_CFLAGS@ +export NPAPI_HEADERS_CFLAGS=$(gb_SPACE)@NPAPI_HEADERS_CFLAGS@ export MOZILLA_VERSION=@MOZILLA_VERSION@ export MOZ_FLAVOUR=@MOZ_FLAVOUR@ export MOZ_INC=@MOZ_INC@ @@ -618,7 +618,7 @@ export SYSTEM_LPSOLVE=@SYSTEM_LPSOLVE@ export SYSTEM_MDDS=@SYSTEM_MDDS@ export SYSTEM_MESA_HEADERS=@SYSTEM_MESA_HEADERS@ export SYSTEM_MOZILLA=@SYSTEM_MOZILLA@ -export SYSTEM_MOZILLA_HEADERS=@SYSTEM_MOZILLA_HEADERS@ +export SYSTEM_NPAPI_HEADERS=@SYSTEM_NPAPI_HEADERS@ export SYSTEM_MYSQL=@SYSTEM_MYSQL@ export SYSTEM_MYSQL_CPPCONN=@SYSTEM_MYSQL_CPPCONN@ export SYSTEM_MYTHES=@SYSTEM_MYTHES@ diff --git a/configure.ac b/configure.ac index 91b151c..0127214 100644 --- a/configure.ac +++ b/configure.ac @@ -1676,11 +1676,11 @@ AC_ARG_WITH(system-mozilla, WITH_SYSTEM_MOZILLA=$withval , WITH_SYSTEM_MOZILLA=no) -AC_ARG_WITH(system-mozilla-headers, - AS_HELP_STRING([--with-system-mozilla-headers], - [Use mozilla headers provided by system instead of bundled ones. Used in - nsplugin]),, - [with_system_mozilla_headers="$with_system_headers"] +AC_ARG_WITH(system-npapi-headers, + AS_HELP_STRING([--with-system-npapi-headers], + [Use NPAPI headers provided by system instead of bundled ones. Used in + extensions/source/nsplugin and extensions/source/plugin]),, + [with_system_npapi_headers="$with_system_headers"] ) AC_ARG_WITH(system-libpng, @@ -8336,19 +8336,19 @@ dnl =================================================================== dnl Check for system mozilla headers dnl =================================================================== HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION= -AC_MSG_CHECKING([which Mozilla headers to use]) +AC_MSG_CHECKING([which NPAPI headers to use]) -if test "$with_system_mozilla_headers" = "yes"; then +if test "$with_system_npapi_headers" = "yes"; then AC_MSG_RESULT([external]) - SYSTEM_MOZILLA_HEADERS=YES + SYSTEM_NPAPI_HEADERS=YES # First try npapi-sdk: - PKG_CHECK_MODULES(MOZILLA_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no]) + PKG_CHECK_MODULES(NPAPI_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no]) # Then go with libxul: if test "x$LOCATED" != "xyes"; then - PKG_CHECK_MODULES(MOZILLA_HEADERS, libxul, [LOCATED=yes], [LOCATED=no]) + PKG_CHECK_MODULES(NPAPI_HEADERS, libxul, [LOCATED=yes], [LOCATED=no]) fi if test "x$LOCATED" != "xyes"; then - PKG_CHECK_MODULES(MOZILLA_HEADERS, mozilla-plugin, [LOCATED=yes], [LOCATED=no]) + PKG_CHECK_MODULES(NPAPI_HEADERS, mozilla-plugin, [LOCATED=yes], [LOCATED=no]) fi # if still not found bail out if test "x$LOCATED" != "xyes"; then @@ -8357,7 +8357,7 @@ if test "$with_system_mozilla_headers" = "yes"; then AC_LANG_PUSH([C]) save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $MOZILLA_HEADERS_CFLAGS" + CFLAGS="$CFLAGS $NPAPI_HEADERS_CFLAGS" AC_MSG_CHECKING([for NPP_GetMIMEDescription return type]) AC_COMPILE_IFELSE( [AC_LANG_SOURCE([[ @@ -8373,15 +8373,13 @@ if test "$with_system_mozilla_headers" = "yes"; then CFLAGS=$save_CFLAGS AC_LANG_POP([C]) else - if test "$enable_mozilla" = "no"; then - AC_MSG_RESULT([none]) - else - AC_MSG_RESULT([internal]) - fi - SYSTEM_MOZILLA_HEADERS=NO + AC_MSG_RESULT([internal]) + dnl ...but will not be built/used unless ENABLE_NSPLUGIN or WITH_MOZILLA + dnl is YES + SYSTEM_NPAPI_HEADERS=NO fi -AC_SUBST(MOZILLA_HEADERS_CFLAGS) -AC_SUBST(SYSTEM_MOZILLA_HEADERS) +AC_SUBST(NPAPI_HEADERS_CFLAGS) +AC_SUBST(SYSTEM_NPAPI_HEADERS) AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION) dnl =================================================================== diff --git a/extensions/Executable_pluginapp.bin.mk b/extensions/Executable_pluginapp.bin.mk index ae25c2e..43e8ea3 100644 --- a/extensions/Executable_pluginapp.bin.mk +++ b/extensions/Executable_pluginapp.bin.mk @@ -32,7 +32,7 @@ $(eval $(call gb_Executable_Executable,pluginapp.bin)) $(eval $(call gb_Executable_use_package,pluginapp.bin,np_sdk_inc)) -$(eval $(call gb_Executable_use_external,pluginapp.bin,mozilla_headers)) +$(eval $(call gb_Executable_use_external,pluginapp.bin,npapi_headers)) $(eval $(call gb_Executable_set_include,pluginapp.bin,\ $$(INCLUDE) \ diff --git a/extensions/Library_npsoplugin.mk b/extensions/Library_npsoplugin.mk index 253e246..31908f6 100644 --- a/extensions/Library_npsoplugin.mk +++ b/extensions/Library_npsoplugin.mk @@ -35,7 +35,7 @@ $(eval $(call gb_Library_use_packages,npsoplugin,\ np_sdk_inc \ )) -$(eval $(call gb_Library_use_external,npsoplugin,mozilla_headers)) +$(eval $(call gb_Library_use_external,npsoplugin,npapi_headers)) $(eval $(call gb_Library_use_static_libraries,npsoplugin,\ npsoenv \ diff --git a/extensions/Library_pl.mk b/extensions/Library_pl.mk index 8cbbd1b..e849cfd 100644 --- a/extensions/Library_pl.mk +++ b/extensions/Library_pl.mk @@ -34,7 +34,7 @@ $(eval $(call gb_Library_set_componentfile,pl,extensions/source/plugin/pl)) $(eval $(call gb_Library_use_package,pl,np_sdk_inc)) -$(eval $(call gb_Library_use_external,pl,mozilla_headers)) +$(eval $(call gb_Library_use_external,pl,npapi_headers)) $(eval $(call gb_Library_set_include,pl,\ $$(INCLUDE) \ diff --git a/extensions/StaticLibrary_plugcon.mk b/extensions/StaticLibrary_plugcon.mk index 0ef41af..663184d 100644 --- a/extensions/StaticLibrary_plugcon.mk +++ b/extensions/StaticLibrary_plugcon.mk @@ -33,7 +33,7 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,plugcon)) $(eval $(call gb_StaticLibrary_use_package,plugcon,np_sdk_inc)) -$(eval $(call gb_StaticLibrary_use_external,plugcon,mozilla_headers)) +$(eval $(call gb_StaticLibrary_use_external,plugcon,npapi_headers)) $(eval $(call gb_StaticLibrary_set_include,plugcon,\ $$(INCLUDE) \ diff --git a/np_sdk/Module_np_sdk.mk b/np_sdk/Module_np_sdk.mk index eabc6f8..6ebba87 100644 --- a/np_sdk/Module_np_sdk.mk +++ b/np_sdk/Module_np_sdk.mk @@ -33,9 +33,9 @@ $(eval $(call gb_Module_add_targets,np_sdk,\ Package_inc \ )) -ifeq ($(SYSTEM_MOZILLA_HEADERS),NO) +ifeq ($(SYSTEM_NPAPI_HEADERS),NO) $(eval $(call gb_Module_add_targets,np_sdk,\ - Package_mozilla_inc \ + Package_npapi \ )) endif diff --git a/np_sdk/Package_mozilla_inc.mk b/np_sdk/Package_mozilla_inc.mk deleted file mode 100644 index 20b94f1..0000000 --- a/np_sdk/Package_mozilla_inc.mk +++ /dev/null @@ -1,35 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# Major Contributor(s): -# Copyright (C) 2012 Matúš Kukan <matus.ku...@gmail.com> (initial developer) -# -# All Rights Reserved. -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. - -$(eval $(call gb_Package_Package,mozilla_inc,$(SRCDIR)/np_sdk)) - -$(eval $(call gb_Package_add_file,mozilla_inc,inc/external/npsdk/npapi.h,inc/npapi.h)) -$(eval $(call gb_Package_add_file,mozilla_inc,inc/external/npsdk/npfunctions.h,inc/npfunctions.h)) -$(eval $(call gb_Package_add_file,mozilla_inc,inc/external/npsdk/npruntime.h,inc/npruntime.h)) -$(eval $(call gb_Package_add_file,mozilla_inc,inc/external/npsdk/nptypes.h,inc/nptypes.h)) - -# vim: set noet sw=4 ts=4: diff --git a/np_sdk/Package_npapi.mk b/np_sdk/Package_npapi.mk new file mode 100644 index 0000000..5cf2493 --- /dev/null +++ b/np_sdk/Package_npapi.mk @@ -0,0 +1,35 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2012 Matúš Kukan <matus.ku...@gmail.com> (initial developer) +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(eval $(call gb_Package_Package,npapi,$(SRCDIR)/np_sdk)) + +$(eval $(call gb_Package_add_file,npapi,inc/external/npsdk/npapi.h,inc/npapi.h)) +$(eval $(call gb_Package_add_file,npapi,inc/external/npsdk/npfunctions.h,inc/npfunctions.h)) +$(eval $(call gb_Package_add_file,npapi,inc/external/npsdk/npruntime.h,inc/npruntime.h)) +$(eval $(call gb_Package_add_file,npapi,inc/external/npsdk/nptypes.h,inc/nptypes.h)) + +# vim: set noet sw=4 ts=4: diff --git a/np_sdk/StaticLibrary_nputils.mk b/np_sdk/StaticLibrary_nputils.mk index 824c268..d9ff1ae 100644 --- a/np_sdk/StaticLibrary_nputils.mk +++ b/np_sdk/StaticLibrary_nputils.mk @@ -33,7 +33,7 @@ $(eval $(call gb_StaticLibrary_use_packages,nputils,\ )) $(eval $(call gb_StaticLibrary_use_externals,nputils,\ - mozilla_headers \ + npapi_headers \ )) ifeq ($(GUIBASE),aqua) commit fc45189c7af475635cd7a6a51d5c7409e10deb27 Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Nov 15 16:10:48 2012 +0100 Replace medDebug with sal/log.hxx functionality Change-Id: I30bf94043b5b638260704629356d010c8ea6b4e0 diff --git a/extensions/source/plugin/inc/plugin/unx/mediator.hxx b/extensions/source/plugin/inc/plugin/unx/mediator.hxx index 9094d92..ac901f3 100644 --- a/extensions/source/plugin/inc/plugin/unx/mediator.hxx +++ b/extensions/source/plugin/inc/plugin/unx/mediator.hxx @@ -29,15 +29,11 @@ #define _MEDIATOR_HXX #include <string.h> -#include <stdarg.h> #include <tools/link.hxx> #include <osl/pipe.hxx> #include <osl/mutex.hxx> #include <osl/conditn.hxx> #include <osl/thread.hxx> -#if OSL_DEBUG_LEVEL > 1 -#include <stdio.h> -#endif #include <vector> @@ -164,22 +160,6 @@ class MediatorListener : public osl::Thread virtual void onTerminated(); }; -inline void medDebug( int condition, const char* pFormat, ... ) -{ -#if OSL_DEBUG_LEVEL > 1 - if( condition ) - { - va_list ap; - va_start( ap, pFormat ); - vfprintf( stderr, pFormat, ap ); - va_end( ap ); - } -#else - (void)condition; - (void)pFormat; -#endif -} - #endif // _MEDIATOR_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/plugin/unx/mediator.cxx b/extensions/source/plugin/unx/mediator.cxx index 4edefaa..9cb11fc 100644 --- a/extensions/source/plugin/unx/mediator.cxx +++ b/extensions/source/plugin/unx/mediator.cxx @@ -62,7 +62,7 @@ Mediator::~Mediator() aHeader[2] = MEDIATOR_MAGIC; ssize_t nToWrite = sizeof(aHeader); bool bSuccess = (nToWrite == write(m_nSocket, aHeader, nToWrite)); - SAL_WARN_IF( !bSuccess, "extensions", "short write"); + SAL_WARN_IF(!bSuccess, "extensions.plugin", "short write"); } // kick the thread out of its run method; it deletes itself close( m_nSocket ); @@ -100,7 +100,7 @@ sal_uLong Mediator::SendMessage( sal_uLong nBytes, const char* pBytes, sal_uLong memcpy( &pBuffer[3], pBytes, (size_t)nBytes ); ssize_t nToWrite = nBytes + 3*sizeof( sal_uLong ); bool bSuccess = (nToWrite == write( m_nSocket, pBuffer, nToWrite )); - SAL_WARN_IF( !bSuccess, "extensions", "short write"); + SAL_WARN_IF(!bSuccess, "extensions.plugin", "short write"); delete [] pBuffer; return nMessageID; @@ -222,16 +222,21 @@ void MediatorListener::run() } else { - medDebug( 1, "got incomplete MediatorMessage: { %d, %d, %*s }\n", - nHeader[0], nHeader[1], nHeader[1], pBuffer ); + SAL_WARN( + "extensions.plugin", + "got incomplete MediatorMessage: { " << nHeader[0] << ", " + << nHeader[1] << ", ... }"); bRun = false; } delete [] pBuffer; } else { - medDebug( 1, "got incomplete message header of %d bytes ( nHeader = [ %u, %u ] ), errno is %d\n", - nBytes, nHeader[ 0 ], nHeader[ 1 ], (int)errno ); + SAL_WARN( + "extensions.plugin", + "got incomplete message header of " << nBytes + << " bytes (nHeader = [" << nHeader[0] << ", " << nHeader[1] + << "]), errno is " << errno); bRun = false; } } @@ -252,7 +257,9 @@ sal_uLong MediatorMessage::ExtractULONG() if( ! m_pRun ) m_pRun = m_pBytes; - medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::ExtractULONG\n" ); + SAL_WARN_IF( + (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "extensions.plugin", + "overflow in MediatorMessage::ExtractULONG"); sal_uLong nCount; memcpy( &nCount, m_pRun, sizeof( sal_uLong ) ); m_pRun += sizeof( sal_uLong ); @@ -264,13 +271,17 @@ void* MediatorMessage::GetBytes( sal_uLong& rBytes ) if( ! m_pRun ) m_pRun = m_pBytes; - medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetBytes\n" ); + SAL_WARN_IF( + (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "extensions.plugin", + "overflow in MediatorMessage::GetBytes"); sal_uLong nBytes = ExtractULONG(); if( nBytes == 0 ) return NULL; - medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetBytes\n" ); + SAL_WARN_IF( + (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "extensions.plugin", + "overflow in MediatorMessage::GetBytes"); char* pBuffer = new char[ nBytes ]; memcpy( pBuffer, m_pRun, nBytes ); m_pRun += nBytes; @@ -283,13 +294,17 @@ char* MediatorMessage::GetString() if( ! m_pRun ) m_pRun = m_pBytes; - medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); + SAL_WARN_IF( + (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "extensions.plugin", + "overflow in MediatorMessage::GetString"); sal_uLong nBytes = ExtractULONG(); if( nBytes == 0 ) return NULL; - medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); + SAL_WARN_IF( + (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "extensions.plugin", + "overflow in MediatorMessage::GetString"); char* pBuffer = new char[ nBytes+1 ]; memcpy( pBuffer, m_pRun, nBytes ); pBuffer[ nBytes ] = 0; @@ -302,10 +317,16 @@ sal_uInt32 MediatorMessage::GetUINT32() if( ! m_pRun ) m_pRun = m_pBytes; - medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetUINT32\n" ); + SAL_WARN_IF( + (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "extensions.plugin", + "overflow in MediatorMessage::GetUINT32"); sal_uLong nBytes = ExtractULONG(); - medDebug( nBytes != sizeof( sal_uInt32 ), "No sal_uInt32 in MediatorMessage::GetUINT32\n" ); - medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetUINT32\n" ); + SAL_WARN_IF( + nBytes != sizeof( sal_uInt32 ), "extensions.plugin", + "no sal_uInt32 in MediatorMessage::GetUINT32"); + SAL_WARN_IF( + (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "extensions.plugin", + "overflow in MediatorMessage::GetUINT32"); sal_uInt32 nRet; memcpy( &nRet, m_pRun, sizeof( nRet ) ); m_pRun += sizeof( sal_uInt32 ); diff --git a/extensions/source/plugin/unx/npnapi.cxx b/extensions/source/plugin/unx/npnapi.cxx index 8a9ce45..2159192 100644 --- a/extensions/source/plugin/unx/npnapi.cxx +++ b/extensions/source/plugin/unx/npnapi.cxx @@ -110,13 +110,13 @@ static NPError l_NPN_DestroyStream( NPP instance, NPStream* stream, NPError reas static JRIEnv* l_NPN_GetJavaEnv() { // no java in this program - medDebug( 1, "SNI: NPN_GetJavaEnv\n" ); + SAL_INFO("extensions.plugin", "SNI: NPN_GetJavaEnv"); return NULL; } static jref l_NPN_GetJavaPeer( NPP /*instance*/ ) { - medDebug( 1, "SNI: NPN_GetJavaPeer\n" ); + SAL_INFO("extensions.plugin", "SNI: NPN_GetJavaPeer"); return NULL; } #endif @@ -134,13 +134,13 @@ static NPError l_NPN_GetURL( NPP instance, const char* url, const char* window ) POST_STRING(url), POST_STRING(window), NULL ); - medDebug( !pMes, "geturl: message unaswered\n" ); + SAL_WARN_IF(!pMes, "extensions.plugin", "geturl: message unanswered"); if( ! pMes ) return NPERR_GENERIC_ERROR; // returns NPError NPError aRet = pConnector->GetNPError( pMes ); - medDebug( aRet, "geturl returns %d\n", (int)aRet ); + SAL_WARN_IF(aRet, "extensions.plugin", "geturl returns " << aRet); delete pMes; return aRet; } @@ -257,7 +257,7 @@ static NPError l_NPN_PostURL( NPP instance, const char* url, const char* window, static NPError l_NPN_RequestRead( NPStream* stream, NPByteRange* rangeList ) { - medDebug( 1, "pluginapp: NPN_RequestRead\n" ); + SAL_INFO("extensions.plugin", "pluginapp: NPN_RequestRead"); NPByteRange* pRange = rangeList; sal_uInt32 nRanges = 0; @@ -333,7 +333,7 @@ static const char* l_NPN_UserAgent( NPP instance ) delete pMes; - medDebug( 1, "NPN_UserAgent returns %s\n", pAgent ); + SAL_INFO("extensions.plugin", "NPN_UserAgent returns " << pAgent); return pAgent; } @@ -364,7 +364,7 @@ static int32_t l_NPN_Write( NPP instance, NPStream* stream, int32_t len, void* b static void l_NPN_ReloadPlugins( NPBool /*reloadPages*/ ) { - medDebug( 1, "NPN_ReloadPlugins: SNI\n" ); + SAL_INFO("extensions.plugin", "NPN_ReloadPlugins: SNI"); } static NPError l_NPN_GetValue( NPP, NPNVariable variable, void* value ) @@ -378,31 +378,31 @@ static NPError l_NPN_GetValue( NPP, NPNVariable variable, void* value ) { case NPNVxDisplay: *((Display**)value) = pXtAppDisplay; - medDebug( 1, "Display requested\n" ); + SAL_INFO("extensions.plugin", "Display requested"); break; case NPNVxtAppContext: *((XtAppContext*)value) = app_context; - medDebug( 1, "AppContext requested\n" ); + SAL_INFO("extensions.plugin", "AppContext requested"); break; case NPNVjavascriptEnabledBool: // no javascript *(NPBool*)value = false; - medDebug( 1, "javascript enabled requested\n" ); + SAL_INFO("extensions.plugin", "javascript enabled requested"); break; case NPNVasdEnabledBool: // no SmartUpdate *(NPBool*)value = false; - medDebug( 1, "smart update enabled requested\n" ); + SAL_INFO("extensions.plugin", "smart update enabled requested"); break; case NPNVisOfflineBool: // no offline browsing *(NPBool*)value = false; - medDebug( 1, "offline browsing requested\n" ); + SAL_INFO("extensions.plugin", "offline browsing requested"); break; case NPNVSupportsXEmbedBool: // asking xembed *(int*)value = true; - medDebug( 1, "xembed requested\n" ); + SAL_INFO("extensions.plugin", "xembed requested"); break; case NPNVToolkit: # ifdef ENABLE_GTK @@ -410,10 +410,12 @@ static NPError l_NPN_GetValue( NPP, NPNVariable variable, void* value ) # else *(int*)value = 0; # endif - medDebug( 1, "toolkit requested\n" ); + SAL_INFO("extensions.plugin", "toolkit requested"); break; default: - medDebug( 1, "unknown NPNVariable %x requested\n", variable ); + SAL_WARN( + "extensions.plugin", + "unknown NPNVariable " << +variable << " requested"); return NPERR_INVALID_PARAM; } return NPERR_NO_ERROR; @@ -421,23 +423,23 @@ static NPError l_NPN_GetValue( NPP, NPNVariable variable, void* value ) static NPError l_NPN_SetValue(NPP /*instance*/, NPPVariable variable, void *value) { - medDebug( 1, "NPN_SetValue %d=%p\n", variable, value ); + SAL_INFO("extensions.plugin", "NPN_SetValue " << +variable << "=" << value); return 0; } static void l_NPN_InvalidateRect(NPP /*instance*/, NPRect* /*invalidRect*/) { - medDebug( 1, "NPN_InvalidateRect\n" ); + SAL_INFO("extensions.plugin", "NPN_InvalidateRect"); } static void l_NPN_InvalidateRegion(NPP /*instance*/, NPRegion /*invalidRegion*/) { - medDebug( 1, "NPN_InvalidateRegion\n" ); + SAL_INFO("extensions.plugin", "NPN_InvalidateRegion"); } static void l_NPN_ForceRedraw(NPP /*instance*/) { - medDebug( 1, "NPN_ForceRedraw\n" ); + SAL_INFO("extensions.plugin", "NPN_ForceRedraw"); } } @@ -519,7 +521,8 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) while( (pMessage = GetNextMessage( sal_False )) ) { nCommand = (CommandAtoms)pMessage->GetUINT32(); - medDebug( 1, "pluginapp: %s\n", GetCommandName( nCommand ) ); + SAL_INFO( + "extensions.plugin", "pluginapp: " << GetCommandName(nCommand)); switch( nCommand ) { case eNPP_DestroyStream: @@ -591,7 +594,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) m_aInstances.erase( m_aInstances.begin() + nInstance ); delete pInst; delete instance; - medDebug( 1, "destroyed instance (returning %d)\n", aRet ); + SAL_INFO( + "extensions.plugin", + "destroyed instance (returning " << aRet << ")"); } break; case eNPP_NewStream: @@ -609,10 +614,17 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) uint16_t nStype = NP_ASFILE; NPError aRet = aPluginFuncs.newstream( instance, pType, pStream, *pSeekable, &nStype ); - medDebug( 1, "pluginapp: NPP_NewStream( %p, %s, %p, %s, %p ) returns %d\n" - "stream = { pdata = %p, ndata = %p, url = %s, end = %d, lastmodified = %d, notifyData = %p }\n", - instance, pType, pStream, *pSeekable ? "seekable" : "not seekable", &nStype, (int)aRet, - pStream->pdata, pStream->ndata, pStream->url, pStream->end, pStream->lastmodified, pStream->notifyData ); + SAL_INFO( + "extensions.plugin", + "pluginapp: NPP_NewStream(" << instance << ", " << pType + << ", " << pStream << ", " + << (*pSeekable ? "seekable" : "not seekable") << ", " + << &nStype << ") returns " << aRet + << "; stream = { pdata = " << pStream->pdata + << ", ndata = " << pStream->ndata << ", url = " + << pStream->url << ", end = " << pStream->end + << ", lastmodified = " << pStream->lastmodified + << ", notifyData = " << pStream->notifyData << " }"); Respond( pMessage->m_nID, (char*)&aRet, sizeof( aRet ), &nStype, sizeof( nStype ), @@ -646,14 +658,17 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) pInst->nArg ? pInst->argv : NULL, ( nSaveBytes == 4 && *(sal_uInt32*)pSavedData == 0 ) ? &(pInst->aData) : NULL ); - medDebug( 1, "pluginapp: NPP_New( %s, %p, %d, %d, %p, %p, %p ) returns %d\n", - pInst->pMimeType, - instance, *pMode, pInst->nArg, pInst->argn, pInst->argv, &pInst->aData, - (int) aRet ); -#if OSL_DEBUG_LEVEL > 1 + SAL_INFO( + "extensions.plugin", + "pluginapp: NPP_New( " << pInst->pMimeType << ", " + << instance << ", " << *pMode << ", " << pInst->nArg + << ", " << pInst->argn << ", " << pInst->argv << ", " + << &pInst->aData << ") returns" << aRet); for( int i = 0; i < pInst->nArg; i++ ) - medDebug( 1, " \"%s\"=\"%s\"\n", pInst->argn[i], pInst->argv[i] ); -#endif + SAL_INFO( + "extensions.plugin", + " \"" << pInst->argn[i] << "\"=\"" << pInst->argv[i] + << "\""); #ifdef ENABLE_GTK // check if XEMBED is to be used @@ -666,7 +681,10 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) NPError error = aPluginFuncs.getvalue( instance, NPPVpluginNeedsXEmbed, (void *)&bNeedsXEmbed ); if( error == NPERR_NO_ERROR ) pInst->bShouldUseXEmbed = (bNeedsXEmbed != 0); - medDebug( 1, "should use xembed = %s\n", pInst->bShouldUseXEmbed ? "true" : "false" ); + SAL_INFO( + "extensions.plugin", + "should use xembed = " + << (pInst->bShouldUseXEmbed ? "true" : "false")); } #endif @@ -694,7 +712,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) { if( ! pInst->pGtkWidget ) { - medDebug( 1, "creating gtk plug and socket\n" ); + SAL_INFO( + "extensions.plugin", + "creating gtk plug and socket"); pInst->pGtkWindow = gtk_plug_new((GdkNativeWindow)reinterpret_cast<sal_uIntPtr>(pWindow->window)); gtk_widget_show( pInst->pGtkWindow ); @@ -771,7 +791,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) } NPError aRet = aPluginFuncs.setwindow( pInst->instance, &pInst->window ); - medDebug( 1, "pluginapp: NPP_SetWindow returns %d\n", (int) aRet ); + SAL_INFO( + "extensions.plugin", + "pluginapp: NPP_SetWindow returns " << aRet); Respond( pMessage->m_nID, (char*)&aRet, sizeof( aRet ), NULL ); @@ -785,7 +807,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; char* fname = pMessage->GetString(); - medDebug( 1, "pluginapp: NPP_StreamAsFile %s\n", fname ); + SAL_INFO( + "extensions.plugin", + "pluginapp: NPP_StreamAsFile " << fname); aPluginFuncs.asfile( instance, pStream, fname ); delete [] fname; } @@ -811,8 +835,11 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) NPStream* pStream = m_aNPWrapStreams[ nFileID ]; int32_t nRet = aPluginFuncs.writeready( instance, pStream ); - medDebug( 1, "pluginapp: NPP_WriteReady( %p, %p ) (stream id = %d) returns %d\n", - instance, pStream, nFileID, nRet ); + SAL_INFO( + "extensions.plugin", + "pluginapp: NPP_WriteReady(" << instance << ", " << pStream + << ") (stream id = " << nFileID << ") returns " + << nRet); Respond( pMessage->m_nID, (char*)&nRet, sizeof( nRet ), @@ -830,10 +857,16 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) char* buffer = (char*)pMessage->GetBytes( len ); int32_t nRet = aPluginFuncs.write( instance, pStream, offset, len, buffer ); - medDebug( 1,"pluginapp: NPP_Write( %p, %p, %d, %d, %p ) returns %d\n" - "stream = { pdata = %p, ndata = %p, url = %s, end = %d, lastmodified = %d, notifyData = %p }\n", - instance, pStream, offset, len, buffer, nRet, - pStream->pdata, pStream->ndata, pStream->url, pStream->end, pStream->lastmodified, pStream->notifyData ); + SAL_INFO( + "extensions.plugin", + "pluginapp: NPP_Write(" << instance << ", " << pStream + << ", " << offset << ", " << len << ", " << buffer + << ") returns " << nRet << "; stream = { pdata = " + << pStream->pdata << ", ndata = " << pStream->ndata + << ", url = " << pStream->url << ", end = " + << pStream->end << ", lastmodified = " + << pStream->lastmodified << ", notifyData = " + << pStream->notifyData << " }"); Respond( pMessage->m_nID, (char*)&nRet, sizeof( nRet ), @@ -858,25 +891,33 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) pNP_Initialize = (NPError(*)(NPNetscapeFuncs*, NPPluginFuncs*)) osl_getAsciiFunctionSymbol( pPluginLib, "NP_Initialize" ); - medDebug( !pNP_Initialize, "no NP_Initialize, %s\n", dlerror() ); + SAL_WARN_IF( + !pNP_Initialize, "extensions.plugin", + "no NP_Initialize, " << dlerror()); pNP_Shutdown = (NPError(*)()) osl_getAsciiFunctionSymbol( pPluginLib, "NP_Shutdown" ); - medDebug( !pNP_Initialize, "no NP_Shutdown, %s\n", dlerror() ); + SAL_WARN_IF( + !pNP_Initialize, "extensions.plugin", + "no NP_Shutdown, " << dlerror()); - medDebug( 1, "entering NP_Initialize\n" ); + SAL_INFO("extensions.plugin", "entering NP_Initialize"); NPError aRet = pNP_Initialize( &aNetscapeFuncs, &aPluginFuncs ); - medDebug( 1, "pluginapp: NP_Initialize returns %d\n", (int) aRet ); + SAL_INFO( + "extensions.plugin", + "pluginapp: NP_Initialize returns " << aRet); Respond( pMessage->m_nID, (char*)&aRet, sizeof( aRet ), NULL ); } break; case eNPP_Shutdown: { bool bSuccess = (4 == write(wakeup_fd[1], "xxxx", 4)); - SAL_WARN_IF( !bSuccess, "extensions", "short write"); + SAL_WARN_IF(!bSuccess, "extensions.plugin", "short write"); } break; default: - medDebug( 1, "caught unknown NPP request %d\n", nCommand ); + SAL_WARN( + "extensions.plugin", + "caught unknown NPP request " << +nCommand); break; } delete pMessage; @@ -886,7 +927,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) void LoadAdditionalLibs( const char* _pPluginLib ) { - medDebug( 1, "LoadAdditionalLibs %s\n", _pPluginLib ); + SAL_INFO("extensions.plugin", "LoadAdditionalLibs " << _pPluginLib); if( ! strncmp( _pPluginLib, "libflashplayer.so", 17 ) ) { diff --git a/extensions/source/plugin/unx/nppapi.cxx b/extensions/source/plugin/unx/nppapi.cxx index 0be0f46..ff4733f 100644 --- a/extensions/source/plugin/unx/nppapi.cxx +++ b/extensions/source/plugin/unx/nppapi.cxx @@ -96,7 +96,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) while( (pMessage = GetNextMessage( sal_False )) ) { nCommand = (CommandAtoms)pMessage->GetUINT32(); - medDebug( 1, "%s\n", GetCommandName( nCommand ) ); + SAL_INFO("extensions.plugin", GetCommandName(nCommand)); switch( nCommand ) { case eNPN_GetURL: @@ -146,11 +146,16 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) m_aNPWrapStreams.erase( m_aNPWrapStreams.begin() + nFileID ); } else - medDebug( 1, "StreamID %d has incoherent urls %s and %s\n", - nFileID, pUrl, m_aNPWrapStreams[ nFileID ]->url ); + SAL_WARN( + "extensions.plugin", + "StreamID " << nFileID << " has incoherent urls " + << pUrl << " and " + << m_aNPWrapStreams[nFileID]->url); } else - medDebug( 1, "Nonexistent StreamID %d\n", nFileID ); + SAL_WARN( + "extensions.plugin", + "nonexistent StreamID " << nFileID); Respond( pMessage->m_nID, (char*)(&aRet), sizeof( NPError ), NULL ); @@ -310,7 +315,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) } break; default: - medDebug( 1, "caught unknown NPN request %d\n", nCommand ); + SAL_WARN( + "extensions.plugin", + "caught unknown NPN request " << +nCommand); } delete pMessage; diff --git a/extensions/source/plugin/unx/npwrap.cxx b/extensions/source/plugin/unx/npwrap.cxx index 514c92a..b2cd532 100644 --- a/extensions/source/plugin/unx/npwrap.cxx +++ b/extensions/source/plugin/unx/npwrap.cxx @@ -63,10 +63,10 @@ static bool bPluginAppQuit = false; static long GlobalConnectionLostHdl( void* /*pInst*/, void* /*pArg*/ ) { - medDebug( 1, "pluginapp exiting due to connection lost\n" ); + SAL_WARN("extensions.plugin", "pluginapp exiting due to connection lost"); bool bSuccess = (4 == write(wakeup_fd[1], "xxxx", 4 )); - SAL_WARN_IF( !bSuccess, "extensions", "short write"); + SAL_WARN_IF(!bSuccess, "extensions.plugin", "short write"); return 0; } @@ -95,7 +95,7 @@ extern "C" // it seems you can use XtRemoveInput only // safely from within the callback // why is that ? - medDebug( 1, "removing wakeup pipe\n" ); + SAL_INFO("extensions.plugin", "removing wakeup pipe"); XtRemoveInput( *id ); XtAppSetExitFlag( app_context ); bPluginAppQuit = true; @@ -111,9 +111,9 @@ extern "C" IMPL_LINK( PluginConnector, NewMessageHdl, Mediator*, /*pMediator*/ ) { - medDebug( 1, "new message handler\n" ); + SAL_INFO("extensions.plugin", "new message handler"); bool bSuccess = (4 == write(wakeup_fd[1], "cccc", 4)); - SAL_WARN_IF( !bSuccess, "extensions", "short write"); + SAL_WARN_IF(!bSuccess, "extensions.plugin", "short write"); return 0; } @@ -135,7 +135,10 @@ Widget createSubWidget( char* /*pPluginText*/, Widget shell, XLIB_Window aParent XtRealizeWidget( shell ); XtRealizeWidget( newWidget ); - medDebug( 1, "Reparenting new widget %x to %x\n", XtWindow( newWidget ), aParentWindow ); + SAL_INFO( + "extensions.plugin", + "reparenting new widget " << XtWindow( newWidget ) << " to " + << aParentWindow); XReparentWindow( pXtAppDisplay, XtWindow( shell ), aParentWindow, @@ -178,10 +181,7 @@ static oslModule LoadModule( const char* pPath ) osl_getFileURLFromSystemPath( sSystemPath.pData, &sFileURL.pData ); oslModule pLib = osl_loadModule( sFileURL.pData, SAL_LOADMODULE_LAZY ); - if( ! pLib ) - { - medDebug( 1, "could not open %s: %s\n", pPath, dlerror() ); - } + SAL_INFO_IF(!pLib, "extensions.plugin", "could not open " << pPath); return pLib; } @@ -189,15 +189,18 @@ static oslModule LoadModule( const char* pPath ) static void CheckPlugin( const char* pPath ) { oslModule pLib = LoadModule( pPath ); - - char*(*pNP_GetMIMEDescription)() = (char*(*)()) - osl_getAsciiFunctionSymbol( pLib, "NP_GetMIMEDescription" ); - if( pNP_GetMIMEDescription ) - printf( "%s\n", pNP_GetMIMEDescription() ); - else - medDebug( 1, "could not get symbol NP_GetMIMEDescription %s\n", dlerror() ); - - osl_unloadModule( pLib ); + if (pLib != 0) + { + char*(*pNP_GetMIMEDescription)() = (char*(*)()) + osl_getAsciiFunctionSymbol( pLib, "NP_GetMIMEDescription" ); + if( pNP_GetMIMEDescription ) + printf( "%s\n", pNP_GetMIMEDescription() ); + else + SAL_WARN( + "extensions.plugin", + "could not get symbol NP_GetMIMEDescription " << dlerror()); + osl_unloadModule( pLib ); + } } #if OSL_DEBUG_LEVEL > 1 && defined LINUX @@ -351,7 +354,7 @@ int main( int argc, char **argv) if( pipe( wakeup_fd ) ) { - medDebug( 1, "could not pipe()\n" ); + SAL_WARN("extensions.plugin", "could not pipe()"); return 1; } // initialize 'wakeup' pipe. @@ -410,7 +413,7 @@ int main( int argc, char **argv) GSource* pXTSource = g_source_new( &aXtEventFuncs, sizeof(GSource) ); if( !pXTSource ) { - medDebug( 1, "could not get Xt GSource" ); + SAL_WARN("extensions.plugin", "could not get Xt GSource"); return 1; } @@ -427,7 +430,7 @@ int main( int argc, char **argv) GSource *pWakeupSource = g_source_new( &aWakeupEventFuncs, sizeof(GSource) ); if ( pWakeupSource == NULL ) { - medDebug( 1, "could not get wakeup source" ); + SAL_WARN("extensions.plugin", "could not get wakeup source"); return 1; } g_source_set_priority( pWakeupSource, GDK_PRIORITY_EVENTS); @@ -483,16 +486,16 @@ int main( int argc, char **argv) #endif } while( ! XtAppGetExitFlag( app_context ) && ! bPluginAppQuit ); - medDebug( 1, "left plugin app main loop\n" ); + SAL_INFO("extensions.plugin", "left plugin app main loop"); #ifdef ENABLE_GTK g_source_remove(xt_polling_timer_id); #endif pNP_Shutdown(); - medDebug( 1, "NP_Shutdown done\n" ); + SAL_INFO("extensions.plugin", "NP_Shutdown done"); osl_unloadModule( pPluginLib ); - medDebug( 1, "plugin close\n" ); + SAL_INFO("extensions.plugin", "plugin close"); close( wakeup_fd[0] ); close( wakeup_fd[1] ); diff --git a/extensions/source/plugin/unx/plugcon.cxx b/extensions/source/plugin/unx/plugcon.cxx index 1a44624..cc0d3b5 100644 --- a/extensions/source/plugin/unx/plugcon.cxx +++ b/extensions/source/plugin/unx/plugcon.cxx @@ -44,7 +44,7 @@ sal_uInt32 PluginConnector::GetStreamID( NPStream* pStream ) for( size_t i = 0; i < nLen; i++ ) if( m_aNPWrapStreams[ i ] == pStream ) return static_cast<sal_uInt32>(i); - medDebug( 1, "Error: NPStream has no ID\n" ); + SAL_WARN("extensions.plugin", "NPStream has no ID"); return UnknownStreamID; } @@ -54,7 +54,7 @@ sal_uInt32 PluginConnector::GetNPPID( NPP instance ) for( size_t i=0; i <nLen; i++ ) if( m_aInstances[ i ]->instance == instance ) return static_cast<sal_uInt32>(i); - medDebug( 1, "Error: NPP has no ID\n" ); + SAL_WARN("extensions.plugin", "NPP has no ID"); return UnknownNPPID; } diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox index 45220ee..a474a2b 100644 --- a/sal/inc/sal/log-areas.dox +++ b/sal/inc/sal/log-areas.dox @@ -74,6 +74,7 @@ certain functionality. @section extensions +@li @c extensions.plugin @li @c extensions.scanner @section Filter
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits