Changeset 148710 in webkit


Ignore:
Timestamp:
Apr 18, 2013, 3:45:32 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Invalidate spell checking requests in platform code
https://bugs.webkit.org/show_bug.cgi?id=114830

Patch by Nima Ghanavatian <nghanavatian@blackberry.com> on 2013-04-18
Reviewed by Rob Buis.

Internally reviewed by Mike Fenton.

Cache the value of the last requested sequence id at focus change.
All requests prior to this point will be rejected upon processing.

  • WebKitSupport/InputHandler.cpp:

(BlackBerry::WebKit::InputHandler::InputHandler):
(BlackBerry::WebKit::InputHandler::requestCheckingOfString):
(BlackBerry::WebKit::InputHandler::stopPendingSpellCheckRequests):

  • WebKitSupport/InputHandler.h:

(InputHandler):

Location:
trunk/Source/WebKit/blackberry
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/ChangeLog

    r148696 r148710  
     12013-04-18 Nima Ghanavatian <nghanavatian@blackberry.com>
     2
     3        [BlackBerry] Invalidate spell checking requests in platform code
     4        https://bugs.webkit.org/show_bug.cgi?id=114830
     5
     6        Reviewed by Rob Buis.
     7
     8        Internally reviewed by Mike Fenton.
     9
     10        Cache the value of the last requested sequence id at focus change.
     11        All requests prior to this point will be rejected upon processing.
     12
     13        * WebKitSupport/InputHandler.cpp:
     14        (BlackBerry::WebKit::InputHandler::InputHandler):
     15        (BlackBerry::WebKit::InputHandler::requestCheckingOfString):
     16        (BlackBerry::WebKit::InputHandler::stopPendingSpellCheckRequests):
     17        * WebKitSupport/InputHandler.h:
     18        (InputHandler):
     19
    1202013-04-17  Geoffrey Garen  <ggaren@apple.com>
    221
  • trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp

    r148677 r148710  
    155155    , m_spellCheckStatusConfirmed(false)
    156156    , m_globalSpellCheckStatus(false)
     157    , m_minimumSpellCheckingRequestSequence(-1)
    157158{
    158159}
     
    609610    }
    610611
     612    if (spellCheckRequest->data().sequence() <= m_minimumSpellCheckingRequestSequence) {
     613        SpellingLog(Platform::LogLevelWarn, "InputHandler::requestCheckingOfString rejecting stale request with sequenceId=%d. Sentinal currently at %d."
     614            , spellCheckRequest->data().sequence(), m_minimumSpellCheckingRequestSequence);
     615        spellCheckRequest->didCancel();
     616        return;
     617    }
     618
    611619    unsigned requestLength = spellCheckRequest->data().text().length();
    612620
     
    11721180    // Prevent response from propagating through
    11731181    m_processingTransactionId = 0;
    1174     // Clear the pending queue as well
    1175     if (m_request)
    1176         m_request->setCheckerAndSequence(getSpellChecker(), -1);
     1182    // Reject requests until lastRequestSequence. This helps us clear the queue of stale requests.
     1183    if (SpellChecker* spellChecker = getSpellChecker())
     1184        m_minimumSpellCheckingRequestSequence = spellChecker->lastRequestSequence();
    11771185}
    11781186
  • trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h

    r148575 r148710  
    265265    bool m_spellCheckStatusConfirmed;
    266266    bool m_globalSpellCheckStatus;
     267    int m_minimumSpellCheckingRequestSequence;
    267268
    268269    OwnPtr<WebCore::SuggestionBoxHandler> m_suggestionDropdownBoxHandler;
Note: See TracChangeset for help on using the changeset viewer.