| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // static | 61 // static |
| 62 PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask tex
tCheckingOptions, TextCheckingProcessType processType, PassRefPtrWillBeRawPtr<Ra
nge> checkingRange, PassRefPtrWillBeRawPtr<Range> paragraphRange, int requestNum
ber) | 62 PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask tex
tCheckingOptions, TextCheckingProcessType processType, PassRefPtrWillBeRawPtr<Ra
nge> checkingRange, PassRefPtrWillBeRawPtr<Range> paragraphRange, int requestNum
ber) |
| 63 { | 63 { |
| 64 ASSERT(checkingRange); | 64 ASSERT(checkingRange); |
| 65 ASSERT(paragraphRange); | 65 ASSERT(paragraphRange); |
| 66 | 66 |
| 67 String text = checkingRange->text(); | 67 String text = checkingRange->text(); |
| 68 if (!text.length()) | 68 if (!text.length()) |
| 69 return PassRefPtr<SpellCheckRequest>(); | 69 return PassRefPtr<SpellCheckRequest>(); |
| 70 | 70 |
| 71 const Vector<DocumentMarker*>& markers = checkingRange->ownerDocument().mark
ers().markersInRange(checkingRange.get(), DocumentMarker::SpellCheckClientMarker
s()); | 71 const WillBeHeapVector<DocumentMarker*>& markers = checkingRange->ownerDocum
ent().markers().markersInRange(checkingRange.get(), DocumentMarker::SpellCheckCl
ientMarkers()); |
| 72 Vector<uint32_t> hashes(markers.size()); | 72 Vector<uint32_t> hashes(markers.size()); |
| 73 Vector<unsigned> offsets(markers.size()); | 73 Vector<unsigned> offsets(markers.size()); |
| 74 for (size_t i = 0; i < markers.size(); i++) { | 74 for (size_t i = 0; i < markers.size(); i++) { |
| 75 hashes[i] = markers[i]->hash(); | 75 hashes[i] = markers[i]->hash(); |
| 76 offsets[i] = markers[i]->startOffset(); | 76 offsets[i] = markers[i]->startOffset(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 return adoptRef(new SpellCheckRequest(checkingRange, paragraphRange, text, t
extCheckingOptions, processType, hashes, offsets, requestNumber)); | 79 return adoptRef(new SpellCheckRequest(checkingRange, paragraphRange, text, t
extCheckingOptions, processType, hashes, offsets, requestNumber)); |
| 80 } | 80 } |
| 81 | 81 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 didCheck(sequence, results); | 257 didCheck(sequence, results); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void SpellCheckRequester::didCheckCancel(int sequence) | 260 void SpellCheckRequester::didCheckCancel(int sequence) |
| 261 { | 261 { |
| 262 Vector<TextCheckingResult> results; | 262 Vector<TextCheckingResult> results; |
| 263 didCheck(sequence, results); | 263 didCheck(sequence, results); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace WebCore | 266 } // namespace WebCore |
| OLD | NEW |