Changeset 86132 in webkit
- Timestamp:
- May 10, 2011 12:46:51 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86131 r86132 1 2011-05-10 MORITA Hajime <morrita@google.com> 2 3 Reviewed by Ryosuke Niwa. 4 5 REGRESSION(r73886): Frequent crashes in replaceSelectionWithFragment 6 https://bugs.webkit.org/show_bug.cgi?id=60090 7 8 SpellChecker uses TextCheckerClient, which belongs Page object, 9 which is possibly destroyed during SpellChecker's lifetime. 10 This change added to a guard before using TextCheckerClient to 11 ensure it being live. 12 13 No new tests, this is a speculative fix for a real crash. 14 15 * editing/Editor.cpp: 16 (WebCore::Editor::Editor): 17 * editing/SpellChecker.cpp: 18 (WebCore::SpellChecker::SpellChecker): 19 (WebCore::SpellChecker::client): 20 (WebCore::SpellChecker::canCheckAsynchronously): 21 (WebCore::SpellChecker::requestCheckingFor): 22 * editing/SpellChecker.h: 23 1 24 2011-05-09 Dan Bernstein <mitz@apple.com> 2 25 -
trunk/Source/WebCore/editing/Editor.cpp
r85864 r86132 1053 1053 , m_shouldStyleWithCSS(false) 1054 1054 , m_killRing(adoptPtr(new KillRing)) 1055 , m_spellChecker(adoptPtr(new SpellChecker(frame , frame->page() ? frame->page()->editorClient()->textChecker() : 0)))1055 , m_spellChecker(adoptPtr(new SpellChecker(frame))) 1056 1056 , m_spellingCorrector(adoptPtr(new SpellingCorrectionController(frame))) 1057 1057 , m_areMarkedTextMatchesHighlighted(false) -
trunk/Source/WebCore/editing/SpellChecker.cpp
r82952 r86132 34 34 #include "HTMLTextAreaElement.h" 35 35 #include "Node.h" 36 #include "Page.h" 36 37 #include "PositionIterator.h" 37 38 #include "Range.h" … … 44 45 namespace WebCore { 45 46 46 SpellChecker::SpellChecker(Frame* frame , TextCheckerClient* client)47 SpellChecker::SpellChecker(Frame* frame) 47 48 : m_frame(frame) 48 , m_client(client)49 49 , m_requestSequence(0) 50 50 { … … 53 53 SpellChecker::~SpellChecker() 54 54 { 55 } 56 57 TextCheckerClient* SpellChecker::client() const 58 { 59 Page* page = m_frame->page(); 60 if (!page) 61 return 0; 62 return page->editorClient()->textChecker(); 55 63 } 56 64 … … 83 91 bool SpellChecker::canCheckAsynchronously(Node* node) const 84 92 { 85 return isCheckable(node) && isAsynchronousEnabled() && !isBusy();93 return client() && isCheckable(node) && isAsynchronousEnabled() && !isBusy(); 86 94 } 87 95 … … 107 115 if (!initRequest(node)) 108 116 return; 109 m_client->requestCheckingOfString(this, m_requestSequence, mask, m_requestText);117 client()->requestCheckingOfString(this, m_requestSequence, mask, m_requestText); 110 118 } 111 119 -
trunk/Source/WebCore/editing/SpellChecker.h
r82952 r86132 40 40 WTF_MAKE_NONCOPYABLE(SpellChecker); 41 41 public: 42 explicit SpellChecker(Frame* , TextCheckerClient*);42 explicit SpellChecker(Frame*); 43 43 ~SpellChecker(); 44 44 … … 54 54 bool initRequest(Node*); 55 55 void clearRequest(); 56 TextCheckerClient* client() const; 56 57 57 58 Frame* m_frame; 58 TextCheckerClient* m_client;59 59 60 60 RefPtr<Node> m_requestNode;
Note: See TracChangeset
for help on using the changeset viewer.