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

Side by Side Diff: Source/web/WebLocalFrameImpl.cpp

Issue 1041463003: Remove methods of TextIterator that take Range objects (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add assertions Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | Source/web/mac/WebSubstringUtil.mm » ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // Select the document body. 243 // Select the document body.
244 RefPtrWillBeRawPtr<Range> range(document->createRange()); 244 RefPtrWillBeRawPtr<Range> range(document->createRange());
245 TrackExceptionState exceptionState; 245 TrackExceptionState exceptionState;
246 range->selectNodeContents(document->body(), exceptionState); 246 range->selectNodeContents(document->body(), exceptionState);
247 247
248 if (!exceptionState.hadException()) { 248 if (!exceptionState.hadException()) {
249 // The text iterator will walk nodes giving us text. This is similar to 249 // The text iterator will walk nodes giving us text. This is similar to
250 // the plainText() function in core/editing/TextIterator.h, but we imple ment the maximum 250 // the plainText() function in core/editing/TextIterator.h, but we imple ment the maximum
251 // size and also copy the results directly into a wstring, avoiding the 251 // size and also copy the results directly into a wstring, avoiding the
252 // string conversion. 252 // string conversion.
253 for (TextIterator it(range.get()); !it.atEnd(); it.advance()) { 253 for (TextIterator it(range->startPosition(), range->endPosition()); !it. atEnd(); it.advance()) {
254 it.appendTextToStringBuilder(output, 0, maxChars - output.length()); 254 it.appendTextToStringBuilder(output, 0, maxChars - output.length());
255 if (output.length() >= maxChars) 255 if (output.length() >= maxChars)
256 return; // Filled up the buffer. 256 return; // Filled up the buffer.
257 } 257 }
258 } 258 }
259 259
260 // The separator between frames when the frames are converted to plain text. 260 // The separator between frames when the frames are converted to plain text.
261 const LChar frameSeparator[] = { '\n', '\n' }; 261 const LChar frameSeparator[] = { '\n', '\n' };
262 const size_t frameSeparatorLength = WTF_ARRAY_LENGTH(frameSeparator); 262 const size_t frameSeparatorLength = WTF_ARRAY_LENGTH(frameSeparator);
263 263
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 { 2085 {
2086 m_frameWidget = frameWidget; 2086 m_frameWidget = frameWidget;
2087 } 2087 }
2088 2088
2089 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const 2089 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const
2090 { 2090 {
2091 return m_frameWidget; 2091 return m_frameWidget;
2092 } 2092 }
2093 2093
2094 } // namespace blink 2094 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | Source/web/mac/WebSubstringUtil.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698