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

Side by Side Diff: third_party/WebKit/Source/core/editing/SurroundingText.cpp

Issue 1865813002: Remove RawPtr from Source/web/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 BackwardsCharacterIterator backwardsIterator(firstPositionInNode(document->d ocumentElement()).parentAnchoredEquivalent(), startPosition, TextIteratorStopsOn FormControls); 82 BackwardsCharacterIterator backwardsIterator(firstPositionInNode(document->d ocumentElement()).parentAnchoredEquivalent(), startPosition, TextIteratorStopsOn FormControls);
83 if (!backwardsIterator.atEnd()) 83 if (!backwardsIterator.atEnd())
84 backwardsIterator.advance(halfMaxLength); 84 backwardsIterator.advance(halfMaxLength);
85 85
86 m_startOffsetInContent = Range::create(*document, backwardsIterator.endPosit ion(), startPosition)->text().length(); 86 m_startOffsetInContent = Range::create(*document, backwardsIterator.endPosit ion(), startPosition)->text().length();
87 m_endOffsetInContent = Range::create(*document, backwardsIterator.endPositio n(), endPosition)->text().length(); 87 m_endOffsetInContent = Range::create(*document, backwardsIterator.endPositio n(), endPosition)->text().length();
88 m_contentRange = Range::create(*document, backwardsIterator.endPosition(), f orwardRange.startPosition()); 88 m_contentRange = Range::create(*document, backwardsIterator.endPosition(), f orwardRange.startPosition());
89 ASSERT(m_contentRange); 89 ASSERT(m_contentRange);
90 } 90 }
91 91
92 RawPtr<Range> SurroundingText::rangeFromContentOffsets(unsigned startOffsetInCon tent, unsigned endOffsetInContent) 92 Range* SurroundingText::rangeFromContentOffsets(unsigned startOffsetInContent, u nsigned endOffsetInContent)
93 { 93 {
94 if (startOffsetInContent >= endOffsetInContent || endOffsetInContent > conte nt().length()) 94 if (startOffsetInContent >= endOffsetInContent || endOffsetInContent > conte nt().length())
95 return nullptr; 95 return nullptr;
96 96
97 CharacterIterator iterator(m_contentRange->startPosition(), m_contentRange-> endPosition()); 97 CharacterIterator iterator(m_contentRange->startPosition(), m_contentRange-> endPosition());
98 98
99 ASSERT(!iterator.atEnd()); 99 ASSERT(!iterator.atEnd());
100 iterator.advance(startOffsetInContent); 100 iterator.advance(startOffsetInContent);
101 101
102 Position start = iterator.startPosition(); 102 Position start = iterator.startPosition();
(...skipping 18 matching lines...) Expand all
121 { 121 {
122 return m_startOffsetInContent; 122 return m_startOffsetInContent;
123 } 123 }
124 124
125 unsigned SurroundingText::endOffsetInContent() const 125 unsigned SurroundingText::endOffsetInContent() const
126 { 126 {
127 return m_endOffsetInContent; 127 return m_endOffsetInContent;
128 } 128 }
129 129
130 } // namespace blink 130 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/SurroundingText.h ('k') | third_party/WebKit/Source/core/workers/WorkerObjectProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698