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

Side by Side Diff: Source/core/page/DragData.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/page/DragData.h ('k') | Source/core/xml/XSLTProcessor.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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. 3 * Copyright (C) 2013 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 bool DragData::containsCompatibleContent() const 126 bool DragData::containsCompatibleContent() const
127 { 127 {
128 return containsPlainText() 128 return containsPlainText()
129 || containsURL() 129 || containsURL()
130 || containsHTML(m_platformDragData) 130 || containsHTML(m_platformDragData)
131 || containsFiles(); 131 || containsFiles();
132 } 132 }
133 133
134 PassRefPtr<DocumentFragment> DragData::asFragment(LocalFrame* frame, PassRefPtrW illBeRawPtr<Range>, bool, bool&) const 134 PassRefPtrWillBeRawPtr<DocumentFragment> DragData::asFragment(LocalFrame* frame, PassRefPtrWillBeRawPtr<Range>, bool, bool&) const
135 { 135 {
136 /* 136 /*
137 * Order is richest format first. On OSX this is: 137 * Order is richest format first. On OSX this is:
138 * * Web Archive 138 * * Web Archive
139 * * Filenames 139 * * Filenames
140 * * HTML 140 * * HTML
141 * * RTF 141 * * RTF
142 * * TIFF 142 * * TIFF
143 * * PICT 143 * * PICT
144 */ 144 */
145 145
146 if (containsFiles()) { 146 if (containsFiles()) {
147 // FIXME: Implement this. Should be pretty simple to make some HTML 147 // FIXME: Implement this. Should be pretty simple to make some HTML
148 // and call createFragmentFromMarkup. 148 // and call createFragmentFromMarkup.
149 } 149 }
150 150
151 if (m_platformDragData->types().contains(mimeTypeTextHTML)) { 151 if (m_platformDragData->types().contains(mimeTypeTextHTML)) {
152 String html; 152 String html;
153 KURL baseURL; 153 KURL baseURL;
154 m_platformDragData->htmlAndBaseURL(html, baseURL); 154 m_platformDragData->htmlAndBaseURL(html, baseURL);
155 ASSERT(frame->document()); 155 ASSERT(frame->document());
156 if (RefPtr<DocumentFragment> fragment = createFragmentFromMarkup(*frame- >document(), html, baseURL, DisallowScriptingAndPluginContent)) 156 if (RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentFromMa rkup(*frame->document(), html, baseURL, DisallowScriptingAndPluginContent))
157 return fragment.release(); 157 return fragment.release();
158 } 158 }
159 159
160 return nullptr; 160 return nullptr;
161 } 161 }
162 162
163 String DragData::droppedFileSystemId() const 163 String DragData::droppedFileSystemId() const
164 { 164 {
165 return m_platformDragData->filesystemId(); 165 return m_platformDragData->filesystemId();
166 } 166 }
167 167
168 } // namespace WebCore 168 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/DragData.h ('k') | Source/core/xml/XSLTProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698