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 27 matching lines...) Expand all Loading... |
38 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
39 | 39 |
40 namespace blink { | 40 namespace blink { |
41 | 41 |
42 class LocalFrame; | 42 class LocalFrame; |
43 class SpellCheckRequester; | 43 class SpellCheckRequester; |
44 class TextCheckerClient; | 44 class TextCheckerClient; |
45 | 45 |
46 class SpellCheckRequest final : public TextCheckingRequest { | 46 class SpellCheckRequest final : public TextCheckingRequest { |
47 public: | 47 public: |
48 static SpellCheckRequest* create(TextCheckingProcessType, const EphemeralRan
ge& checkingRange, const EphemeralRange& paragraphRange, int requestNumber = 0); | 48 static SpellCheckRequest* create(TextCheckingProcessType, const EphemeralRan
ge& checkingRange, int requestNumber = 0); |
49 | 49 |
50 ~SpellCheckRequest() override; | 50 ~SpellCheckRequest() override; |
51 void dispose(); | 51 void dispose(); |
52 | 52 |
53 Range* checkingRange() const { return m_checkingRange; } | 53 Range* checkingRange() const { return m_checkingRange; } |
54 Range* paragraphRange() const { return m_paragraphRange; } | |
55 Element* rootEditableElement() const { return m_rootEditableElement; } | 54 Element* rootEditableElement() const { return m_rootEditableElement; } |
56 | 55 |
57 void setCheckerAndSequence(SpellCheckRequester*, int sequence); | 56 void setCheckerAndSequence(SpellCheckRequester*, int sequence); |
58 | 57 |
59 const TextCheckingRequestData& data() const override; | 58 const TextCheckingRequestData& data() const override; |
60 bool isValid() const; | 59 bool isValid() const; |
61 void didSucceed(const Vector<TextCheckingResult>&) override; | 60 void didSucceed(const Vector<TextCheckingResult>&) override; |
62 void didCancel() override; | 61 void didCancel() override; |
63 | 62 |
64 int requestNumber() const { return m_requestNumber; } | 63 int requestNumber() const { return m_requestNumber; } |
65 | 64 |
66 DECLARE_VIRTUAL_TRACE(); | 65 DECLARE_VIRTUAL_TRACE(); |
67 | 66 |
68 private: | 67 private: |
69 SpellCheckRequest(Range* checkingRange, Range* paragraphRange, const String&
, TextCheckingProcessType, const Vector<uint32_t>& documentMarkersInRange, const
Vector<unsigned>& documentMarkerOffsets, int requestNumber); | 68 SpellCheckRequest(Range* checkingRange, const String&, TextCheckingProcessTy
pe, const Vector<uint32_t>& documentMarkersInRange, const Vector<unsigned>& docu
mentMarkerOffsets, int requestNumber); |
70 | 69 |
71 Member<SpellCheckRequester> m_requester; | 70 Member<SpellCheckRequester> m_requester; |
72 Member<Range> m_checkingRange; | 71 Member<Range> m_checkingRange; |
73 Member<Range> m_paragraphRange; | |
74 Member<Element> m_rootEditableElement; | 72 Member<Element> m_rootEditableElement; |
75 TextCheckingRequestData m_requestData; | 73 TextCheckingRequestData m_requestData; |
76 int m_requestNumber; | 74 int m_requestNumber; |
77 }; | 75 }; |
78 | 76 |
79 class SpellCheckRequester final : public GarbageCollectedFinalized<SpellCheckReq
uester> { | 77 class SpellCheckRequester final : public GarbageCollectedFinalized<SpellCheckReq
uester> { |
80 WTF_MAKE_NONCOPYABLE(SpellCheckRequester); | 78 WTF_MAKE_NONCOPYABLE(SpellCheckRequester); |
81 public: | 79 public: |
82 static SpellCheckRequester* create(LocalFrame& frame) | 80 static SpellCheckRequester* create(LocalFrame& frame) |
83 { | 81 { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 131 |
134 Member<SpellCheckRequest> m_processingRequest; | 132 Member<SpellCheckRequest> m_processingRequest; |
135 | 133 |
136 typedef HeapDeque<Member<SpellCheckRequest>> RequestQueue; | 134 typedef HeapDeque<Member<SpellCheckRequest>> RequestQueue; |
137 RequestQueue m_requestQueue; | 135 RequestQueue m_requestQueue; |
138 }; | 136 }; |
139 | 137 |
140 } // namespace blink | 138 } // namespace blink |
141 | 139 |
142 #endif // SpellCheckRequester_h | 140 #endif // SpellCheckRequester_h |
OLD | NEW |