| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // of array of triplets (pos1, pos1_end, pos2_end) describing list | 136 // of array of triplets (pos1, pos1_end, pos2_end) describing list |
| 137 // of diff chunks. | 137 // of diff chunks. |
| 138 static Handle<JSArray> CompareStrings(Handle<String> s1, | 138 static Handle<JSArray> CompareStrings(Handle<String> s1, |
| 139 Handle<String> s2); | 139 Handle<String> s2); |
| 140 }; | 140 }; |
| 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 | |
| 147 // Holds 2 arrays of some elements allowing to compare any pair of | 146 // Holds 2 arrays of some elements allowing to compare any pair of |
| 148 // element from the first array and element from the second array. | 147 // element from the first array and element from the second array. |
| 149 class Input { | 148 class Input { |
| 150 public: | 149 public: |
| 151 virtual int getLength1() = 0; | 150 virtual int GetLength1() = 0; |
| 152 virtual int getLength2() = 0; | 151 virtual int GetLength2() = 0; |
| 153 virtual bool equals(int index1, int index2) = 0; | 152 virtual bool Equals(int index1, int index2) = 0; |
| 154 | 153 |
| 155 protected: | 154 protected: |
| 156 virtual ~Input() {} | 155 virtual ~Input() {} |
| 157 }; | 156 }; |
| 158 | 157 |
| 159 // Receives compare result as a series of chunks. | 158 // Receives compare result as a series of chunks. |
| 160 class Output { | 159 class Output { |
| 161 public: | 160 public: |
| 162 // Puts another chunk in result list. Note that technically speaking | 161 // Puts another chunk in result list. Note that technically speaking |
| 163 // only 3 arguments actually needed with 4th being derivable. | 162 // only 3 arguments actually needed with 4th being derivable. |
| 164 virtual void AddChunk(int pos1, int pos2, int len1, int len2) = 0; | 163 virtual void AddChunk(int pos1, int pos2, int len1, int len2) = 0; |
| 165 | 164 |
| 166 protected: | 165 protected: |
| 167 virtual ~Output() {} | 166 virtual ~Output() {} |
| 168 }; | 167 }; |
| 169 | 168 |
| 170 // Finds the difference between 2 arrays of elements. | 169 // Finds the difference between 2 arrays of elements. |
| 171 static void CalculateDifference(Input* input, | 170 static void CalculateDifference(Input* input, |
| 172 Output* result_writer); | 171 Output* result_writer); |
| 173 }; | 172 }; |
| 174 | 173 |
| 175 #endif // ENABLE_DEBUGGER_SUPPORT | 174 #endif // ENABLE_DEBUGGER_SUPPORT |
| 176 | 175 |
| 177 | 176 |
| 178 } } // namespace v8::internal | 177 } } // namespace v8::internal |
| 179 | 178 |
| 180 #endif /* V*_LIVEEDIT_H_ */ | 179 #endif /* V*_LIVEEDIT_H_ */ |
| OLD | NEW |