| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Apple 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 unsigned offset = 0; | 105 unsigned offset = 0; |
| 106 unsigned end = fragmentString.length(); | 106 unsigned end = fragmentString.length(); |
| 107 while (offset < end) { | 107 while (offset < end) { |
| 108 // http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/#pr
ocessing-name-value-components | 108 // http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/#pr
ocessing-name-value-components |
| 109 // 1. Parse the octet string according to the namevalues syntax, yieldin
g a list of | 109 // 1. Parse the octet string according to the namevalues syntax, yieldin
g a list of |
| 110 // name-value pairs, where name and value are both octet string. In a
ccordance | 110 // name-value pairs, where name and value are both octet string. In a
ccordance |
| 111 // with RFC 3986, the name and value components must be parsed and se
parated before | 111 // with RFC 3986, the name and value components must be parsed and se
parated before |
| 112 // percent-encoded octets are decoded. | 112 // percent-encoded octets are decoded. |
| 113 size_t parameterStart = offset; | 113 size_t parameterStart = offset; |
| 114 size_t parameterEnd = fragmentString.find('&', offset); | 114 size_t parameterEnd = fragmentString.find('&', offset); |
| 115 if (parameterEnd == notFound) | 115 if (parameterEnd == kNotFound) |
| 116 parameterEnd = end; | 116 parameterEnd = end; |
| 117 | 117 |
| 118 size_t equalOffset = fragmentString.find('=', offset); | 118 size_t equalOffset = fragmentString.find('=', offset); |
| 119 if (equalOffset == notFound || equalOffset > parameterEnd) { | 119 if (equalOffset == kNotFound || equalOffset > parameterEnd) { |
| 120 offset = parameterEnd + 1; | 120 offset = parameterEnd + 1; |
| 121 continue; | 121 continue; |
| 122 } | 122 } |
| 123 | 123 |
| 124 // 2. For each name-value pair: | 124 // 2. For each name-value pair: |
| 125 // a. Decode percent-encoded octets in name and value as defined by RFC
3986. If either | 125 // a. Decode percent-encoded octets in name and value as defined by RFC
3986. If either |
| 126 // name or value are not valid percent-encoded strings, then remove
the name-value pair | 126 // name or value are not valid percent-encoded strings, then remove
the name-value pair |
| 127 // from the list. | 127 // from the list. |
| 128 String name = decodeURLEscapeSequences(fragmentString.substring(paramete
rStart, equalOffset - parameterStart)); | 128 String name = decodeURLEscapeSequences(fragmentString.substring(paramete
rStart, equalOffset - parameterStart)); |
| 129 String value; | 129 String value; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 } | 310 } |
| 311 | 311 |
| 312 if (offset < length && timeString[offset] == '.') | 312 if (offset < length && timeString[offset] == '.') |
| 313 fraction = collectFraction(timeString, length, offset).toDouble(); | 313 fraction = collectFraction(timeString, length, offset).toDouble(); |
| 314 | 314 |
| 315 time = (value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 + fr
action; | 315 time = (value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 + fr
action; |
| 316 return true; | 316 return true; |
| 317 } | 317 } |
| 318 | 318 |
| 319 } | 319 } |
| OLD | NEW |