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

Side by Side Diff: Source/core/editing/SpellChecker.cpp

Issue 19275006: Fix a use-after-free in spellcheck client (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/WebKit/chromium/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 const TextCheckingRequestData& SpellCheckRequest::data() const 83 const TextCheckingRequestData& SpellCheckRequest::data() const
84 { 84 {
85 return m_requestData; 85 return m_requestData;
86 } 86 }
87 87
88 void SpellCheckRequest::didSucceed(const Vector<TextCheckingResult>& results) 88 void SpellCheckRequest::didSucceed(const Vector<TextCheckingResult>& results)
89 { 89 {
90 if (!m_checker) 90 if (!m_checker)
91 return; 91 return;
92 m_checker->didCheckSucceed(m_requestData.sequence(), results); 92 SpellChecker* checker = m_checker;
93 m_checker = 0; 93 m_checker = 0;
94 checker->didCheckSucceed(m_requestData.sequence(), results);
94 } 95 }
95 96
96 void SpellCheckRequest::didCancel() 97 void SpellCheckRequest::didCancel()
97 { 98 {
98 if (!m_checker) 99 if (!m_checker)
99 return; 100 return;
100 m_checker->didCheckCancel(m_requestData.sequence()); 101 SpellChecker* checker = m_checker;
101 m_checker = 0; 102 m_checker = 0;
103 checker->didCheckCancel(m_requestData.sequence());
102 } 104 }
103 105
104 void SpellCheckRequest::setCheckerAndSequence(SpellChecker* requester, int seque nce) 106 void SpellCheckRequest::setCheckerAndSequence(SpellChecker* requester, int seque nce)
105 { 107 {
106 ASSERT(!m_checker); 108 ASSERT(!m_checker);
107 ASSERT(m_requestData.sequence() == unrequestedTextCheckingSequence); 109 ASSERT(m_requestData.sequence() == unrequestedTextCheckingSequence);
108 m_checker = requester; 110 m_checker = requester;
109 m_requestData.m_sequence = sequence; 111 m_requestData.m_sequence = sequence;
110 } 112 }
111 113
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 didCheck(sequence, results); 255 didCheck(sequence, results);
254 } 256 }
255 257
256 void SpellChecker::didCheckCancel(int sequence) 258 void SpellChecker::didCheckCancel(int sequence)
257 { 259 {
258 Vector<TextCheckingResult> results; 260 Vector<TextCheckingResult> results;
259 didCheck(sequence, results); 261 didCheck(sequence, results);
260 } 262 }
261 263
262 } // namespace WebCore 264 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698