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

Side by Side Diff: Source/core/editing/FrameSelection.h

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) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 void willBeModified(EAlteration, SelectionDirection); 140 void willBeModified(EAlteration, SelectionDirection);
141 141
142 bool isNone() const { return m_selection.isNone(); } 142 bool isNone() const { return m_selection.isNone(); }
143 bool isCaret() const { return m_selection.isCaret(); } 143 bool isCaret() const { return m_selection.isCaret(); }
144 bool isRange() const { return m_selection.isRange(); } 144 bool isRange() const { return m_selection.isRange(); }
145 bool isCaretOrRange() const { return m_selection.isCaretOrRange(); } 145 bool isCaretOrRange() const { return m_selection.isCaretOrRange(); }
146 bool isInPasswordField() const; 146 bool isInPasswordField() const;
147 147
148 // If this FrameSelection has a logical range which is still valid, this fun ction return its clone. Otherwise, 148 // If this FrameSelection has a logical range which is still valid, this fun ction return its clone. Otherwise,
149 // the return value from underlying VisibleSelection's firstRange() is retur ned. 149 // the return value from underlying VisibleSelection's firstRange() is retur ned.
150 PassRefPtr<Range> firstRange() const; 150 PassRefPtrWillBeRawPtr<Range> firstRange() const;
151 151
152 PassRefPtr<Range> toNormalizedRange() const { return m_selection.toNormalize dRange(); } 152 PassRefPtrWillBeRawPtr<Range> toNormalizedRange() const { return m_selection .toNormalizedRange(); }
153 153
154 void nodeWillBeRemoved(Node&); 154 void nodeWillBeRemoved(Node&);
155 void didUpdateCharacterData(CharacterData*, unsigned offset, unsigned oldLen gth, unsigned newLength); 155 void didUpdateCharacterData(CharacterData*, unsigned offset, unsigned oldLen gth, unsigned newLength);
156 void didMergeTextNodes(const Text& oldNode, unsigned offset); 156 void didMergeTextNodes(const Text& oldNode, unsigned offset);
157 void didSplitTextNode(const Text& oldNode); 157 void didSplitTextNode(const Text& oldNode);
158 158
159 void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisibl e ? Visible : Hidden); } 159 void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisibl e ? Visible : Hidden); }
160 bool recomputeCaretRect(); 160 bool recomputeCaretRect();
161 void invalidateCaretRect(); 161 void invalidateCaretRect();
162 void paintCaret(GraphicsContext*, const LayoutPoint&, const LayoutRect& clip Rect); 162 void paintCaret(GraphicsContext*, const LayoutPoint&, const LayoutRect& clip Rect);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 LayoutUnit m_xPosForVerticalArrowNavigation; 251 LayoutUnit m_xPosForVerticalArrowNavigation;
252 252
253 VisibleSelection m_selection; 253 VisibleSelection m_selection;
254 bool m_observingVisibleSelection; 254 bool m_observingVisibleSelection;
255 VisiblePosition m_originalBase; // Used to store base before the adjustment at bidi boundary 255 VisiblePosition m_originalBase; // Used to store base before the adjustment at bidi boundary
256 TextGranularity m_granularity; 256 TextGranularity m_granularity;
257 257
258 // The range specified by the user, which may not be visually canonicalized (hence "logical"). 258 // The range specified by the user, which may not be visually canonicalized (hence "logical").
259 // This will be invalidated if the underlying VisibleSelection changes. If t hat happens, this variable will 259 // This will be invalidated if the underlying VisibleSelection changes. If t hat happens, this variable will
260 // become null, in which case logical positions == visible positions. 260 // become null, in which case logical positions == visible positions.
261 RefPtr<Range> m_logicalRange; 261 RefPtrWillBePersistent<Range> m_logicalRange;
262 262
263 RefPtr<Node> m_previousCaretNode; // The last node which painted the caret. Retained for clearing the old caret when it moves. 263 RefPtr<Node> m_previousCaretNode; // The last node which painted the caret. Retained for clearing the old caret when it moves.
264 264
265 RefPtr<EditingStyle> m_typingStyle; 265 RefPtr<EditingStyle> m_typingStyle;
266 266
267 Timer<FrameSelection> m_caretBlinkTimer; 267 Timer<FrameSelection> m_caretBlinkTimer;
268 // The painted bounds of the caret in absolute coordinates 268 // The painted bounds of the caret in absolute coordinates
269 IntRect m_absCaretBounds; 269 IntRect m_absCaretBounds;
270 bool m_absCaretBoundsDirty : 1; 270 bool m_absCaretBoundsDirty : 1;
271 bool m_caretPaint : 1; 271 bool m_caretPaint : 1;
(...skipping 18 matching lines...) Expand all
290 } 290 }
291 } // namespace WebCore 291 } // namespace WebCore
292 292
293 #ifndef NDEBUG 293 #ifndef NDEBUG
294 // Outside the WebCore namespace for ease of invocation from gdb. 294 // Outside the WebCore namespace for ease of invocation from gdb.
295 void showTree(const WebCore::FrameSelection&); 295 void showTree(const WebCore::FrameSelection&);
296 void showTree(const WebCore::FrameSelection*); 296 void showTree(const WebCore::FrameSelection*);
297 #endif 297 #endif
298 298
299 #endif // FrameSelection_h 299 #endif // FrameSelection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698