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

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

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
« no previous file with comments | « Source/core/editing/Editor.cpp ('k') | Source/core/editing/MoveSelectionCommand.h » ('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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2009 Igalia S.L. 4 * Copyright (C) 2009 Igalia S.L.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 return true; 184 return true;
185 case CommandFromDOM: 185 case CommandFromDOM:
186 case CommandFromDOMWithUserInterface: 186 case CommandFromDOMWithUserInterface:
187 frame.editor().applyParagraphStyle(style.get()); 187 frame.editor().applyParagraphStyle(style.get());
188 return true; 188 return true;
189 } 189 }
190 ASSERT_NOT_REACHED(); 190 ASSERT_NOT_REACHED();
191 return false; 191 return false;
192 } 192 }
193 193
194 static bool executeInsertFragment(LocalFrame& frame, PassRefPtr<DocumentFragment > fragment) 194 static bool executeInsertFragment(LocalFrame& frame, PassRefPtrWillBeRawPtr<Docu mentFragment> fragment)
195 { 195 {
196 ASSERT(frame.document()); 196 ASSERT(frame.document());
197 ReplaceSelectionCommand::create(*frame.document(), fragment, ReplaceSelectio nCommand::PreventNesting, EditActionUnspecified)->apply(); 197 ReplaceSelectionCommand::create(*frame.document(), fragment, ReplaceSelectio nCommand::PreventNesting, EditActionUnspecified)->apply();
198 return true; 198 return true;
199 } 199 }
200 200
201 static bool executeInsertNode(LocalFrame& frame, PassRefPtr<Node> content) 201 static bool executeInsertNode(LocalFrame& frame, PassRefPtr<Node> content)
202 { 202 {
203 ASSERT(frame.document()); 203 ASSERT(frame.document());
204 RefPtr<DocumentFragment> fragment = DocumentFragment::create(*frame.document ()); 204 RefPtrWillBeRawPtr<DocumentFragment> fragment = DocumentFragment::create(*fr ame.document());
205 TrackExceptionState exceptionState; 205 TrackExceptionState exceptionState;
206 fragment->appendChild(content, exceptionState); 206 fragment->appendChild(content, exceptionState);
207 if (exceptionState.hadException()) 207 if (exceptionState.hadException())
208 return false; 208 return false;
209 return executeInsertFragment(frame, fragment.release()); 209 return executeInsertFragment(frame, fragment.release());
210 } 210 }
211 211
212 static bool expandSelectionToGranularity(LocalFrame& frame, TextGranularity gran ularity) 212 static bool expandSelectionToGranularity(LocalFrame& frame, TextGranularity gran ularity)
213 { 213 {
214 VisibleSelection selection = frame.selection().selection(); 214 VisibleSelection selection = frame.selection().selection();
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1734 { 1734 {
1735 return m_command && m_command->isTextInsertion; 1735 return m_command && m_command->isTextInsertion;
1736 } 1736 }
1737 1737
1738 int Editor::Command::idForHistogram() const 1738 int Editor::Command::idForHistogram() const
1739 { 1739 {
1740 return isSupported() ? m_command->idForUserMetrics : 0; 1740 return isSupported() ? m_command->idForUserMetrics : 0;
1741 } 1741 }
1742 1742
1743 } // namespace WebCore 1743 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/Editor.cpp ('k') | Source/core/editing/MoveSelectionCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698