OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 | 142 |
143 // A general-purpose comparator between 2 arrays. | 143 // A general-purpose comparator between 2 arrays. |
144 class Comparator { | 144 class Comparator { |
145 public: | 145 public: |
146 | 146 |
147 // Holds 2 arrays of some elements allowing to compare any pair of | 147 // Holds 2 arrays of some elements allowing to compare any pair of |
148 // element from the first array and element from the second array. | 148 // element from the first array and element from the second array. |
149 class Input { | 149 class Input { |
150 public: | 150 public: |
151 virtual int getLength1() = 0; | 151 virtual int GetLength1() = 0; |
152 virtual int getLength2() = 0; | 152 virtual int GetLength2() = 0; |
153 virtual bool equals(int index1, int index2) = 0; | 153 virtual bool Equals(int index1, int index2) = 0; |
154 | 154 |
155 protected: | 155 protected: |
156 virtual ~Input() {} | 156 virtual ~Input() {} |
157 }; | 157 }; |
158 | 158 |
159 // Receives compare result as a series of chunks. | 159 // Receives compare result as a series of chunks. |
160 class Output { | 160 class Output { |
161 public: | 161 public: |
162 // Puts another chunk in result list. Note that technically speaking | 162 // Puts another chunk in result list. Note that technically speaking |
163 // only 3 arguments actually needed with 4th being derivable. | 163 // only 3 arguments actually needed with 4th being derivable. |
164 virtual void AddChunk(int pos1, int pos2, int len1, int len2) = 0; | 164 virtual void AddChunk(int pos1, int pos2, int len1, int len2) = 0; |
165 | 165 |
166 protected: | 166 protected: |
167 virtual ~Output() {} | 167 virtual ~Output() {} |
168 }; | 168 }; |
169 | 169 |
170 // Finds the difference between 2 arrays of elements. | 170 // Finds the difference between 2 arrays of elements. |
171 static void CalculateDifference(Input* input, | 171 static void CalculateDifference(Input* input, |
172 Output* result_writer); | 172 Output* result_writer); |
173 }; | 173 }; |
174 | 174 |
175 #endif // ENABLE_DEBUGGER_SUPPORT | 175 #endif // ENABLE_DEBUGGER_SUPPORT |
176 | 176 |
177 | 177 |
178 } } // namespace v8::internal | 178 } } // namespace v8::internal |
179 | 179 |
180 #endif /* V*_LIVEEDIT_H_ */ | 180 #endif /* V*_LIVEEDIT_H_ */ |
OLD | NEW |