Title: [149674] trunk/Source/WebKit/blackberry
Revision
149674
Author
[email protected]
Date
2013-05-07 09:18:09 -0700 (Tue, 07 May 2013)

Log Message

[BlackBerry] Expand spellcheck logging
https://bugs.webkit.org/show_bug.cgi?id=115482

Patch by Nima Ghanavatian <[email protected]> on 2013-05-07
Reviewed by Rob Buis.

Internally reviewed by Mike Fenton.

Fix some build errors when SpellingLog was turned on and expand on the debug
statements to be more verbose. Set up timers and print the duration of each
iteration as we traverse the text to create a range to send out for checking.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::spellCheckingRequestCancelled):
(BlackBerry::WebKit::InputHandler::spellCheckingRequestProcessed):
(BlackBerry::WebKit::InputHandler::setElementFocused):
(WebKit):
(BlackBerry::WebKit::InputHandler::spellCheckTextBlock):
* WebKitSupport/SpellingHandler.cpp:
(BlackBerry::WebKit::SpellingHandler::spellCheckTextBlock):
(BlackBerry::WebKit::SpellingHandler::parseBlockForSpellChecking):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (149673 => 149674)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-05-07 16:01:51 UTC (rev 149673)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-05-07 16:18:09 UTC (rev 149674)
@@ -1,3 +1,26 @@
+2013-05-07  Nima Ghanavatian  <[email protected]>
+
+        [BlackBerry] Expand spellcheck logging
+        https://bugs.webkit.org/show_bug.cgi?id=115482
+
+        Reviewed by Rob Buis.
+
+        Internally reviewed by Mike Fenton.
+
+        Fix some build errors when SpellingLog was turned on and expand on the debug
+        statements to be more verbose. Set up timers and print the duration of each
+        iteration as we traverse the text to create a range to send out for checking.
+
+        * WebKitSupport/InputHandler.cpp:
+        (BlackBerry::WebKit::InputHandler::spellCheckingRequestCancelled):
+        (BlackBerry::WebKit::InputHandler::spellCheckingRequestProcessed):
+        (BlackBerry::WebKit::InputHandler::setElementFocused):
+        (WebKit):
+        (BlackBerry::WebKit::InputHandler::spellCheckTextBlock):
+        * WebKitSupport/SpellingHandler.cpp:
+        (BlackBerry::WebKit::SpellingHandler::spellCheckTextBlock):
+        (BlackBerry::WebKit::SpellingHandler::parseBlockForSpellChecking):
+
 2013-05-06  Mike Lattanzio  <[email protected]>
 
         [BlackBerry] Enable and Expose Text Autosizing through BlackBerry::WebKit::WebSettings

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp (149673 => 149674)


--- trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2013-05-07 16:01:51 UTC (rev 149673)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp	2013-05-07 16:18:09 UTC (rev 149674)
@@ -664,8 +664,12 @@
     m_request = spellCheckRequest;
 }
 
