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

Issue 2563303002: Fix crash when deleting ReadingListStore via ReadingListModelStorage*. (Closed)

Created:
4 years ago by sdefresne
Modified:
4 years ago
CC:
chromium-reviews, stkhapugin
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix crash when deleting ReadingListStore via ReadingListModelStorage*. ReadingListStore inherits from multiple classes, including from ReadingListModelStorage that does not define a virtual destructor. Since ReadingListModelImpl has a scoped_ptr to ReadingListModelStorage, it calls the base destructor with a pointer that does not correspond to memory returned by "new" (it points to somewhere inside the memory block). The issue can be fixed by defining a virtual destructor on the base class ReadingListModelStorage (as all class with virtual method should do). Also mark the class a non-copyable since copying would cause slicing. BUG=673169 Committed: https://crrev.com/39493e82e29a9d895f9f6de38a076ab43f1bf17c Cr-Commit-Position: refs/heads/master@{#437800}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -0 lines) Patch
M components/reading_list/ios/reading_list_model_storage.h View 3 chunks +11 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (10 generated)
sdefresne
Please take a look. When defining class with virtual methods, please mark the destructor as ...
4 years ago (2016-12-11 18:51:58 UTC) #4
Olivier
LGTM But now ReadingListStore inherits two classes (ReadingListModelStorage and syncer::ModelTypeSyncBridge) I thought this was only ...
4 years ago (2016-12-11 19:06:47 UTC) #8
Olivier
On 2016/12/11 19:06:47, Olivier Robin wrote: > LGTM > > But now ReadingListStore inherits two ...
4 years ago (2016-12-11 19:11:04 UTC) #9
sdefresne
On 2016/12/11 19:11:04, Olivier Robin wrote: > On 2016/12/11 19:06:47, Olivier Robin wrote: > > ...
4 years ago (2016-12-11 19:28:20 UTC) #10
Olivier
On 2016/12/11 19:28:20, sdefresne wrote: > On 2016/12/11 19:11:04, Olivier Robin wrote: > > On ...
4 years ago (2016-12-11 19:30:39 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2563303002/1
4 years ago (2016-12-11 19:40:14 UTC) #13
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years ago (2016-12-11 19:44:04 UTC) #16
Nico
On 2016/12/11 19:44:04, commit-bot: I haz the power wrote: > Committed patchset #1 (id:1) Fwiw ...
4 years ago (2016-12-11 19:52:04 UTC) #17
sdefresne
On 2016/12/11 19:52:04, Nico wrote: > On 2016/12/11 19:44:04, commit-bot: I haz the power wrote: ...
4 years ago (2016-12-11 23:23:47 UTC) #18
commit-bot: I haz the power
4 years ago (2016-12-12 15:09:58 UTC) #20
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/39493e82e29a9d895f9f6de38a076ab43f1bf17c
Cr-Commit-Position: refs/heads/master@{#437800}

Powered by Google App Engine
This is Rietveld 408576698