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

Side by Side Diff: Source/core/dom/DocumentMarkerController.cpp

Issue 235113002: Oilpan: Remove guardRef and guardDeref from TreeScope. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments. 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/DocumentMarkerController.h ('k') | Source/core/dom/DocumentTest.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 m_markers.remove(node); 353 m_markers.remove(node);
354 if (m_markers.isEmpty()) 354 if (m_markers.isEmpty())
355 m_possiblyExistingMarkerTypes = 0; 355 m_possiblyExistingMarkerTypes = 0;
356 } 356 }
357 357
358 // repaint the affected node 358 // repaint the affected node
359 if (docDirty && node->renderer()) 359 if (docDirty && node->renderer())
360 node->renderer()->repaint(); 360 node->renderer()->repaint();
361 } 361 }
362 362
363 // FIXME: Oilpan: Move DocumentMarkerController to the Oilpan heap and make
364 // the MarkerMap a weak collection instead of this explicit weak processing.
365 void DocumentMarkerController::clearWeakMembers(Visitor* visitor)
366 {
367 Vector<const Node*> deadNodes;
368 for (MarkerMap::iterator it = m_markers.begin(); it != m_markers.end(); ++it ) {
369 if (!visitor->isAlive(it->key))
370 deadNodes.append(it->key);
371 }
372 for (unsigned i = 0; i < deadNodes.size(); ++i)
373 removeMarkers(const_cast<Node*>(deadNodes[i]));
374 }
375
363 DocumentMarker* DocumentMarkerController::markerContainingPoint(const LayoutPoin t& point, DocumentMarker::MarkerType markerType) 376 DocumentMarker* DocumentMarkerController::markerContainingPoint(const LayoutPoin t& point, DocumentMarker::MarkerType markerType)
364 { 377 {
365 if (!possiblyHasMarkers(markerType)) 378 if (!possiblyHasMarkers(markerType))
366 return 0; 379 return 0;
367 ASSERT(!(m_markers.isEmpty())); 380 ASSERT(!(m_markers.isEmpty()));
368 381
369 // outer loop: process each node that contains any markers 382 // outer loop: process each node that contains any markers
370 MarkerMap::iterator end = m_markers.end(); 383 MarkerMap::iterator end = m_markers.end();
371 for (MarkerMap::iterator nodeIterator = m_markers.begin(); nodeIterator != e nd; ++nodeIterator) { 384 for (MarkerMap::iterator nodeIterator = m_markers.begin(); nodeIterator != e nd; ++nodeIterator) {
372 // inner loop; process each marker in this node 385 // inner loop; process each marker in this node
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 737
725 } // namespace WebCore 738 } // namespace WebCore
726 739
727 #ifndef NDEBUG 740 #ifndef NDEBUG
728 void showDocumentMarkers(const WebCore::DocumentMarkerController* controller) 741 void showDocumentMarkers(const WebCore::DocumentMarkerController* controller)
729 { 742 {
730 if (controller) 743 if (controller)
731 controller->showMarkers(); 744 controller->showMarkers();
732 } 745 }
733 #endif 746 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentMarkerController.h ('k') | Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698