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

Issue 417573004: indexeddb: Removed use of dangling ptr in writeBlobToFileOnIOThread. (Closed)

Created:
6 years, 5 months ago by cmumford
Modified:
6 years, 5 months ago
CC:
alecflett, chromium-reviews, cmumford, darin-cc_chromium.org, dgrogan, jam, jsbell+idb_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

indexeddb: Removed use of dangling ptr in writeBlobToFileOnIOThread. LocalWriteClosure only had a raw pointer to a ChainedBlobWriter which was held by a scoped_refptr in IndexedDBBackingStore::Transaction. If the transaction was deleted before writeBlobToFileOnIOThread was called then a crash would ensue. Converted raw ptr to scoped_refptr prevents this. BUG=395650 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=285428

Patch Set 1 #

Total comments: 2

Patch Set 2 : Added period at end of sentence #

Total comments: 10

Patch Set 3 : Using ReleaseSoon to delete object on correct thread. #

Patch Set 4 : Including <string> to make "git cl lint" happy #

Total comments: 9

Patch Set 5 : scoped pointer to TaskRunner #

Total comments: 3

Patch Set 6 : Also scoped LocalWriteClosure::task_runner_ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -46 lines) Patch
M content/browser/indexed_db/indexed_db_active_blob_registry_unittest.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/indexed_db/indexed_db_backing_store.h View 1 2 3 4 10 chunks +14 lines, -13 lines 0 comments Download
M content/browser/indexed_db/indexed_db_backing_store.cc View 1 2 3 4 5 9 chunks +26 lines, -19 lines 0 comments Download
M content/browser/indexed_db/indexed_db_backing_store_unittest.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_context_impl.h View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_context_impl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/browser/indexed_db/indexed_db_fake_backing_store.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_fake_backing_store.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/indexed_db_context.h View 1 2 3 3 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
cmumford
PTAL. I'm not sure this is the right way to do this, but id does ...
6 years, 5 months ago (2014-07-23 17:27:13 UTC) #1
jsbell
lgtm... The IDB TaskRunner is actually SequencedTaskRunner, it's just not passed around as such. We ...
6 years, 5 months ago (2014-07-23 17:41:15 UTC) #2
cmumford
https://codereview.chromium.org/417573004/diff/1/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/417573004/diff/1/content/browser/indexed_db/indexed_db_backing_store.cc#newcode2288 content/browser/indexed_db/indexed_db_backing_store.cc:2288: // Don't actually release the writer (the closure will ...
6 years, 5 months ago (2014-07-23 17:46:10 UTC) #3
michaeln1
https://codereview.chromium.org/417573004/diff/20001/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/417573004/diff/20001/content/browser/indexed_db/indexed_db_backing_store.cc#newcode711 content/browser/indexed_db/indexed_db_backing_store.cc:711: base::TaskRunner* task_runner) this really is a SequencedTaskRunner so ReleaseSoon ...
6 years, 5 months ago (2014-07-23 20:15:15 UTC) #4
jsbell
https://codereview.chromium.org/417573004/diff/20001/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/417573004/diff/20001/content/browser/indexed_db/indexed_db_backing_store.cc#newcode2323 content/browser/indexed_db/indexed_db_backing_store.cc:2323: friend class base::RefCountedThreadSafe<LocalWriteClosure>; On 2014/07/23 20:15:15, michaeln1 wrote: > ...
6 years, 5 months ago (2014-07-23 20:17:47 UTC) #5
cmumford
+jochen@chromium.org for content/public/browser/indexed_db_context.h review. As Michael suggested I switched to ReleaseSoon which is a cleaner ...
6 years, 5 months ago (2014-07-23 23:26:58 UTC) #6
michaeln
lgtm but lets see what jsbell thinks about fixing the rawptrs to the TaskRunner too ...
6 years, 5 months ago (2014-07-24 00:20:29 UTC) #7
jochen (gone - plz use gerrit)
content/public lgtm
6 years, 5 months ago (2014-07-24 09:00:35 UTC) #8
cmumford
jsbell: because I scoped the TaskRunner pointers you may want to take a second look. ...
6 years, 5 months ago (2014-07-24 18:18:27 UTC) #9
jsbell
lgtm... So far as I can tell, the task runner lifetime was previously safe as ...
6 years, 5 months ago (2014-07-24 18:44:09 UTC) #10
cmumford
https://codereview.chromium.org/417573004/diff/80001/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/417573004/diff/80001/content/browser/indexed_db/indexed_db_backing_store.cc#newcode2323 content/browser/indexed_db/indexed_db_backing_store.cc:2323: base::SequencedTaskRunner* task_runner_; On 2014/07/24 18:44:09, jsbell wrote: > Should ...
6 years, 5 months ago (2014-07-24 18:57:08 UTC) #11
cmumford
The CQ bit was checked by cmumford@chromium.org
6 years, 5 months ago (2014-07-24 18:57:12 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmumford@chromium.org/417573004/100001
6 years, 5 months ago (2014-07-24 18:58:46 UTC) #13
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_chromeos_rel on tryserver.chromium ...
6 years, 5 months ago (2014-07-24 23:02:06 UTC) #14
commit-bot: I haz the power
6 years, 5 months ago (2014-07-25 00:17:19 UTC) #15
Message was sent while issue was closed.
Change committed as 285428

Powered by Google App Engine
This is Rietveld 408576698