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

Side by Side Diff: Source/core/page/DragController.cpp

Issue 689103003: Prevent leak on completion of drop operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | 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, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Google Inc. 3 * Copyright (C) 2008 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 bool preventedDefault = false; 244 bool preventedDefault = false;
245 if (mainFrame->view()) { 245 if (mainFrame->view()) {
246 // Sending an event can result in the destruction of the view and pa rt. 246 // Sending an event can result in the destruction of the view and pa rt.
247 RefPtrWillBeRawPtr<DataTransfer> dataTransfer = createDraggingDataTr ansfer(DataTransferReadable, dragData); 247 RefPtrWillBeRawPtr<DataTransfer> dataTransfer = createDraggingDataTr ansfer(DataTransferReadable, dragData);
248 dataTransfer->setSourceOperation(dragData->draggingSourceOperationMa sk()); 248 dataTransfer->setSourceOperation(dragData->draggingSourceOperationMa sk());
249 preventedDefault = mainFrame->eventHandler().performDragAndDrop(crea teMouseEvent(dragData), dataTransfer.get()); 249 preventedDefault = mainFrame->eventHandler().performDragAndDrop(crea teMouseEvent(dragData), dataTransfer.get());
250 dataTransfer->setAccessPolicy(DataTransferNumb); // Invalidate clipb oard here for security 250 dataTransfer->setAccessPolicy(DataTransferNumb); // Invalidate clipb oard here for security
251 } 251 }
252 if (preventedDefault) { 252 if (preventedDefault) {
253 m_documentUnderMouse = nullptr; 253 m_documentUnderMouse = nullptr;
254 cancelDrag();
254 return true; 255 return true;
255 } 256 }
256 } 257 }
257 258
258 if ((m_dragDestinationAction & DragDestinationActionEdit) && concludeEditDra g(dragData)) { 259 if ((m_dragDestinationAction & DragDestinationActionEdit) && concludeEditDra g(dragData)) {
259 m_documentUnderMouse = nullptr; 260 m_documentUnderMouse = nullptr;
260 return true; 261 return true;
261 } 262 }
262 263
263 m_documentUnderMouse = nullptr; 264 m_documentUnderMouse = nullptr;
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 986
986 void DragController::trace(Visitor* visitor) 987 void DragController::trace(Visitor* visitor)
987 { 988 {
988 visitor->trace(m_page); 989 visitor->trace(m_page);
989 visitor->trace(m_documentUnderMouse); 990 visitor->trace(m_documentUnderMouse);
990 visitor->trace(m_dragInitiator); 991 visitor->trace(m_dragInitiator);
991 visitor->trace(m_fileInputElementUnderMouse); 992 visitor->trace(m_fileInputElementUnderMouse);
992 } 993 }
993 994
994 } // namespace blink 995 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698