|
7 | 7 |
|
8 | 8 | #include "include/cef_web_plugin.h" |
9 | 9 |
|
| 10 | +namespace { |
| 11 | + |
| 12 | +CefRefPtr<CefWebPluginInfo> GetSelf(jlong self) { |
| 13 | + return reinterpret_cast<CefWebPluginInfo*>(self); |
| 14 | +} |
| 15 | + |
| 16 | +} // namespace |
| 17 | + |
10 | 18 | JNIEXPORT jstring JNICALL |
11 | | -Java_org_cef_network_CefWebPluginInfo_1N_N_1GetName(JNIEnv* env, jobject obj) { |
12 | | - CefRefPtr<CefWebPluginInfo> info = |
13 | | - GetCefFromJNIObject<CefWebPluginInfo>(env, obj, "CefWebPluginInfo"); |
14 | | - if (!info.get()) |
| 19 | +Java_org_cef_network_CefWebPluginInfo_1N_N_1GetName(JNIEnv* env, |
| 20 | + jobject obj, |
| 21 | + jlong self) { |
| 22 | + CefRefPtr<CefWebPluginInfo> info = GetSelf(self); |
| 23 | + if (!info) |
15 | 24 | return NULL; |
16 | 25 | return NewJNIString(env, info->GetName()); |
17 | 26 | } |
18 | 27 |
|
19 | 28 | JNIEXPORT jstring JNICALL |
20 | | -Java_org_cef_network_CefWebPluginInfo_1N_N_1GetPath(JNIEnv* env, jobject obj) { |
21 | | - CefRefPtr<CefWebPluginInfo> info = |
22 | | - GetCefFromJNIObject<CefWebPluginInfo>(env, obj, "CefWebPluginInfo"); |
23 | | - if (!info.get()) |
| 29 | +Java_org_cef_network_CefWebPluginInfo_1N_N_1GetPath(JNIEnv* env, |
| 30 | + jobject obj, |
| 31 | + jlong self) { |
| 32 | + CefRefPtr<CefWebPluginInfo> info = GetSelf(self); |
| 33 | + if (!info) |
24 | 34 | return NULL; |
25 | 35 | return NewJNIString(env, info->GetPath()); |
26 | 36 | } |
27 | 37 |
|
28 | 38 | JNIEXPORT jstring JNICALL |
29 | 39 | Java_org_cef_network_CefWebPluginInfo_1N_N_1GetVersion(JNIEnv* env, |
30 | | - jobject obj) { |
31 | | - CefRefPtr<CefWebPluginInfo> info = |
32 | | - GetCefFromJNIObject<CefWebPluginInfo>(env, obj, "CefWebPluginInfo"); |
33 | | - if (!info.get()) |
| 40 | + jobject obj, |
| 41 | + jlong self) { |
| 42 | + CefRefPtr<CefWebPluginInfo> info = GetSelf(self); |
| 43 | + if (!info) |
34 | 44 | return NULL; |
35 | 45 | return NewJNIString(env, info->GetVersion()); |
36 | 46 | } |
37 | 47 |
|
38 | 48 | JNIEXPORT jstring JNICALL |
39 | 49 | Java_org_cef_network_CefWebPluginInfo_1N_N_1GetDescription(JNIEnv* env, |
40 | | - jobject obj) { |
41 | | - CefRefPtr<CefWebPluginInfo> info = |
42 | | - GetCefFromJNIObject<CefWebPluginInfo>(env, obj, "CefWebPluginInfo"); |
43 | | - if (!info.get()) |
| 50 | + jobject obj, |
| 51 | + jlong self) { |
| 52 | + CefRefPtr<CefWebPluginInfo> info = GetSelf(self); |
| 53 | + if (!info) |
44 | 54 | return NULL; |
45 | 55 | return NewJNIString(env, info->GetDescription()); |
46 | 56 | } |
0 commit comments