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

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

Issue 289273002: Oilpan: make DocumentFragment a heap allocated object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + add WillBeGarbageCollected FIXME. 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 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 29 matching lines...) Expand all
40 SelectReplacement = 1 << 0, 40 SelectReplacement = 1 << 0,
41 SmartReplace = 1 << 1, 41 SmartReplace = 1 << 1,
42 MatchStyle = 1 << 2, 42 MatchStyle = 1 << 2,
43 PreventNesting = 1 << 3, 43 PreventNesting = 1 << 3,
44 MovingParagraph = 1 << 4, 44 MovingParagraph = 1 << 4,
45 SanitizeFragment = 1 << 5 45 SanitizeFragment = 1 << 5
46 }; 46 };
47 47
48 typedef unsigned CommandOptions; 48 typedef unsigned CommandOptions;
49 49
50 static PassRefPtr<ReplaceSelectionCommand> create(Document& document, PassRe fPtr<DocumentFragment> fragment, CommandOptions options, EditAction action = Edi tActionPaste) 50 static PassRefPtr<ReplaceSelectionCommand> create(Document& document, PassRe fPtrWillBeRawPtr<DocumentFragment> fragment, CommandOptions options, EditAction action = EditActionPaste)
51 { 51 {
52 return adoptRef(new ReplaceSelectionCommand(document, fragment, options, action)); 52 return adoptRef(new ReplaceSelectionCommand(document, fragment, options, action));
53 } 53 }
54 54
55 private: 55 private:
56 ReplaceSelectionCommand(Document&, PassRefPtr<DocumentFragment>, CommandOpti ons, EditAction); 56 ReplaceSelectionCommand(Document&, PassRefPtrWillBeRawPtr<DocumentFragment>, CommandOptions, EditAction);
57 57
58 virtual void doApply() OVERRIDE; 58 virtual void doApply() OVERRIDE;
59 virtual EditAction editingAction() const OVERRIDE; 59 virtual EditAction editingAction() const OVERRIDE;
60 60
61 class InsertedNodes { 61 class InsertedNodes {
62 public: 62 public:
63 void respondToNodeInsertion(Node&); 63 void respondToNodeInsertion(Node&);
64 void willRemoveNodePreservingChildren(Node&); 64 void willRemoveNodePreservingChildren(Node&);
65 void willRemoveNode(Node&); 65 void willRemoveNode(Node&);
66 void didReplaceNode(Node&, Node& newNode); 66 void didReplaceNode(Node&, Node& newNode);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void mergeTextNodesAroundPosition(Position&, Position& positionOnlyToBeUpdat ed); 101 void mergeTextNodesAroundPosition(Position&, Position& positionOnlyToBeUpdat ed);
102 102
103 bool performTrivialReplace(const ReplacementFragment&); 103 bool performTrivialReplace(const ReplacementFragment&);
104 104
105 Position m_startOfInsertedContent; 105 Position m_startOfInsertedContent;
106 Position m_endOfInsertedContent; 106 Position m_endOfInsertedContent;
107 RefPtr<EditingStyle> m_insertionStyle; 107 RefPtr<EditingStyle> m_insertionStyle;
108 bool m_selectReplacement; 108 bool m_selectReplacement;
109 bool m_smartReplace; 109 bool m_smartReplace;
110 bool m_matchStyle; 110 bool m_matchStyle;
111 RefPtr<DocumentFragment> m_documentFragment; 111 RefPtrWillBePersistent<DocumentFragment> m_documentFragment;
112 bool m_preventNesting; 112 bool m_preventNesting;
113 bool m_movingParagraph; 113 bool m_movingParagraph;
114 EditAction m_editAction; 114 EditAction m_editAction;
115 bool m_sanitizeFragment; 115 bool m_sanitizeFragment;
116 bool m_shouldMergeEnd; 116 bool m_shouldMergeEnd;
117 }; 117 };
118 118
119 } // namespace WebCore 119 } // namespace WebCore
120 120
121 #endif // ReplaceSelectionCommand_h 121 #endif // ReplaceSelectionCommand_h
OLDNEW
« no previous file with comments | « Source/core/editing/MoveSelectionCommand.cpp ('k') | Source/core/editing/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698