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

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 1329253002: WIP: prefer using EphemeralRange for SpellChecker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: introduce Range::dispose() Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index 5e2b49ed4ad94f60b53136cab1ed99bba2dc580d..95d8e8b4a3f668257ab97d29b6a002bc4de5b0e3 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -266,10 +266,13 @@ static void frameContentAsPlainText(size_t maxChars, LocalFrame* frame, StringBu
// string conversion.
for (TextIterator it(range->startPosition(), range->endPosition()); !it.atEnd(); it.advance()) {
it.text().appendTextToStringBuilder(output, 0, maxChars - output.length());
- if (output.length() >= maxChars)
+ if (output.length() >= maxChars) {
+ range->dispose();
yosin_UTC9 2015/09/10 01:58:39 Please introduce |ScopedRangeObject|, or better na
sof 2015/09/10 06:07:49 We have ScopedDisposal<T>, which is arguably more
return; // Filled up the buffer.
+ }
}
}
+ range->dispose();
// The separator between frames when the frames are converted to plain text.
const LChar frameSeparator[] = { '\n', '\n' };

Powered by Google App Engine
This is Rietveld 408576698