summaryrefslogtreecommitdiffstats
path: root/WebCore/plugins/android
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2010-03-23 14:07:05 -0400
committerDerek Sollenberger <djsollen@google.com>2010-03-23 14:34:09 -0400
commit27a298a6476fbd78e67f35441e1428bc878a969d (patch)
treeca631f680e2bc3b4c0a8d54ec3b6c983d4c1c26c /WebCore/plugins/android
parent7d7e576868fe78bf1b95968ad5d6ddc395c65ec9 (diff)
downloadexternal_webkit-27a298a6476fbd78e67f35441e1428bc878a969d.zip
external_webkit-27a298a6476fbd78e67f35441e1428bc878a969d.tar.gz
external_webkit-27a298a6476fbd78e67f35441e1428bc878a969d.tar.bz2
Allowing native code access to the application context as long as
there is at least one valid instance of the webviewcore class. This change allows plugins access to the application context when the plugin package is loaded, prior to any instances of the plugin being created. Change-Id: I74a58cf76cc3c2d0ef7bca19346f13f58f616830
Diffstat (limited to 'WebCore/plugins/android')
-rw-r--r--WebCore/plugins/android/PluginViewAndroid.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/WebCore/plugins/android/PluginViewAndroid.cpp b/WebCore/plugins/android/PluginViewAndroid.cpp
index 5b7aea9..452c9fb 100644
--- a/WebCore/plugins/android/PluginViewAndroid.cpp
+++ b/WebCore/plugins/android/PluginViewAndroid.cpp
@@ -369,11 +369,22 @@ NPError PluginView::getValueStatic(NPNVariable variable, void* value)
{
// our interface query is valid with no NPP instance
NPError error = NPERR_GENERIC_ERROR;
- if ((value != NULL) && (variable == NPNVisOfflineBool)) {
- bool* retValue = static_cast<bool*>(value);
- *retValue = !networkStateNotifier().onLine();
- return NPERR_NO_ERROR;
+
+ switch (variable) {
+ case NPNVisOfflineBool: {
+ if (value != NULL) {
+ bool* retValue = static_cast<bool*>(value);
+ *retValue = !networkStateNotifier().onLine();
+ return NPERR_NO_ERROR;
+ }
+ }
+ case kJavaContext_ANPGetValue: {
+ jobject* retObject = static_cast<jobject*>(value);
+ *retObject = android::WebViewCore::getApplicationContext();
+ return NPERR_NO_ERROR;
+ }
}
+
(void)anp_getInterface(variable, value, &error);
return error;
}