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

Side by Side Diff: Source/core/editing/CompositeEditCommand.cpp

Issue 289323003: Move markerlists to Oilpan heap and remove finalizer from DocumentMarkerController (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED Created 6 years, 7 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/RenderedDocumentMarker.h ('k') | Source/core/editing/SpellCheckRequester.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) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 Position end = endingSelection().end(); 481 Position end = endingSelection().end();
482 if (start.containerNode() != end.containerNode() || !start.containerNode()-> isTextNode() || isTabSpanTextNode(start.containerNode())) 482 if (start.containerNode() != end.containerNode() || !start.containerNode()-> isTextNode() || isTabSpanTextNode(start.containerNode()))
483 return Position(); 483 return Position();
484 484
485 RefPtrWillBeRawPtr<Text> textNode = start.containerText(); 485 RefPtrWillBeRawPtr<Text> textNode = start.containerText();
486 replaceTextInNode(textNode, start.offsetInContainerNode(), end.offsetInConta inerNode() - start.offsetInContainerNode(), text); 486 replaceTextInNode(textNode, start.offsetInContainerNode(), end.offsetInConta inerNode() - start.offsetInContainerNode(), text);
487 487
488 return Position(textNode.release(), start.offsetInContainerNode() + text.len gth()); 488 return Position(textNode.release(), start.offsetInContainerNode() + text.len gth());
489 } 489 }
490 490
491 static void copyMarkers(const Vector<DocumentMarker*>& markerPointers, Vector<Do cumentMarker>& markers) 491 static void copyMarkers(const WillBeHeapVector<DocumentMarker*>& markerPointers, Vector<DocumentMarker>& markers)
492 { 492 {
493 size_t arraySize = markerPointers.size(); 493 size_t arraySize = markerPointers.size();
494 markers.reserveCapacity(arraySize); 494 markers.reserveCapacity(arraySize);
495 for (size_t i = 0; i < arraySize; ++i) 495 for (size_t i = 0; i < arraySize; ++i)
496 markers.append(*markerPointers[i]); 496 markers.append(*markerPointers[i]);
497 } 497 }
498 498
499 void CompositeEditCommand::replaceTextInNodePreservingMarkers(PassRefPtrWillBeRa wPtr<Text> prpNode, unsigned offset, unsigned count, const String& replacementTe xt) 499 void CompositeEditCommand::replaceTextInNodePreservingMarkers(PassRefPtrWillBeRa wPtr<Text> prpNode, unsigned offset, unsigned count, const String& replacementTe xt)
500 { 500 {
501 RefPtrWillBeRawPtr<Text> node(prpNode); 501 RefPtrWillBeRawPtr<Text> node(prpNode);
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 1468
1469 return node.release(); 1469 return node.release();
1470 } 1470 }
1471 1471
1472 PassRefPtrWillBeRawPtr<Element> createBlockPlaceholderElement(Document& document ) 1472 PassRefPtrWillBeRawPtr<Element> createBlockPlaceholderElement(Document& document )
1473 { 1473 {
1474 return document.createElement(brTag, false); 1474 return document.createElement(brTag, false);
1475 } 1475 }
1476 1476
1477 } // namespace WebCore 1477 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/RenderedDocumentMarker.h ('k') | Source/core/editing/SpellCheckRequester.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698