-void InputHandler::spellCheckingRequestProcessed(int32_t, spannable_string_t* spannableString)
+void InputHandler::spellCheckingRequestProcessed(int32_t transactionId, spannable_string_t* spannableString)
 {
+#if !ENABLE_SPELLING_LOG
+    UNUSED_PARAM(transactionId)
+#endif
+
     SpellingLog(Platform::LogLevelWarn,
         "InputHandler::spellCheckingRequestProcessed Expected transaction id %d, received %d. %s",
         m_processingTransactionId,
@@ -1043,7 +1047,7 @@
     ASSERT(DOMSupport::isTextBasedContentEditableElement(element));
     ASSERT(element && element->document() && element->document()->frame());
 
-#ifdef ENABLE_SPELLING_LOG
+#if ENABLE_SPELLING_LOG
     BlackBerry::Platform::StopWatch timer;
     timer.start();
 #endif
@@ -1109,20 +1113,22 @@
     if (!m_delayKeyboardVisibilityChange)
         notifyClientOfKeyboardVisibilityChange(true, true /* triggeredByFocusChange */);
 
-#ifdef ENABLE_SPELLING_LOG
+#if ENABLE_SPELLING_LOG
     SpellingLog(Platform::LogLevelInfo, "InputHandler::setElementFocused Focusing the field took %f seconds.", timer.elapsed());
 #endif
 
     // Spellcheck the field in its entirety.
     spellCheckTextBlock(element);
 
-#ifdef ENABLE_SPELLING_LOG
+#if ENABLE_SPELLING_LOG
     SpellingLog(Platform::LogLevelInfo, "InputHandler::setElementFocused Spellchecking the field increased the total time to focus to %f seconds.", timer.elapsed());
 #endif
 }
 
 void InputHandler::spellCheckTextBlock(Element* element)
 {
+    SpellingLog(Platform::LogLevelInfo, "InputHandler::spellCheckTextBlock");
+
     if (!element) {
         // Fall back to a valid focused element.
         if (!m_currentFocusElement)

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/SpellingHandler.cpp (149673 => 149674)


--- trunk/Source/WebKit/blackberry/WebKitSupport/SpellingHandler.cpp	2013-05-07 16:01:51 UTC (rev 149673)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/SpellingHandler.cpp	2013-05-07 16:18:09 UTC (rev 149674)
@@ -14,6 +14,7 @@
 
 #include <BlackBerryPlatformIMF.h>
 #include <BlackBerryPlatformLog.h>
+#include <BlackBerryPlatformStopWatch.h>
 
 #define ENABLE_SPELLING_LOG 0
 
@@ -78,6 +79,7 @@
     if (m_textCheckingProcessType == TextCheckingProcessBatch) {
         // If total block text is under the limited amount, send the entire chunk.
         if (rangeForSpellChecking->text().length() < MaxSpellCheckingStringLength) {
+            SpellingLog(Platform::LogLevelInfo, "SpellingHandler::spellCheckTextBlock creating single batch request");
             createSpellCheckRequest(rangeForSpellChecking);
             return;
         }
@@ -90,6 +92,7 @@
     m_endOfRange = visibleSelection.visibleEnd();
     m_cachedEndPosition = m_endOfRange;
 
+    SpellingLog(Platform::LogLevelInfo, "SpellingHandler::spellCheckTextBlock starting first iteration");
     m_iterationDelayTimer.startOneShot(0);
 }
 
@@ -110,6 +113,10 @@
 
 void SpellingHandler::parseBlockForSpellChecking(WebCore::Timer<SpellingHandler>*)
 {
+#if ENABLE_SPELLING_LOG
+    BlackBerry::Platform::StopWatch timer;
+    timer.start();
+#endif
     SpellingLog(Platform::LogLevelInfo, "SpellingHandler::parseBlockForSpellChecking m_startPosition = %d, m_endPosition = %d, m_cachedEndPosition = %d, m_endOfRange = %d"
         , DOMSupport::offsetFromStartOfBlock(m_startPosition)
         , DOMSupport::offsetFromStartOfBlock(m_endPosition)
@@ -133,6 +140,9 @@
         }
 
         incrementSentinels(false /* shouldIncrementStartPosition */);
+#if ENABLE_SPELLING_LOG
+        SpellingLog(Platform::LogLevelInfo, "SpellingHandler::parseBlockForSpellChecking spellcheck iteration took %lf seconds", timer.elapsed());
+#endif
         m_iterationDelayTimer.startOneShot(s_timeout);
         return;
     }
@@ -141,8 +151,12 @@
     if (rangeForSpellChecking = handleOversizedRange())
         createSpellCheckRequest(rangeForSpellChecking);
 
-    if (isSpellCheckActive())
+    if (isSpellCheckActive()) {
+#if ENABLE_SPELLING_LOG
+        SpellingLog(Platform::LogLevelInfo, "SpellingHandler::parseBlockForSpellChecking spellcheck iteration took %lf seconds", timer.elapsed());
+#endif
         m_iterationDelayTimer.startOneShot(s_timeout);
+    }
 }
 
 PassRefPtr<Range> SpellingHandler::handleOversizedRange()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to