| OLD | NEW |
| 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * | 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
| 9 * | 9 * |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 if (!len) { | 401 if (!len) { |
| 402 // No new data has come in since the last call, just ignore this call. | 402 // No new data has come in since the last call, just ignore this call. |
| 403 return true; | 403 return true; |
| 404 } | 404 } |
| 405 | 405 |
| 406 if (len < m_bytesToConsume) | 406 if (len < m_bytesToConsume) |
| 407 return true; | 407 return true; |
| 408 | 408 |
| 409 blink::FastSharedBufferReader reader(m_data); | 409 blink::FastSharedBufferReader reader(m_data); |
| 410 | 410 |
| 411 // A read buffer of 16 bytes is enough to accomodate all possible reads for
parsing. | 411 // A read buffer of 16 bytes is enough to accommodate all possible reads for
parsing. |
| 412 char readBuffer[16]; | 412 char readBuffer[16]; |
| 413 | 413 |
| 414 // This loop reads as many components from |m_data| as possible. | 414 // This loop reads as many components from |m_data| as possible. |
| 415 // At the beginning of each iteration, dataPosition will be advanced by m_by
tesToConsume to | 415 // At the beginning of each iteration, dataPosition will be advanced by m_by
tesToConsume to |
| 416 // point to the next component. len will be decremented accordingly. | 416 // point to the next component. len will be decremented accordingly. |
| 417 while (len >= m_bytesToConsume) { | 417 while (len >= m_bytesToConsume) { |
| 418 const size_t currentComponentPosition = dataPosition; | 418 const size_t currentComponentPosition = dataPosition; |
| 419 | 419 |
| 420 // Mark the current component as consumed. Note that currentComponent wi
ll remain pointed at this | 420 // Mark the current component as consumed. Note that currentComponent wi
ll remain pointed at this |
| 421 // component until the next loop iteration. | 421 // component until the next loop iteration. |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 rowIter = rowBuffer.begin(); | 841 rowIter = rowBuffer.begin(); |
| 842 rowsRemaining = m_frameContext->height(); | 842 rowsRemaining = m_frameContext->height(); |
| 843 | 843 |
| 844 // Clearing the whole suffix table lets us be more tolerant of bad data. | 844 // Clearing the whole suffix table lets us be more tolerant of bad data. |
| 845 for (int i = 0; i < clearCode; ++i) { | 845 for (int i = 0; i < clearCode; ++i) { |
| 846 suffix[i] = i; | 846 suffix[i] = i; |
| 847 suffixLength[i] = 1; | 847 suffixLength[i] = 1; |
| 848 } | 848 } |
| 849 return true; | 849 return true; |
| 850 } | 850 } |
| OLD | NEW |