OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 if (index + size > m_fifoLength) { | 130 if (index + size > m_fifoLength) { |
131 // Need to wrap. Figure out the length of each piece. | 131 // Need to wrap. Figure out the length of each piece. |
132 part1Length = m_fifoLength - index; | 132 part1Length = m_fifoLength - index; |
133 part2Length = size - part1Length; | 133 part2Length = size - part1Length; |
134 } else { | 134 } else { |
135 // No wrap needed. | 135 // No wrap needed. |
136 part1Length = size; | 136 part1Length = size; |
137 part2Length = 0; | 137 part2Length = 0; |
138 } | 138 } |
139 } else { | 139 } else { |
140 // Invalid values for index or size. Set the part lengths to zero so nothing
is copied. | 140 // Invalid values for index or size. Set the part lengths to zero so nothing |
| 141 // is copied. |
141 part1Length = 0; | 142 part1Length = 0; |
142 part2Length = 0; | 143 part2Length = 0; |
143 } | 144 } |
144 } | 145 } |
145 | 146 |
146 } // namespace blink | 147 } // namespace blink |
OLD | NEW |