Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
f53bc689
Kaydet (Commit)
f53bc689
authored
Ara 11, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rename Context -> JniUnoEnvironmentData
Change-Id: I97879d250ed0ed20d5e129ff3af6dbc2f5759078
üst
f5728a88
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
28 deletions
+33
-28
jni_bridge.cxx
bridges/source/jni_uno/jni_bridge.cxx
+18
-16
jni_bridge.h
bridges/source/jni_uno/jni_bridge.h
+2
-2
jni_java2uno.cxx
bridges/source/jni_uno/jni_java2uno.cxx
+7
-7
jni_uno2java.cxx
bridges/source/jni_uno/jni_uno2java.cxx
+6
-3
No files found.
bridges/source/jni_uno/jni_bridge.cxx
Dosyayı görüntüle @
f53bc689
...
@@ -84,7 +84,8 @@ void SAL_CALL Mapping_map_to_uno(
...
@@ -84,7 +84,8 @@ void SAL_CALL Mapping_map_to_uno(
static_cast
<
Mapping
const
*
>
(
mapping
)
->
m_bridge
;
static_cast
<
Mapping
const
*
>
(
mapping
)
->
m_bridge
;
JNI_guarded_context
jni
(
JNI_guarded_context
jni
(
bridge
->
m_jni_info
,
bridge
->
m_jni_info
,
(
static_cast
<
jni_uno
::
Context
*>
(
bridge
->
m_java_env
->
pContext
)
(
static_cast
<
jni_uno
::
JniUnoEnvironmentData
*>
(
bridge
->
m_java_env
->
pContext
)
->
machine
));
->
machine
));
JNI_interface_type_info
const
*
info
=
JNI_interface_type_info
const
*
info
=
...
@@ -135,7 +136,7 @@ void SAL_CALL Mapping_map_to_java(
...
@@ -135,7 +136,7 @@ void SAL_CALL Mapping_map_to_java(
static_cast
<
Mapping
const
*
>
(
mapping
)
->
m_bridge
;
static_cast
<
Mapping
const
*
>
(
mapping
)
->
m_bridge
;
JNI_guarded_context
jni
(
JNI_guarded_context
jni
(
bridge
->
m_jni_info
,
bridge
->
m_jni_info
,
(
static_cast
<
jni_uno
::
Context
*>
(
(
static_cast
<
jni_uno
::
JniUnoEnvironmentData
*>
(
bridge
->
m_java_env
->
pContext
)
bridge
->
m_java_env
->
pContext
)
->
machine
));
->
machine
));
jni
->
DeleteGlobalRef
(
*
ppJavaI
);
jni
->
DeleteGlobalRef
(
*
ppJavaI
);
...
@@ -148,7 +149,8 @@ void SAL_CALL Mapping_map_to_java(
...
@@ -148,7 +149,8 @@ void SAL_CALL Mapping_map_to_java(
static_cast
<
Mapping
const
*
>
(
mapping
)
->
m_bridge
;
static_cast
<
Mapping
const
*
>
(
mapping
)
->
m_bridge
;
JNI_guarded_context
jni
(
JNI_guarded_context
jni
(
bridge
->
m_jni_info
,
bridge
->
m_jni_info
,
(
static_cast
<
jni_uno
::
Context
*>
(
bridge
->
m_java_env
->
pContext
)
(
static_cast
<
jni_uno
::
JniUnoEnvironmentData
*>
(
bridge
->
m_java_env
->
pContext
)
->
machine
));
->
machine
));
JNI_interface_type_info
const
*
info
=
JNI_interface_type_info
const
*
info
=
...
@@ -234,7 +236,8 @@ Bridge::Bridge(
...
@@ -234,7 +236,8 @@ Bridge::Bridge(
{
{
// bootstrapping bridge jni_info
// bootstrapping bridge jni_info
m_jni_info
=
JNI_info
::
get_jni_info
(
m_jni_info
=
JNI_info
::
get_jni_info
(
static_cast
<
jni_uno
::
Context
*>
(
m_java_env
->
pContext
)
->
machine
);
static_cast
<
jni_uno
::
JniUnoEnvironmentData
*>
(
m_java_env
->
pContext
)
->
machine
);
assert
(
m_java_env
!=
0
);
assert
(
m_java_env
!=
0
);
assert
(
m_uno_env
!=
0
);
assert
(
m_uno_env
!=
0
);
...
@@ -412,17 +415,18 @@ using namespace ::jni_uno;
...
@@ -412,17 +415,18 @@ using namespace ::jni_uno;
extern
"C"
{
extern
"C"
{
void
SAL_CALL
java_env_dispose
(
uno_Environment
*
env
)
{
void
SAL_CALL
java_env_dispose
(
uno_Environment
*
env
)
{
jni_uno
::
Context
*
context
=
static_cast
<
jni_uno
::
Context
*>
(
env
->
pContext
);
auto
*
envData
=
static_cast
<
jni_uno
::
JniUnoEnvironmentData
*>
(
env
->
pContext
);
jobject
async
;
jobject
async
;
{
{
osl
::
MutexGuard
g
(
context
->
mutex
);
osl
::
MutexGuard
g
(
envData
->
mutex
);
async
=
context
->
asynchronousFinalizer
;
async
=
envData
->
asynchronousFinalizer
;
context
->
asynchronousFinalizer
=
nullptr
;
envData
->
asynchronousFinalizer
=
nullptr
;
}
}
if
(
async
!=
nullptr
)
{
if
(
async
!=
nullptr
)
{
try
{
try
{
jvmaccess
::
VirtualMachine
::
AttachGuard
g
(
jvmaccess
::
VirtualMachine
::
AttachGuard
g
(
context
->
machine
->
getVirtualMachine
());
envData
->
machine
->
getVirtualMachine
());
JNIEnv
*
jniEnv
=
g
.
getEnvironment
();
JNIEnv
*
jniEnv
=
g
.
getEnvironment
();
jclass
cl
=
jniEnv
->
FindClass
(
jclass
cl
=
jniEnv
->
FindClass
(
"com/sun/star/lib/util/AsynchronousFinalizer"
);
"com/sun/star/lib/util/AsynchronousFinalizer"
);
...
@@ -453,7 +457,7 @@ void SAL_CALL java_env_dispose(uno_Environment * env) {
...
@@ -453,7 +457,7 @@ void SAL_CALL java_env_dispose(uno_Environment * env) {
void
SAL_CALL
java_env_disposing
(
uno_Environment
*
env
)
{
void
SAL_CALL
java_env_disposing
(
uno_Environment
*
env
)
{
java_env_dispose
(
env
);
java_env_dispose
(
env
);
delete
static_cast
<
jni_uno
::
Context
*>
(
env
->
pContext
);
delete
static_cast
<
jni_uno
::
JniUnoEnvironmentData
*>
(
env
->
pContext
);
}
}
#ifdef DISABLE_DYNLOADING
#ifdef DISABLE_DYNLOADING
...
@@ -464,15 +468,15 @@ void SAL_CALL java_env_disposing(uno_Environment * env) {
...
@@ -464,15 +468,15 @@ void SAL_CALL java_env_disposing(uno_Environment * env) {
SAL_DLLPUBLIC_EXPORT
void
SAL_CALL
uno_initEnvironment
(
uno_Environment
*
java_env
)
SAL_DLLPUBLIC_EXPORT
void
SAL_CALL
uno_initEnvironment
(
uno_Environment
*
java_env
)
SAL_THROW_EXTERN_C
()
SAL_THROW_EXTERN_C
()
{
{
java_env
->
pContext
=
new
jni_uno
::
Context
(
auto
*
envData
=
new
jni_uno
::
JniUnoEnvironmentData
(
static_cast
<
jvmaccess
::
UnoVirtualMachine
*>
(
java_env
->
pContext
));
static_cast
<
jvmaccess
::
UnoVirtualMachine
*>
(
java_env
->
pContext
));
java_env
->
pContext
=
envData
;
java_env
->
dispose
=
java_env_dispose
;
java_env
->
dispose
=
java_env_dispose
;
java_env
->
environmentDisposing
=
java_env_disposing
;
java_env
->
environmentDisposing
=
java_env_disposing
;
java_env
->
pExtEnv
=
0
;
// no extended support
java_env
->
pExtEnv
=
0
;
// no extended support
try
{
try
{
jvmaccess
::
VirtualMachine
::
AttachGuard
g
(
jvmaccess
::
VirtualMachine
::
AttachGuard
g
(
static_cast
<
jni_uno
::
Context
*>
(
java_env
->
pContext
)
->
machine
envData
->
machine
->
getVirtualMachine
());
->
getVirtualMachine
());
JNIEnv
*
jniEnv
=
g
.
getEnvironment
();
JNIEnv
*
jniEnv
=
g
.
getEnvironment
();
jclass
cl
=
jniEnv
->
FindClass
(
jclass
cl
=
jniEnv
->
FindClass
(
"com/sun/star/lib/util/AsynchronousFinalizer"
);
"com/sun/star/lib/util/AsynchronousFinalizer"
);
...
@@ -499,9 +503,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_initEnvironment( uno_Environment * java_e
...
@@ -499,9 +503,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_initEnvironment( uno_Environment * java_e
SAL_WARN
(
"bridges"
,
"exception in NewGlobalRef"
);
SAL_WARN
(
"bridges"
,
"exception in NewGlobalRef"
);
//TODO: report failure
//TODO: report failure
}
else
{
}
else
{
(
static_cast
<
jni_uno
::
Context
*>
(
java_env
->
pContext
)
->
envData
->
asynchronousFinalizer
=
o
;
asynchronousFinalizer
)
=
o
;
}
}
}
}
}
}
...
...
bridges/source/jni_uno/jni_bridge.h
Dosyayı görüntüle @
f53bc689
...
@@ -36,8 +36,8 @@
...
@@ -36,8 +36,8 @@
namespace
jni_uno
namespace
jni_uno
{
{
struct
Context
:
boost
::
noncopyable
{
struct
JniUnoEnvironmentData
:
boost
::
noncopyable
{
explicit
Context
(
explicit
JniUnoEnvironmentData
(
rtl
::
Reference
<
jvmaccess
::
UnoVirtualMachine
>
const
&
theMachine
)
:
rtl
::
Reference
<
jvmaccess
::
UnoVirtualMachine
>
const
&
theMachine
)
:
machine
(
theMachine
),
asynchronousFinalizer
(
nullptr
)
machine
(
theMachine
),
asynchronousFinalizer
(
nullptr
)
{}
{}
...
...
bridges/source/jni_uno/jni_java2uno.cxx
Dosyayı görüntüle @
f53bc689
...
@@ -69,11 +69,11 @@ jobject Bridge::map_to_java(
...
@@ -69,11 +69,11 @@ jobject Bridge::map_to_java(
args2
[
4
].
l
=
info
->
m_type
;
args2
[
4
].
l
=
info
->
m_type
;
args2
[
5
].
l
=
jo_oid
.
get
();
args2
[
5
].
l
=
jo_oid
.
get
();
args2
[
6
].
l
=
info
->
m_proxy_ctor
;
args2
[
6
].
l
=
info
->
m_proxy_ctor
;
jni_uno
::
Context
*
context
=
static_cast
<
jni_uno
::
Context
*>
(
auto
*
envData
=
static_cast
<
jni_uno
::
JniUnoEnvironmentData
*>
(
m_java_env
->
pContext
);
m_java_env
->
pContext
);
{
{
osl
::
MutexGuard
g
(
context
->
mutex
);
osl
::
MutexGuard
g
(
envData
->
mutex
);
args2
[
7
].
l
=
context
->
asynchronousFinalizer
;
args2
[
7
].
l
=
envData
->
asynchronousFinalizer
;
}
}
jo_iface
=
jni
->
CallStaticObjectMethodA
(
jo_iface
=
jni
->
CallStaticObjectMethodA
(
m_jni_info
->
m_class_JNI_proxy
,
m_jni_info
->
m_class_JNI_proxy
,
...
@@ -379,8 +379,8 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call(
...
@@ -379,8 +379,8 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call(
JNI_context
jni
(
JNI_context
jni
(
jni_info
,
jni_env
,
jni_info
,
jni_env
,
static_cast
<
jobject
>
(
static_cast
<
jobject
>
(
static_cast
<
Context
*>
(
bridge
->
m_java_env
->
pContext
)
->
machine
static_cast
<
JniUnoEnvironmentData
*>
(
bridge
->
m_java_env
->
pContext
)
->
getClassLoader
()));
->
machine
->
getClassLoader
()));
OUString
method_name
;
OUString
method_name
;
...
@@ -626,8 +626,8 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_finalize__J(
...
@@ -626,8 +626,8 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_finalize__J(
JNI_context
jni
(
JNI_context
jni
(
jni_info
,
jni_env
,
jni_info
,
jni_env
,
static_cast
<
jobject
>
(
static_cast
<
jobject
>
(
static_cast
<
Context
*>
(
bridge
->
m_java_env
->
pContext
)
->
machine
static_cast
<
JniUnoEnvironmentData
*>
(
bridge
->
m_java_env
->
pContext
)
->
getClassLoader
()));
->
machine
->
getClassLoader
()));
uno_Interface
*
pUnoI
=
reinterpret_cast
<
uno_Interface
*
>
(
uno_Interface
*
pUnoI
=
reinterpret_cast
<
uno_Interface
*
>
(
jni
->
GetLongField
(
jni
->
GetLongField
(
...
...
bridges/source/jni_uno/jni_uno2java.cxx
Dosyayı görüntüle @
f53bc689
...
@@ -128,7 +128,8 @@ void Bridge::call_java(
...
@@ -128,7 +128,8 @@ void Bridge::call_java(
assert
(
function_pos_offset
==
0
||
function_pos_offset
==
1
);
assert
(
function_pos_offset
==
0
||
function_pos_offset
==
1
);
JNI_guarded_context
jni
(
JNI_guarded_context
jni
(
m_jni_info
,
static_cast
<
Context
*>
(
m_java_env
->
pContext
)
->
machine
);
m_jni_info
,
static_cast
<
JniUnoEnvironmentData
*>
(
m_java_env
->
pContext
)
->
machine
);
// assure fully initialized iface_td:
// assure fully initialized iface_td:
::
com
::
sun
::
star
::
uno
::
TypeDescription
iface_holder
;
::
com
::
sun
::
star
::
uno
::
TypeDescription
iface_holder
;
...
@@ -528,7 +529,8 @@ void SAL_CALL UNO_proxy_free( uno_ExtEnvironment * env, void * proxy )
...
@@ -528,7 +529,8 @@ void SAL_CALL UNO_proxy_free( uno_ExtEnvironment * env, void * proxy )
{
{
JNI_guarded_context
jni
(
JNI_guarded_context
jni
(
bridge
->
m_jni_info
,
bridge
->
m_jni_info
,
static_cast
<
Context
*>
(
bridge
->
m_java_env
->
pContext
)
->
machine
);
(
static_cast
<
JniUnoEnvironmentData
*>
(
bridge
->
m_java_env
->
pContext
)
->
machine
));
jni
->
DeleteGlobalRef
(
that
->
m_javaI
);
jni
->
DeleteGlobalRef
(
that
->
m_javaI
);
jni
->
DeleteGlobalRef
(
that
->
m_jo_oid
);
jni
->
DeleteGlobalRef
(
that
->
m_jo_oid
);
...
@@ -672,7 +674,8 @@ void SAL_CALL UNO_proxy_dispatch(
...
@@ -672,7 +674,8 @@ void SAL_CALL UNO_proxy_dispatch(
JNI_info
const
*
jni_info
=
bridge
->
m_jni_info
;
JNI_info
const
*
jni_info
=
bridge
->
m_jni_info
;
JNI_guarded_context
jni
(
JNI_guarded_context
jni
(
jni_info
,
jni_info
,
(
static_cast
<
Context
*>
(
bridge
->
m_java_env
->
pContext
)
(
static_cast
<
JniUnoEnvironmentData
*>
(
bridge
->
m_java_env
->
pContext
)
->
machine
));
->
machine
));
JNI_interface_type_info
const
*
info
=
JNI_interface_type_info
const
*
info
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment