| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 return; | 200 return; |
| 201 | 201 |
| 202 m_processingRequest->dispose(); | 202 m_processingRequest->dispose(); |
| 203 m_processingRequest.clear(); | 203 m_processingRequest.clear(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void SpellCheckRequester::enqueueRequest(SpellCheckRequest* request) { | 206 void SpellCheckRequester::enqueueRequest(SpellCheckRequest* request) { |
| 207 DCHECK(request); | 207 DCHECK(request); |
| 208 bool continuation = false; | 208 bool continuation = false; |
| 209 if (!m_requestQueue.isEmpty()) { | 209 if (!m_requestQueue.isEmpty()) { |
| 210 SpellCheckRequest* lastRequest = m_requestQueue.last(); | 210 SpellCheckRequest* lastRequest = m_requestQueue.back(); |
| 211 // It's a continuation if the number of the last request got incremented in | 211 // It's a continuation if the number of the last request got incremented in |
| 212 // the new one and both apply to the same editable. | 212 // the new one and both apply to the same editable. |
| 213 continuation = | 213 continuation = |
| 214 request->rootEditableElement() == lastRequest->rootEditableElement() && | 214 request->rootEditableElement() == lastRequest->rootEditableElement() && |
| 215 request->requestNumber() == lastRequest->requestNumber() + 1; | 215 request->requestNumber() == lastRequest->requestNumber() + 1; |
| 216 } | 216 } |
| 217 | 217 |
| 218 // Spellcheck requests for chunks of text in the same element should not | 218 // Spellcheck requests for chunks of text in the same element should not |
| 219 // overwrite each other. | 219 // overwrite each other. |
| 220 if (!continuation) { | 220 if (!continuation) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 didCheck(sequence, results); | 276 didCheck(sequence, results); |
| 277 } | 277 } |
| 278 | 278 |
| 279 DEFINE_TRACE(SpellCheckRequester) { | 279 DEFINE_TRACE(SpellCheckRequester) { |
| 280 visitor->trace(m_frame); | 280 visitor->trace(m_frame); |
| 281 visitor->trace(m_processingRequest); | 281 visitor->trace(m_processingRequest); |
| 282 visitor->trace(m_requestQueue); | 282 visitor->trace(m_requestQueue); |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace blink | 285 } // namespace blink |
| OLD | NEW |