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

Side by Side Diff: Source/core/frame/LocalFrame.cpp

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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 return 0; 297 return 0;
298 298
299 IntPoint pt = view()->windowToContents(point); 299 IntPoint pt = view()->windowToContents(point);
300 HitTestResult result = HitTestResult(pt); 300 HitTestResult result = HitTestResult(pt);
301 301
302 if (contentRenderer()) 302 if (contentRenderer())
303 result = eventHandler().hitTestResultAtPoint(pt, HitTestRequest::ReadOnl y | HitTestRequest::Active | HitTestRequest::ConfusingAndOftenMisusedDisallowSha dowContent); 303 result = eventHandler().hitTestResultAtPoint(pt, HitTestRequest::ReadOnl y | HitTestRequest::Active | HitTestRequest::ConfusingAndOftenMisusedDisallowSha dowContent);
304 return result.innerNode() ? &result.innerNode()->document() : 0; 304 return result.innerNode() ? &result.innerNode()->document() : 0;
305 } 305 }
306 306
307 PassRefPtr<Range> LocalFrame::rangeForPoint(const IntPoint& framePoint) 307 PassRefPtrWillBeRawPtr<Range> LocalFrame::rangeForPoint(const IntPoint& framePoi nt)
308 { 308 {
309 VisiblePosition position = visiblePositionForPoint(framePoint); 309 VisiblePosition position = visiblePositionForPoint(framePoint);
310 if (position.isNull()) 310 if (position.isNull())
311 return nullptr; 311 return nullptr;
312 312
313 VisiblePosition previous = position.previous(); 313 VisiblePosition previous = position.previous();
314 if (previous.isNotNull()) { 314 if (previous.isNotNull()) {
315 RefPtr<Range> previousCharacterRange = makeRange(previous, position); 315 RefPtrWillBeRawPtr<Range> previousCharacterRange = makeRange(previous, p osition);
316 LayoutRect rect = editor().firstRectForRange(previousCharacterRange.get( )); 316 LayoutRect rect = editor().firstRectForRange(previousCharacterRange.get( ));
317 if (rect.contains(framePoint)) 317 if (rect.contains(framePoint))
318 return previousCharacterRange.release(); 318 return previousCharacterRange.release();
319 } 319 }
320 320
321 VisiblePosition next = position.next(); 321 VisiblePosition next = position.next();
322 if (RefPtr<Range> nextCharacterRange = makeRange(position, next)) { 322 if (RefPtrWillBeRawPtr<Range> nextCharacterRange = makeRange(position, next) ) {
323 LayoutRect rect = editor().firstRectForRange(nextCharacterRange.get()); 323 LayoutRect rect = editor().firstRectForRange(nextCharacterRange.get());
324 if (rect.contains(framePoint)) 324 if (rect.contains(framePoint))
325 return nextCharacterRange.release(); 325 return nextCharacterRange.release();
326 } 326 }
327 327
328 return nullptr; 328 return nullptr;
329 } 329 }
330 330
331 void LocalFrame::createView(const IntSize& viewportSize, const Color& background Color, bool transparent, 331 void LocalFrame::createView(const IntSize& viewportSize, const Color& background Color, bool transparent,
332 ScrollbarMode horizontalScrollbarMode, bool horizontalLock, 332 ScrollbarMode horizontalScrollbarMode, bool horizontalLock,
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 { 594 {
595 if (!m_host) 595 if (!m_host)
596 return 0; 596 return 0;
597 597
598 double ratio = m_host->deviceScaleFactor(); 598 double ratio = m_host->deviceScaleFactor();
599 ratio *= pageZoomFactor(); 599 ratio *= pageZoomFactor();
600 return ratio; 600 return ratio;
601 } 601 }
602 602
603 } // namespace WebCore 603 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698