| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 segment_index_ = 0; | 99 segment_index_ = 0; |
| 100 buffer_position_ += segment_length_; | 100 buffer_position_ += segment_length_; |
| 101 segment_length_ = buffer_->GetSomeData(segment_, buffer_position_); | 101 segment_length_ = buffer_->GetSomeData(segment_, buffer_position_); |
| 102 if (!segment_length_) { | 102 if (!segment_length_) { |
| 103 reached_end_of_file_ = true; | 103 reached_end_of_file_ = true; |
| 104 if (separator_index_ > 0) | 104 if (separator_index_ > 0) |
| 105 chunk.Append(separator_.data(), separator_index_); | 105 chunk.Append(separator_.data(), separator_index_); |
| 106 return !chunk.IsEmpty(); | 106 return !chunk.IsEmpty(); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 ASSERT_NOT_REACHED(); | 109 NOTREACHED(); |
| 110 return false; | 110 return false; |
| 111 } | 111 } |
| 112 | 112 |
| 113 String SharedBufferChunkReader::NextChunkAsUTF8StringWithLatin1Fallback( | 113 String SharedBufferChunkReader::NextChunkAsUTF8StringWithLatin1Fallback( |
| 114 bool include_separator) { | 114 bool include_separator) { |
| 115 Vector<char> data; | 115 Vector<char> data; |
| 116 if (!NextChunk(data, include_separator)) | 116 if (!NextChunk(data, include_separator)) |
| 117 return String(); | 117 return String(); |
| 118 | 118 |
| 119 return data.size() | 119 return data.size() |
| (...skipping 22 matching lines...) Expand all Loading... |
| 142 break; | 142 break; |
| 143 } | 143 } |
| 144 data.Append(segment, segment_length); | 144 data.Append(segment, segment_length); |
| 145 read_bytes_count += segment_length; | 145 read_bytes_count += segment_length; |
| 146 buffer_position += segment_length; | 146 buffer_position += segment_length; |
| 147 } | 147 } |
| 148 return read_bytes_count; | 148 return read_bytes_count; |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace blink | 151 } // namespace blink |
| OLD | NEW |