OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 struct Checkpoint { | 62 struct Checkpoint { |
63 Checkpoint(const SegmentedString& i, size_t n, size_t t) | 63 Checkpoint(const SegmentedString& i, size_t n, size_t t) |
64 : input(i), | 64 : input(i), |
65 numberOfSegmentsAlreadyAppended(n), | 65 numberOfSegmentsAlreadyAppended(n), |
66 tokensExtractedSincePreviousCheckpoint(t) {} | 66 tokensExtractedSincePreviousCheckpoint(t) {} |
67 | 67 |
68 SegmentedString input; | 68 SegmentedString input; |
69 size_t numberOfSegmentsAlreadyAppended; | 69 size_t numberOfSegmentsAlreadyAppended; |
70 size_t tokensExtractedSincePreviousCheckpoint; | 70 size_t tokensExtractedSincePreviousCheckpoint; |
71 | 71 |
72 #if ENABLE(ASSERT) | 72 #if DCHECK_IS_ON() |
73 bool isNull() const { | 73 bool isNull() const { |
74 return input.isEmpty() && !numberOfSegmentsAlreadyAppended; | 74 return input.isEmpty() && !numberOfSegmentsAlreadyAppended; |
75 } | 75 } |
76 #endif | 76 #endif |
77 void clear() { | 77 void clear() { |
78 input.clear(); | 78 input.clear(); |
79 numberOfSegmentsAlreadyAppended = 0; | 79 numberOfSegmentsAlreadyAppended = 0; |
80 tokensExtractedSincePreviousCheckpoint = 0; | 80 tokensExtractedSincePreviousCheckpoint = 0; |
81 } | 81 } |
82 }; | 82 }; |
83 | 83 |
84 SegmentedString m_current; | 84 SegmentedString m_current; |
85 Vector<String> m_segments; | 85 Vector<String> m_segments; |
86 Vector<Checkpoint> m_checkpoints; | 86 Vector<Checkpoint> m_checkpoints; |
87 | 87 |
88 // Note: These indicies may === vector.size(), in which case there are no | 88 // Note: These indicies may === vector.size(), in which case there are no |
89 // valid checkpoints/segments at this time. | 89 // valid checkpoints/segments at this time. |
90 size_t m_firstValidCheckpointIndex; | 90 size_t m_firstValidCheckpointIndex; |
91 size_t m_firstValidSegmentIndex; | 91 size_t m_firstValidSegmentIndex; |
92 size_t m_totalCheckpointTokenCount; | 92 size_t m_totalCheckpointTokenCount; |
93 | 93 |
94 void updateTotalCheckpointTokenCount(); | 94 void updateTotalCheckpointTokenCount(); |
95 }; | 95 }; |
96 | 96 |
97 } // namespace blink | 97 } // namespace blink |
98 | 98 |
99 #endif // BackgroundHTMLInputStream_h | 99 #endif // BackgroundHTMLInputStream_h |
OLD | NEW |