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

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

Issue 2740603003: Hide SpellCheckRequest from other classes in editing/spellcheck (Closed)
Patch Set: Created 3 years, 9 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 137
138 void SpellCheckRequester::timerFiredToProcessQueuedRequest(TimerBase*) { 138 void SpellCheckRequester::timerFiredToProcessQueuedRequest(TimerBase*) {
139 DCHECK(!m_requestQueue.isEmpty()); 139 DCHECK(!m_requestQueue.isEmpty());
140 if (m_requestQueue.isEmpty()) 140 if (m_requestQueue.isEmpty())
141 return; 141 return;
142 142
143 invokeRequest(m_requestQueue.takeFirst()); 143 invokeRequest(m_requestQueue.takeFirst());
144 } 144 }
145 145
146 void SpellCheckRequester::requestCheckingFor(SpellCheckRequest* request) { 146 void SpellCheckRequester::requestCheckingFor(const EphemeralRange& range) {
147 requestCheckingFor(range, 0);
148 }
149
150 void SpellCheckRequester::requestCheckingFor(const EphemeralRange& range,
151 int requestNum) {
152 SpellCheckRequest* request = SpellCheckRequest::create(range, requestNum);
yosin_UTC9 2017/03/09 01:28:15 nit: s/SpellCheckRequest*/SpellCheckRequest* const
Xiaocheng 2017/03/10 23:13:22 SpellCheckRequest::ctor checks if the range is nul
147 if (!request) 153 if (!request)
148 return; 154 return;
149 155
150 DCHECK_EQ(request->data().sequence(), unrequestedTextCheckingSequence); 156 DCHECK_EQ(request->data().sequence(), unrequestedTextCheckingSequence);
151 int sequence = ++m_lastRequestSequence; 157 int sequence = ++m_lastRequestSequence;
152 if (sequence == unrequestedTextCheckingSequence) 158 if (sequence == unrequestedTextCheckingSequence)
153 sequence = ++m_lastRequestSequence; 159 sequence = ++m_lastRequestSequence;
154 160
155 request->setCheckerAndSequence(this, sequence); 161 request->setCheckerAndSequence(this, sequence);
156 162
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 didCheck(sequence, results); 276 didCheck(sequence, results);
271 } 277 }
272 278
273 DEFINE_TRACE(SpellCheckRequester) { 279 DEFINE_TRACE(SpellCheckRequester) {
274 visitor->trace(m_frame); 280 visitor->trace(m_frame);
275 visitor->trace(m_processingRequest); 281 visitor->trace(m_processingRequest);
276 visitor->trace(m_requestQueue); 282 visitor->trace(m_requestQueue);
277 } 283 }
278 284
279 } // namespace blink 285 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698