diff options
author | Derek Sollenberger <djsollen@google.com> | 2010-02-22 16:56:41 -0500 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2010-02-23 09:41:53 -0500 |
commit | 15027de75d16455fd1e449b771fac8fd2cf88233 (patch) | |
tree | f4a2bb5abea8b9996ce8414039bc62e26785a02b /WebKit/android/plugins/PluginWidgetAndroid.cpp | |
parent | 1044e7fd4ebb61e6133d4f4dda69810e3af9da14 (diff) | |
download | external_webkit-15027de75d16455fd1e449b771fac8fd2cf88233.zip external_webkit-15027de75d16455fd1e449b771fac8fd2cf88233.tar.gz external_webkit-15027de75d16455fd1e449b771fac8fd2cf88233.tar.bz2 |
Added new logging messages and updated event logs with plugin execution time
Diffstat (limited to 'WebKit/android/plugins/PluginWidgetAndroid.cpp')
-rw-r--r-- | WebKit/android/plugins/PluginWidgetAndroid.cpp | 14 |
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 |