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

Side by Side Diff: Source/core/frame/SmartClip.h

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Back out non-Oilpan experiment + tidy up by adding frame() ref accessors Created 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef SmartClip_h 31 #ifndef SmartClip_h
32 #define SmartClip_h 32 #define SmartClip_h
33 33
34 #include "core/dom/Node.h" 34 #include "core/dom/Node.h"
35 #include "core/frame/LocalFrame.h" 35 #include "core/frame/LocalFrame.h"
36 #include "platform/heap/Handle.h"
36 37
37 namespace blink { 38 namespace blink {
38 39
39 class SmartClipData { 40 class SmartClipData {
40 public: 41 public:
41 SmartClipData() 42 SmartClipData()
42 : m_isEmpty(true) 43 : m_isEmpty(true)
43 { 44 {
44 } 45 }
45 46
(...skipping 12 matching lines...) Expand all
58 IntRect m_rect; 59 IntRect m_rect;
59 String m_string; 60 String m_string;
60 }; 61 };
61 62
62 // SmartClip implements support for the copy operation 63 // SmartClip implements support for the copy operation
63 // with an S-Pen on Samsung devices. The behavior of this 64 // with an S-Pen on Samsung devices. The behavior of this
64 // class is quirky and poorly tested. It's approximately 65 // class is quirky and poorly tested. It's approximately
65 // trying to do a poor-mans implementation of columnar 66 // trying to do a poor-mans implementation of columnar
66 // selection followed by a copy operation. 67 // selection followed by a copy operation.
67 class SmartClip { 68 class SmartClip {
69 STACK_ALLOCATED();
68 public: 70 public:
69 explicit SmartClip(PassRefPtr<LocalFrame>); 71 explicit SmartClip(PassRefPtrWillBeRawPtr<LocalFrame>);
70 72
71 SmartClipData dataForRect(const IntRect&); 73 SmartClipData dataForRect(const IntRect&);
72 74
73 private: 75 private:
74 float pageScaleFactor(); 76 float pageScaleFactor();
75 77
76 Node* minNodeContainsNodes(Node* minNode, Node* newNode); 78 Node* minNodeContainsNodes(Node* minNode, Node* newNode);
77 Node* findBestOverlappingNode(Node*, const IntRect& cropRect); 79 Node* findBestOverlappingNode(Node*, const IntRect& cropRect);
78 bool shouldSkipBackgroundImage(Node*); 80 bool shouldSkipBackgroundImage(Node*);
79 void collectOverlappingChildNodes(Node* parentNode, const IntRect& cropRect, WillBeHeapVector<RawPtrWillBeMember<Node> >& overlappingNodeInfoTable); 81 void collectOverlappingChildNodes(Node* parentNode, const IntRect& cropRect, WillBeHeapVector<RawPtrWillBeMember<Node> >& overlappingNodeInfoTable);
80 IntRect convertRectToWindow(const IntRect& nodeRect); 82 IntRect convertRectToWindow(const IntRect& nodeRect);
81 String extractTextFromNode(Node*); 83 String extractTextFromNode(Node*);
82 84
83 RefPtr<LocalFrame> m_frame; 85 RefPtrWillBeMember<LocalFrame> m_frame;
84 }; 86 };
85 87
86 } // namespace blink 88 } // namespace blink
87 89
88 #endif // SmartClip_h 90 #endif // SmartClip_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698