summaryrefslogtreecommitdiffstats
path: root/WebKit/android/plugins/PluginWidgetAndroid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/android/plugins/PluginWidgetAndroid.cpp')
-rw-r--r--WebKit/android/plugins/PluginWidgetAndroid.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/WebKit/android/plugins/PluginWidgetAndroid.cpp b/WebKit/android/plugins/PluginWidgetAndroid.cpp
index 00f7165..182a1c4 100644
--- a/WebKit/android/plugins/PluginWidgetAndroid.cpp
+++ b/WebKit/android/plugins/PluginWidgetAndroid.cpp
@@ -35,10 +35,12 @@
#include "SkANP.h"
#include "SkFlipPixelRef.h"
#include "SkString.h"
+#include "SkTime.h"
#include "WebViewCore.h"
#include "jni_utility.h"
#define PLUGIN_DEBUG_LOCAL 0 // controls the printing of log messages
+#define DEBUG_EVENTS 0 // logs event contents, return value, and processing time
#define DEBUG_VISIBLE_RECTS 1 // temporary debug printfs and fixes
// this include statement must follow the declaration of PLUGIN_DEBUG_LOCAL
@@ -64,6 +66,7 @@ PluginWidgetAndroid::PluginWidgetAndroid(WebCore::PluginView* view)
}
PluginWidgetAndroid::~PluginWidgetAndroid() {
+ PLUGIN_LOG("%p Deleting Plugin", m_pluginView->instance());
m_acceptEvents = false;
if (m_core) {
m_core->removePlugin(this);
@@ -88,6 +91,7 @@ void PluginWidgetAndroid::init(android::WebViewCore* core) {
m_core = core;
m_core->addPlugin(this);
m_acceptEvents = true;
+ PLUGIN_LOG("%p Initialized Plugin", m_pluginView->instance());
}
static SkBitmap::Config computeConfig(bool isTransparent) {
@@ -236,11 +240,19 @@ int16 PluginWidgetAndroid::sendEvent(const ANPEvent& evt) {
m_hasFocus = true;
}
+#if DEBUG_EVENTS
+ SkMSec startTime = SkTime::GetMSecs();
+#endif
+
// make a localCopy since the actual plugin may not respect its constness,
// and so we don't want our caller to have its param modified
ANPEvent localCopy = evt;
int16 result = pkg->pluginFuncs()->event(instance, &localCopy);
- PLUGIN_LOG_EVENT(instance, &evt, result);
+
+#if DEBUG_EVENTS
+ SkMSec endTime = SkTime::GetMSecs();
+ PLUGIN_LOG_EVENT(instance, &evt, result, endTime - startTime);
+#endif
// if the plugin is losing focus then delay the update of our state
// until after we notify the plugin and allow them to perform actions