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

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

Issue 224113002: Oilpan: move Range object to the oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use STACK_ALLOCATED() + incorporate ager's overview of macros in this area. Created 6 years, 8 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 19 matching lines...) Expand all
30 #include "core/dom/DocumentMarkerController.h" 30 #include "core/dom/DocumentMarkerController.h"
31 #include "core/dom/Node.h" 31 #include "core/dom/Node.h"
32 #include "core/editing/SpellChecker.h" 32 #include "core/editing/SpellChecker.h"
33 #include "core/frame/LocalFrame.h" 33 #include "core/frame/LocalFrame.h"
34 #include "core/frame/Settings.h" 34 #include "core/frame/Settings.h"
35 #include "platform/text/TextCheckerClient.h" 35 #include "platform/text/TextCheckerClient.h"
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 SpellCheckRequest::SpellCheckRequest( 39 SpellCheckRequest::SpellCheckRequest(
40 PassRefPtr<Range> checkingRange, 40 PassRefPtrWillBeRawPtr<Range> checkingRange,
41 PassRefPtr<Range> paragraphRange, 41 PassRefPtrWillBeRawPtr<Range> paragraphRange,
42 const String& text, 42 const String& text,
43 TextCheckingTypeMask mask, 43 TextCheckingTypeMask mask,
44 TextCheckingProcessType processType, 44 TextCheckingProcessType processType,
45 const Vector<uint32_t>& documentMarkersInRange, 45 const Vector<uint32_t>& documentMarkersInRange,
46 const Vector<unsigned>& documentMarkerOffsets, 46 const Vector<unsigned>& documentMarkerOffsets,
47 int requestNumber) 47 int requestNumber)
48 : m_requester(0) 48 : m_requester(0)
49 , m_checkingRange(checkingRange) 49 , m_checkingRange(checkingRange)
50 , m_paragraphRange(paragraphRange) 50 , m_paragraphRange(paragraphRange)
51 , m_rootEditableElement(m_checkingRange->startContainer()->rootEditableEleme nt()) 51 , m_rootEditableElement(m_checkingRange->startContainer()->rootEditableEleme nt())
52 , m_requestData(unrequestedTextCheckingSequence, text, mask, processType, do cumentMarkersInRange, documentMarkerOffsets) 52 , m_requestData(unrequestedTextCheckingSequence, text, mask, processType, do cumentMarkersInRange, documentMarkerOffsets)
53 , m_requestNumber(requestNumber) 53 , m_requestNumber(requestNumber)
54 { 54 {
55 } 55 }
56 56
57 SpellCheckRequest::~SpellCheckRequest() 57 SpellCheckRequest::~SpellCheckRequest()
58 { 58 {
59 } 59 }
60 60
61 // static 61 // static
62 PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask tex tCheckingOptions, TextCheckingProcessType processType, PassRefPtr<Range> checkin gRange, PassRefPtr<Range> paragraphRange, int requestNumber) 62 PassRefPtr<SpellCheckRequest> SpellCheckRequest::create(TextCheckingTypeMask tex tCheckingOptions, TextCheckingProcessType processType, PassRefPtrWillBeRawPtr<Ra nge> checkingRange, PassRefPtrWillBeRawPtr<Range> paragraphRange, int requestNum ber)
63 { 63 {
64 ASSERT(checkingRange); 64 ASSERT(checkingRange);
65 ASSERT(paragraphRange); 65 ASSERT(paragraphRange);
66 66
67 String text = checkingRange->text(); 67 String text = checkingRange->text();
68 if (!text.length()) 68 if (!text.length())
69 return PassRefPtr<SpellCheckRequest>(); 69 return PassRefPtr<SpellCheckRequest>();
70 70
71 const Vector<DocumentMarker*>& markers = checkingRange->ownerDocument().mark ers().markersInRange(checkingRange.get(), DocumentMarker::SpellCheckClientMarker s()); 71 const Vector<DocumentMarker*>& markers = checkingRange->ownerDocument().mark ers().markersInRange(checkingRange.get(), DocumentMarker::SpellCheckClientMarker s());
72 Vector<uint32_t> hashes(markers.size()); 72 Vector<uint32_t> hashes(markers.size());
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 didCheck(sequence, results); 257 didCheck(sequence, results);
258 } 258 }
259 259
260 void SpellCheckRequester::didCheckCancel(int sequence) 260 void SpellCheckRequester::didCheckCancel(int sequence)
261 { 261 {
262 Vector<TextCheckingResult> results; 262 Vector<TextCheckingResult> results;
263 didCheck(sequence, results); 263 didCheck(sequence, results);
264 } 264 }
265 265
266 } // namespace WebCore 266 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698