Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.h

Issue 1369713002: Avoid creating duplicate Range objects when handling misspellings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: push Range de-dup into SpellCheckRequester::create() Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef SpellCheckRequester_h 26 #ifndef SpellCheckRequester_h
27 #define SpellCheckRequester_h 27 #define SpellCheckRequester_h
28 28
29 #include "core/dom/Element.h" 29 #include "core/dom/Element.h"
30 #include "core/dom/Range.h" 30 #include "core/dom/Range.h"
31 #include "core/editing/EphemeralRange.h"
31 #include "platform/Timer.h" 32 #include "platform/Timer.h"
32 #include "platform/text/TextChecking.h" 33 #include "platform/text/TextChecking.h"
33 #include "wtf/Deque.h" 34 #include "wtf/Deque.h"
34 #include "wtf/Noncopyable.h" 35 #include "wtf/Noncopyable.h"
35 #include "wtf/RefPtr.h" 36 #include "wtf/RefPtr.h"
36 #include "wtf/Vector.h" 37 #include "wtf/Vector.h"
37 #include "wtf/text/WTFString.h" 38 #include "wtf/text/WTFString.h"
38 39
39 namespace blink { 40 namespace blink {
40 41
41 class LocalFrame; 42 class LocalFrame;
42 class SpellCheckRequester; 43 class SpellCheckRequester;
43 class TextCheckerClient; 44 class TextCheckerClient;
44 45
45 class SpellCheckRequest final : public TextCheckingRequest { 46 class SpellCheckRequest final : public TextCheckingRequest {
46 public: 47 public:
47 static PassRefPtrWillBeRawPtr<SpellCheckRequest> create(TextCheckingTypeMask , TextCheckingProcessType, PassRefPtrWillBeRawPtr<Range> checkingRange, PassRefP trWillBeRawPtr<Range> paragraphRange, int requestNumber = 0); 48 static PassRefPtrWillBeRawPtr<SpellCheckRequest> create(TextCheckingTypeMask , TextCheckingProcessType, const EphemeralRange& checkingRange, const EphemeralR ange& paragraphRange, int requestNumber = 0);
48 ~SpellCheckRequest() override; 49 ~SpellCheckRequest() override;
49 50
50 PassRefPtrWillBeRawPtr<Range> checkingRange() const { return m_checkingRange ; } 51 PassRefPtrWillBeRawPtr<Range> checkingRange() const { return m_checkingRange ; }
51 PassRefPtrWillBeRawPtr<Range> paragraphRange() const { return m_paragraphRan ge; } 52 PassRefPtrWillBeRawPtr<Range> paragraphRange() const { return m_paragraphRan ge; }
52 PassRefPtrWillBeRawPtr<Element> rootEditableElement() const { return m_rootE ditableElement; } 53 PassRefPtrWillBeRawPtr<Element> rootEditableElement() const { return m_rootE ditableElement; }
53 54
54 void setCheckerAndSequence(SpellCheckRequester*, int sequence); 55 void setCheckerAndSequence(SpellCheckRequester*, int sequence);
55 #if !ENABLE(OILPAN) 56 #if !ENABLE(OILPAN)
56 void requesterDestroyed(); 57 void requesterDestroyed();
57 #endif 58 #endif
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 133
133 RefPtrWillBeMember<SpellCheckRequest> m_processingRequest; 134 RefPtrWillBeMember<SpellCheckRequest> m_processingRequest;
134 135
135 typedef WillBeHeapDeque<RefPtrWillBeMember<SpellCheckRequest>> RequestQueue; 136 typedef WillBeHeapDeque<RefPtrWillBeMember<SpellCheckRequest>> RequestQueue;
136 RequestQueue m_requestQueue; 137 RequestQueue m_requestQueue;
137 }; 138 };
138 139
139 } // namespace blink 140 } // namespace blink
140 141
141 #endif // SpellCheckRequester_h 142 #endif // SpellCheckRequester_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698