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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 27 matching lines...) Expand all
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 PassRefPtrWillBeRawPtr<SpellCheckRequest> create(TextCheckingTypeMask , TextCheckingProcessType, const EphemeralRange& checkingRange, const EphemeralR ange& paragraphRange, int requestNumber = 0); 48 static RawPtr<SpellCheckRequest> create(TextCheckingTypeMask, TextCheckingPr ocessType, const EphemeralRange& checkingRange, const EphemeralRange& paragraphR ange, int requestNumber = 0);
49 49
50 ~SpellCheckRequest() override; 50 ~SpellCheckRequest() override;
51 void dispose(); 51 void dispose();
52 52
53 PassRefPtrWillBeRawPtr<Range> checkingRange() const { return m_checkingRange ; } 53 RawPtr<Range> checkingRange() const { return m_checkingRange; }
54 PassRefPtrWillBeRawPtr<Range> paragraphRange() const { return m_paragraphRan ge; } 54 RawPtr<Range> paragraphRange() const { return m_paragraphRange; }
55 PassRefPtrWillBeRawPtr<Element> rootEditableElement() const { return m_rootE ditableElement; } 55 RawPtr<Element> rootEditableElement() const { return m_rootEditableElement; }
56 56
57 void setCheckerAndSequence(SpellCheckRequester*, int sequence); 57 void setCheckerAndSequence(SpellCheckRequester*, int sequence);
58 #if !ENABLE(OILPAN) 58 #if !ENABLE(OILPAN)
59 void requesterDestroyed(); 59 void requesterDestroyed();
60 #endif 60 #endif
61 61
62 const TextCheckingRequestData& data() const override; 62 const TextCheckingRequestData& data() const override;
63 bool isValid() const; 63 bool isValid() const;
64 void didSucceed(const Vector<TextCheckingResult>&) override; 64 void didSucceed(const Vector<TextCheckingResult>&) override;
65 void didCancel() override; 65 void didCancel() override;
66 66
67 int requestNumber() const { return m_requestNumber; } 67 int requestNumber() const { return m_requestNumber; }
68 68
69 DECLARE_VIRTUAL_TRACE(); 69 DECLARE_VIRTUAL_TRACE();
70 70
71 private: 71 private:
72 SpellCheckRequest(PassRefPtrWillBeRawPtr<Range> checkingRange, PassRefPtrWil lBeRawPtr<Range> paragraphRange, const String&, TextCheckingTypeMask, TextChecki ngProcessType, const Vector<uint32_t>& documentMarkersInRange, const Vector<unsi gned>& documentMarkerOffsets, int requestNumber); 72 SpellCheckRequest(RawPtr<Range> checkingRange, RawPtr<Range> paragraphRange, const String&, TextCheckingTypeMask, TextCheckingProcessType, const Vector<uint 32_t>& documentMarkersInRange, const Vector<unsigned>& documentMarkerOffsets, in t requestNumber);
73 73
74 RawPtrWillBeMember<SpellCheckRequester> m_requester; 74 Member<SpellCheckRequester> m_requester;
75 RefPtrWillBeMember<Range> m_checkingRange; 75 Member<Range> m_checkingRange;
76 RefPtrWillBeMember<Range> m_paragraphRange; 76 Member<Range> m_paragraphRange;
77 RefPtrWillBeMember<Element> m_rootEditableElement; 77 Member<Element> m_rootEditableElement;
78 TextCheckingRequestData m_requestData; 78 TextCheckingRequestData m_requestData;
79 int m_requestNumber; 79 int m_requestNumber;
80 }; 80 };
81 81
82 class SpellCheckRequester final : public NoBaseWillBeGarbageCollectedFinalized<S pellCheckRequester> { 82 class SpellCheckRequester final : public GarbageCollectedFinalized<SpellCheckReq uester> {
83 WTF_MAKE_NONCOPYABLE(SpellCheckRequester); USING_FAST_MALLOC_WILL_BE_REMOVED (SpellCheckRequester); 83 WTF_MAKE_NONCOPYABLE(SpellCheckRequester);
84 public: 84 public:
85 static PassOwnPtrWillBeRawPtr<SpellCheckRequester> create(LocalFrame& frame) 85 static RawPtr<SpellCheckRequester> create(LocalFrame& frame)
86 { 86 {
87 return adoptPtrWillBeNoop(new SpellCheckRequester(frame)); 87 return (new SpellCheckRequester(frame));
88 } 88 }
89 89
90 ~SpellCheckRequester(); 90 ~SpellCheckRequester();
91 DECLARE_TRACE(); 91 DECLARE_TRACE();
92 92
93 bool isCheckable(Range*) const; 93 bool isCheckable(Range*) const;
94 94
95 void requestCheckingFor(PassRefPtrWillBeRawPtr<SpellCheckRequest>); 95 void requestCheckingFor(RawPtr<SpellCheckRequest>);
96 void cancelCheck(); 96 void cancelCheck();
97 97
98 int lastRequestSequence() const 98 int lastRequestSequence() const
99 { 99 {
100 return m_lastRequestSequence; 100 return m_lastRequestSequence;
101 } 101 }
102 102
103 int lastProcessedSequence() const 103 int lastProcessedSequence() const
104 { 104 {
105 return m_lastProcessedSequence; 105 return m_lastProcessedSequence;
106 } 106 }
107 107
108 private: 108 private:
109 friend class SpellCheckRequest; 109 friend class SpellCheckRequest;
110 110
111 explicit SpellCheckRequester(LocalFrame&); 111 explicit SpellCheckRequester(LocalFrame&);
112 112
113 bool canCheckAsynchronously(Range*) const; 113 bool canCheckAsynchronously(Range*) const;
114 TextCheckerClient& client() const; 114 TextCheckerClient& client() const;
115 void timerFiredToProcessQueuedRequest(Timer<SpellCheckRequester>*); 115 void timerFiredToProcessQueuedRequest(Timer<SpellCheckRequester>*);
116 void invokeRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest>); 116 void invokeRequest(RawPtr<SpellCheckRequest>);
117 void enqueueRequest(PassRefPtrWillBeRawPtr<SpellCheckRequest>); 117 void enqueueRequest(RawPtr<SpellCheckRequest>);
118 void didCheckSucceed(int sequence, const Vector<TextCheckingResult>&); 118 void didCheckSucceed(int sequence, const Vector<TextCheckingResult>&);
119 void didCheckCancel(int sequence); 119 void didCheckCancel(int sequence);
120 void didCheck(int sequence, const Vector<TextCheckingResult>&); 120 void didCheck(int sequence, const Vector<TextCheckingResult>&);
121 121
122 void clearProcessingRequest(); 122 void clearProcessingRequest();
123 123
124 RawPtrWillBeMember<LocalFrame> m_frame; 124 Member<LocalFrame> m_frame;
125 LocalFrame& frame() const 125 LocalFrame& frame() const
126 { 126 {
127 ASSERT(m_frame); 127 ASSERT(m_frame);
128 return *m_frame; 128 return *m_frame;
129 } 129 }
130 130
131 int m_lastRequestSequence; 131 int m_lastRequestSequence;
132 int m_lastProcessedSequence; 132 int m_lastProcessedSequence;
133 133
134 Timer<SpellCheckRequester> m_timerToProcessQueuedRequest; 134 Timer<SpellCheckRequester> m_timerToProcessQueuedRequest;
135 135
136 RefPtrWillBeMember<SpellCheckRequest> m_processingRequest; 136 Member<SpellCheckRequest> m_processingRequest;
137 137
138 typedef WillBeHeapDeque<RefPtrWillBeMember<SpellCheckRequest>> RequestQueue; 138 typedef HeapDeque<Member<SpellCheckRequest>> RequestQueue;
139 RequestQueue m_requestQueue; 139 RequestQueue m_requestQueue;
140 }; 140 };
141 141
142 } // namespace blink 142 } // namespace blink
143 143
144 #endif // SpellCheckRequester_h 144 #endif // SpellCheckRequester_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698