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

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

Issue 289323003: Move markerlists to Oilpan heap and remove finalizer from DocumentMarkerController (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED Created 6 years, 7 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/core/editing/SpellCheckRequester.cpp ('k') | Source/core/page/EventHandler.cpp » ('j') | 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) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 } 803 }
804 804
805 bool SpellChecker::selectionStartHasMarkerFor(DocumentMarker::MarkerType markerT ype, int from, int length) const 805 bool SpellChecker::selectionStartHasMarkerFor(DocumentMarker::MarkerType markerT ype, int from, int length) const
806 { 806 {
807 Node* node = findFirstMarkable(m_frame.selection().start().deprecatedNode()) ; 807 Node* node = findFirstMarkable(m_frame.selection().start().deprecatedNode()) ;
808 if (!node) 808 if (!node)
809 return false; 809 return false;
810 810
811 unsigned startOffset = static_cast<unsigned>(from); 811 unsigned startOffset = static_cast<unsigned>(from);
812 unsigned endOffset = static_cast<unsigned>(from + length); 812 unsigned endOffset = static_cast<unsigned>(from + length);
813 Vector<DocumentMarker*> markers = m_frame.document()->markers().markersFor(n ode); 813 WillBeHeapVector<DocumentMarker*> markers = m_frame.document()->markers().ma rkersFor(node);
814 for (size_t i = 0; i < markers.size(); ++i) { 814 for (size_t i = 0; i < markers.size(); ++i) {
815 DocumentMarker* marker = markers[i]; 815 DocumentMarker* marker = markers[i];
816 if (marker->startOffset() <= startOffset && endOffset <= marker->endOffs et() && marker->type() == markerType) 816 if (marker->startOffset() <= startOffset && endOffset <= marker->endOffs et() && marker->type() == markerType)
817 return true; 817 return true;
818 } 818 }
819 819
820 return false; 820 return false;
821 } 821 }
822 822
823 TextCheckingTypeMask SpellChecker::resolveTextCheckingTypeMask(TextCheckingTypeM ask textCheckingOptions) 823 TextCheckingTypeMask SpellChecker::resolveTextCheckingTypeMask(TextCheckingTypeM ask textCheckingOptions)
(...skipping 21 matching lines...) Expand all
845 } 845 }
846 846
847 void SpellChecker::requestTextChecking(const Element& element) 847 void SpellChecker::requestTextChecking(const Element& element)
848 { 848 {
849 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element* >(&element)); 849 RefPtrWillBeRawPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element* >(&element));
850 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe ck, rangeToCheck)); 850 m_spellCheckRequester->requestCheckingFor(SpellCheckRequest::create(TextChec kingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToChe ck, rangeToCheck));
851 } 851 }
852 852
853 853
854 } // namespace WebCore 854 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/SpellCheckRequester.cpp ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698