diff options
author | feldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-21 04:23:53 +0000 |
---|---|---|
committer | feldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-21 04:23:53 +0000 |
commit | 8674a2cb7df6f22523fd985aadbcca1748e9d5f3 (patch) | |
tree | 86dd0cf6bbb948286502ca9925ceaf8cc8a0c79b /chrome/browser/extensions/extension_bookmark_manager_api.cc | |
parent | 66aaff10039f3dcd006985191799a13191ef91c9 (diff) | |
download | chromium_src-8674a2cb7df6f22523fd985aadbcca1748e9d5f3.zip chromium_src-8674a2cb7df6f22523fd985aadbcca1748e9d5f3.tar.gz chromium_src-8674a2cb7df6f22523fd985aadbcca1748e9d5f3.tar.bz2 |
Fix crash in bookmark manager dropping code
Right now whenever you drag bookmarks into the bookmark manager, the extension
code tells it there is new dragData via bookmarkManager.onDragEnter. This data
sticks around and is never cleared for various reasons, and when you drop random
text onto "Other bookmarks" the JS thinks it has valid drag data, but the data
in the actual dragging clipboard is invalid. This just checks for that and
bails early.
The reason onDragEnded is never called is because we call preventDefault during
onDragStart. Fixing this won't be sufficient because the JS dragdata will still
be populated if you drag in from an external app.
BUG=41087
TEST=See bug for repro steps.
Review URL: http://codereview.chromium.org/1717003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45147 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_bookmark_manager_api.cc')
-rw-r--r-- | chrome/browser/extensions/extension_bookmark_manager_api.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_bookmark_manager_api.cc b/chrome/browser/extensions/extension_bookmark_manager_api.cc index 1d5ee45..3f6c4bf3 100644 --- a/chrome/browser/extensions/extension_bookmark_manager_api.cc +++ b/chrome/browser/extensions/extension_bookmark_manager_api.cc @@ -386,9 +386,13 @@ bool DropBookmarkManagerFunction::RunImpl() { dom_ui->extension_bookmark_manager_event_router(); DCHECK(router); - + const BookmarkDragData* drag_data = router->GetBookmarkDragData(); + if (drag_data == NULL) { + NOTREACHED() <<"Somehow we're dropping null bookmark data"; + return false; + } bookmark_utils::PerformBookmarkDrop(profile(), - *router->GetBookmarkDragData(), + *drag_data, drop_parent, drop_index); router->ClearBookmarkDragData(); |