summaryrefslogtreecommitdiffstats
path: root/WebCore/plugins/android/PluginViewAndroid.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-29 00:46:27 +0100
committerSteve Block <steveblock@google.com>2010-05-11 14:42:13 +0100
commitcb5893797cc223f846046c4bd0875a894edab5c0 (patch)
tree3bb351b69c8952d3696d758f12790c88d919d00e /WebCore/plugins/android/PluginViewAndroid.cpp
parent705137e4853511cb7ba5e05ea74aab69a4fea13b (diff)
downloadexternal_webkit-cb5893797cc223f846046c4bd0875a894edab5c0.zip
external_webkit-cb5893797cc223f846046c4bd0875a894edab5c0.tar.gz
external_webkit-cb5893797cc223f846046c4bd0875a894edab5c0.tar.bz2
Merge webkit.org at r58033 : Use new PluginView::platformGetValue() and platformStaticGetValue()
See http://trac.webkit.org/changeset/55432 Change-Id: I21b1185ce5a86d902c7a5de3f7866e82c6fe3ee8
Diffstat (limited to 'WebCore/plugins/android/PluginViewAndroid.cpp')
-rw-r--r--WebCore/plugins/android/PluginViewAndroid.cpp40
1 files changed, 25 insertions, 15 deletions
diff --git a/WebCore/plugins/android/PluginViewAndroid.cpp b/WebCore/plugins/android/PluginViewAndroid.cpp
index 8b606e8..51b41a2 100644
--- a/WebCore/plugins/android/PluginViewAndroid.cpp
+++ b/WebCore/plugins/android/PluginViewAndroid.cpp
@@ -363,31 +363,33 @@ NPError PluginView::handlePostReadFile(Vector<char>& buffer, uint32 len, const c
return NPERR_GENERIC_ERROR;
}
-NPError PluginView::getValueStatic(NPNVariable variable, void* value)
+bool PluginView::platformGetValueStatic(NPNVariable variable, void* value, NPError* result)
{
// our interface query is valid with no NPP instance
- NPError error = NPERR_GENERIC_ERROR;
+ *result = NPERR_GENERIC_ERROR;
switch (variable) {
case NPNVisOfflineBool: {
if (value != NULL) {
bool* retValue = static_cast<bool*>(value);
*retValue = !networkStateNotifier().onLine();
- return NPERR_NO_ERROR;
+ *result = NPERR_NO_ERROR;
+ return true;
}
break;
}
case kJavaContext_ANPGetValue: {
jobject* retObject = static_cast<jobject*>(value);
*retObject = android::WebViewCore::getApplicationContext();
- return NPERR_NO_ERROR;
+ *result = NPERR_NO_ERROR;
+ return true;
}
default:
; // do nothing
}
- (void)anp_getInterface(variable, value, &error);
- return error;
+ (void)anp_getInterface(variable, value, result);
+ return true;
}
void PluginView::setParent(ScrollView* parent)
@@ -452,7 +454,7 @@ void PluginView::setNPWindowIfNeeded()
m_window->setWindow(&m_npWindow, m_isTransparent);
}
-NPError PluginView::getValue(NPNVariable variable, void* value)
+bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* result)
{
switch (variable) {
case NPNVWindowNPObject: {
@@ -468,7 +470,8 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
void** v = (void**)value;
*v = windowScriptObject;
- return NPERR_NO_ERROR;
+ *result = NPERR_NO_ERROR;
+ return true;
}
case NPNVPluginElementNPObject: {
@@ -491,7 +494,8 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
void** v = (void**)value;
*v = pluginScriptObject;
- return NPERR_NO_ERROR;
+ *result = NPERR_NO_ERROR;
+ return true;
}
case NPNVnetscapeWindow: {
@@ -499,34 +503,40 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
// with this instance.
jobject *retObject = static_cast<jobject*>(value);
*retObject = android::WebViewCore::getWebViewCore(parent())->getWebViewJavaObject();
- return NPERR_NO_ERROR;
+ *result = NPERR_NO_ERROR;
+ return true;
}
case NPNVisOfflineBool: {
if (value == NULL) {
- return NPERR_GENERIC_ERROR;
+ *result = NPERR_GENERIC_ERROR;
+ return true;
}
bool* retValue = static_cast<bool*>(value);
*retValue = !networkStateNotifier().onLine();
- return NPERR_NO_ERROR;
+ *result = NPERR_NO_ERROR;
+ return true;
}
case kSupportedDrawingModel_ANPGetValue: {
uint32_t* bits = reinterpret_cast<uint32_t*>(value);
*bits = kBitmap_ANPDrawingModel & kSurface_ANPDrawingModel;
- return NPERR_NO_ERROR;
+ *result = NPERR_NO_ERROR;
+ return true;
}
case kJavaContext_ANPGetValue: {
jobject* retObject = static_cast<jobject*>(value);
*retObject = android::WebViewCore::getWebViewCore(parent())->getContext();
- return NPERR_NO_ERROR;
+ *result = NPERR_NO_ERROR;
+ return true;
}
default: {
NPError error = NPERR_GENERIC_ERROR;
(void)anp_getInterface(variable, value, &error);
- return error;
+ *result = error;
+ return true;
}
}
}