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

Issue 2472213003: [IndexedDB] Refactoring to remove ref ptrs and host transaction ids. (Closed)

Created:
4 years, 1 month ago by dmurph
Modified:
4 years ago
CC:
chromium-reviews, cmumford, darin-cc_chromium.org, jam, jsbell+idb_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[IndexedDB] Refactoring to remove ref ptrs and host transaction ids. R=cmumford BUG=457449, 662246 Committed: https://crrev.com/9d00e05d1070176eb8a13f7b83d73f067946f958 Cr-Commit-Position: refs/heads/master@{#435749}

Patch Set 1 #

Patch Set 2 : updated unittests #

Total comments: 49

Patch Set 3 : comments, build #

Patch Set 4 : comments & rebase #

Total comments: 9

Patch Set 5 : rebase & comments #

Patch Set 6 : Forgot to remove pending connection change #

Patch Set 7 : compile fix for mock class #

Patch Set 8 : fixed segfault on corruption #

Patch Set 9 : Fixed test use-after-free #

Patch Set 10 : rebased & working #

Total comments: 37

Patch Set 11 : comments #

Patch Set 12 : rebase #

Total comments: 34

Patch Set 13 : comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+725 lines, -759 lines) Patch
M content/browser/indexed_db/cursor_impl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/indexed_db/cursor_impl.cc View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -5 lines 0 comments Download
M content/browser/indexed_db/database_impl.cc View 1 2 3 4 5 6 7 8 9 19 chunks +136 lines, -78 lines 0 comments Download
M content/browser/indexed_db/indexed_db_backing_store.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +8 lines, -1 line 0 comments Download
M content/browser/indexed_db/indexed_db_backing_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +40 lines, -22 lines 0 comments Download
M content/browser/indexed_db/indexed_db_backing_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +11 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_callbacks.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +1 line, -6 lines 0 comments Download
M content/browser/indexed_db/indexed_db_callbacks.cc View 1 2 3 4 5 6 7 8 9 10 11 12 14 chunks +4 lines, -16 lines 0 comments Download
M content/browser/indexed_db/indexed_db_class_factory.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_class_factory.cc View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -7 lines 0 comments Download
M content/browser/indexed_db/indexed_db_connection.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +39 lines, -3 lines 0 comments Download
M content/browser/indexed_db/indexed_db_connection.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +71 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_context_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -7 lines 0 comments Download
M content/browser/indexed_db/indexed_db_cursor.h View 1 2 3 4 5 6 7 8 9 5 chunks +10 lines, -7 lines 0 comments Download
M content/browser/indexed_db/indexed_db_cursor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +55 lines, -26 lines 0 comments Download
M content/browser/indexed_db/indexed_db_database.h View 1 2 3 4 5 6 7 8 9 8 chunks +19 lines, -25 lines 0 comments Download
M content/browser/indexed_db/indexed_db_database.cc View 1 2 3 4 5 6 7 8 9 10 11 12 43 chunks +107 lines, -251 lines 0 comments Download
M content/browser/indexed_db/indexed_db_database_callbacks.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_database_callbacks.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +10 lines, -9 lines 0 comments Download
M content/browser/indexed_db/indexed_db_database_unittest.cc View 1 2 3 4 5 6 7 8 9 8 chunks +22 lines, -48 lines 0 comments Download
M content/browser/indexed_db/indexed_db_dispatcher_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +0 lines, -26 lines 0 comments Download
M content/browser/indexed_db/indexed_db_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +1 line, -70 lines 0 comments Download
M content/browser/indexed_db/indexed_db_factory_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_fake_backing_store.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M content/browser/indexed_db/indexed_db_pending_connection.h View 1 2 3 4 5 2 chunks +6 lines, -5 lines 0 comments Download
M content/browser/indexed_db/indexed_db_pending_connection.cc View 1 2 3 4 5 1 chunk +10 lines, -10 lines 0 comments Download
M content/browser/indexed_db/indexed_db_transaction.h View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +23 lines, -8 lines 0 comments Download
M content/browser/indexed_db/indexed_db_transaction.cc View 1 2 3 4 5 6 7 8 9 10 11 12 18 chunks +56 lines, -57 lines 0 comments Download
M content/browser/indexed_db/indexed_db_transaction_coordinator.h View 1 2 3 3 chunks +3 lines, -4 lines 0 comments Download
M content/browser/indexed_db/indexed_db_transaction_coordinator.cc View 1 2 3 chunks +8 lines, -9 lines 2 comments Download
M content/browser/indexed_db/indexed_db_transaction_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +48 lines, -36 lines 0 comments Download
M content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/indexed_db/mock_browsertest_indexed_db_class_factory.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -6 lines 0 comments Download
M content/browser/indexed_db/mock_indexed_db_database_callbacks.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/indexed_db/mock_indexed_db_database_callbacks.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 78 (51 generated)
dmurph
Hey Chris! This is a refactoring CL to make the transaction ids no longer have ...
4 years, 1 month ago (2016-11-04 00:42:02 UTC) #1
jsbell
Some notes from a quick skim. I didn't thoroughly review, though. https://codereview.chromium.org/2472213003/diff/20001/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): ...
4 years, 1 month ago (2016-11-04 17:48:19 UTC) #7
dmurph
Thanks for the comments Josh! https://codereview.chromium.org/2472213003/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/2472213003/diff/20001/content/browser/indexed_db/indexed_db_backing_store.cc#newcode4365 content/browser/indexed_db/indexed_db_backing_store.cc:4365: IndexedDBBackingStore::Transaction* transaction_ptr_; On 2016/11/04 ...
4 years, 1 month ago (2016-11-04 22:52:25 UTC) #9
cmumford
Lookin' good. https://codereview.chromium.org/2472213003/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/2472213003/diff/20001/content/browser/indexed_db/indexed_db_backing_store.cc#newcode4364 content/browser/indexed_db/indexed_db_backing_store.cc:4364: base::WeakPtr<IndexedDBBackingStore::Transaction> transaction_; What about the other places ...
4 years, 1 month ago (2016-11-04 23:33:13 UTC) #13
jsbell
https://codereview.chromium.org/2472213003/diff/20001/content/browser/indexed_db/indexed_db_connection.h File content/browser/indexed_db/indexed_db_connection.h (right): https://codereview.chromium.org/2472213003/diff/20001/content/browser/indexed_db/indexed_db_connection.h#newcode83 content/browser/indexed_db/indexed_db_connection.h:83: const int child_process_id_; On 2016/11/04 22:52:24, dmurph wrote: > ...
4 years, 1 month ago (2016-11-05 00:01:48 UTC) #14
dmurph
https://codereview.chromium.org/2472213003/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/2472213003/diff/20001/content/browser/indexed_db/indexed_db_backing_store.cc#newcode4364 content/browser/indexed_db/indexed_db_backing_store.cc:4364: base::WeakPtr<IndexedDBBackingStore::Transaction> transaction_; On 2016/11/04 23:33:12, cmumford wrote: > What ...
4 years, 1 month ago (2016-11-07 20:05:23 UTC) #17
jsbell
more drive-by comments... https://codereview.chromium.org/2472213003/diff/60001/content/browser/indexed_db/indexed_db_connection.h File content/browser/indexed_db/indexed_db_connection.h (right): https://codereview.chromium.org/2472213003/diff/60001/content/browser/indexed_db/indexed_db_connection.h#newcode79 content/browser/indexed_db/indexed_db_connection.h:79: // below. above? https://codereview.chromium.org/2472213003/diff/60001/content/browser/indexed_db/indexed_db_connection.h#newcode94 content/browser/indexed_db/indexed_db_connection.h:94: // ...
4 years, 1 month ago (2016-11-08 00:42:53 UTC) #20
dmurph
Rebased w/ Reilly's patch. +cc reillyg as an FYI https://codereview.chromium.org/2472213003/diff/60001/content/browser/indexed_db/indexed_db_connection.h File content/browser/indexed_db/indexed_db_connection.h (right): https://codereview.chromium.org/2472213003/diff/60001/content/browser/indexed_db/indexed_db_connection.h#newcode79 content/browser/indexed_db/indexed_db_connection.h:79: ...
4 years, 1 month ago (2016-11-09 00:27:32 UTC) #22
dmurph
+Reilly as an FYI
4 years, 1 month ago (2016-11-09 00:28:20 UTC) #24
Reilly Grant (use Gerrit)
Thanks for the FYI. It looks like we might want to make transactions Mojo objects ...
4 years, 1 month ago (2016-11-09 00:40:21 UTC) #26
chromium-reviews
Possibly - There might be a need to keep them alive a little bit if ...
4 years, 1 month ago (2016-11-09 00:43:06 UTC) #27
Reilly Grant (use Gerrit)
On 2016/11/09 at 00:43:06, chromium-reviews wrote: > Possibly - There might be a need to ...
4 years, 1 month ago (2016-11-09 00:45:33 UTC) #30
dmurph
FYI - it looks like I need to do a refactor before this change to ...
4 years, 1 month ago (2016-11-10 21:03:24 UTC) #45
dmurph
FYI - it looks like I need to do a refactor before this change to ...
4 years, 1 month ago (2016-11-10 21:03:25 UTC) #46
dmurph
@cmumford, @jsbell can you please take a look? This is rebased and I fixed some ...
4 years ago (2016-11-29 23:28:47 UTC) #48
Reilly Grant (use Gerrit)
The rebase on top of my changes lgtm. Thanks for removing size tracking from IndexedDBDispatcherHost. ...
4 years ago (2016-11-30 16:32:26 UTC) #52
jsbell
overall lgtm https://codereview.chromium.org/2472213003/diff/180001/content/browser/indexed_db/cursor_impl.h File content/browser/indexed_db/cursor_impl.h (right): https://codereview.chromium.org/2472213003/diff/180001/content/browser/indexed_db/cursor_impl.h#newcode8 content/browser/indexed_db/cursor_impl.h:8: #include "base/memory/ref_counted.h" nit: include <memory> too https://codereview.chromium.org/2472213003/diff/180001/content/browser/indexed_db/database_impl.cc ...
4 years ago (2016-11-30 21:30:14 UTC) #53
dmurph
I replaced the booleans with a single enum, which should be a little more verbose. ...
4 years ago (2016-11-30 23:13:07 UTC) #58
cmumford
Nothing major - all small stuff. https://codereview.chromium.org/2472213003/diff/220001/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/2472213003/diff/220001/content/browser/indexed_db/indexed_db_backing_store.cc#newcode4341 content/browser/indexed_db/indexed_db_backing_store.cc:4341: case IndexedDBBackingStore::BlobWriteResult::FAIILURE_ASYNC: Since ...
4 years ago (2016-12-01 19:14:51 UTC) #61
dmurph
Thanks for the review! I only had one question - which origin() do you want ...
4 years ago (2016-12-01 21:12:24 UTC) #63
cmumford
https://codereview.chromium.org/2472213003/diff/220001/content/browser/indexed_db/indexed_db_database.cc File content/browser/indexed_db/indexed_db_database.cc (right): https://codereview.chromium.org/2472213003/diff/220001/content/browser/indexed_db/indexed_db_database.cc#newcode1418 content/browser/indexed_db/indexed_db_database.cc:1418: ReportError(s, origin(), factory_.get(), error); On 2016/12/01 21:12:23, dmurph wrote: ...
4 years ago (2016-12-01 22:25:45 UTC) #65
cmumford
lgtm
4 years ago (2016-12-01 22:54:15 UTC) #68
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/2472213003/240001
4 years ago (2016-12-01 22:55:48 UTC) #71
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years ago (2016-12-01 23:01:10 UTC) #73
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/9d00e05d1070176eb8a13f7b83d73f067946f958 Cr-Commit-Position: refs/heads/master@{#435749}
4 years ago (2016-12-01 23:03:52 UTC) #75
sof
https://codereview.chromium.org/2472213003/diff/240001/content/browser/indexed_db/indexed_db_transaction_coordinator.cc File content/browser/indexed_db/indexed_db_transaction_coordinator.cc (right): https://codereview.chromium.org/2472213003/diff/240001/content/browser/indexed_db/indexed_db_transaction_coordinator.cc#newcode69 content/browser/indexed_db/indexed_db_transaction_coordinator.cc:69: result.insert(result.end(), started_transactions_.begin(), Somewhat odd, but I'm running into compilation ...
4 years ago (2016-12-05 20:00:20 UTC) #77
jsbell
4 years ago (2016-12-06 00:00:47 UTC) #78
Message was sent while issue was closed.
https://codereview.chromium.org/2472213003/diff/240001/content/browser/indexe...
File content/browser/indexed_db/indexed_db_transaction_coordinator.cc (right):

https://codereview.chromium.org/2472213003/diff/240001/content/browser/indexe...
content/browser/indexed_db/indexed_db_transaction_coordinator.cc:69:
result.insert(result.end(), started_transactions_.begin(),
On 2016/12/05 20:00:20, sof wrote:
> Somewhat odd, but I'm running into compilation breakage with the use of these
> list_set<> iterators in insert():
> 
> In file included from
> ../../content/browser/indexed_db/indexed_db_transaction_coordinator.cc:5:
> In file included from
> ../../content/browser/indexed_db/indexed_db_transaction_coordinator.h:10:
> In file included from
> /usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/map:60:
> In file included from
>
/usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/bits/stl_tree.h:63:
> In file included from
>
/usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/bits/stl_algobase.h:69:
> In file included from
>
/usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/debug/debug.h:138:
>
/usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/debug/functions.h:137:61:
> error: indirection requires pointer operand ('const
> list_set<content::IndexedDBTransaction *>::const_iterator' invalid)
>       return __foreign_iterator_aux4(__it, std::__addressof(*__other));
>                                                             ^~~~~~~~
>
/usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/debug/functions.h:181:14:
> note: in instantiation of function template specialization
> '__gnu_debug::__foreign_iterator_aux3<__gnu_cxx::__normal_iterator<const
> content::IndexedDBTransaction *const *, std::__cxx1998::vector<const
> content::IndexedDBTransaction *, std::allocator<const
> content::IndexedDBTransaction *> > >, std::__debug::vector<const
> content::IndexedDBTransaction *, std::allocator<const
> content::IndexedDBTransaction *> >, list_set<content::IndexedDBTransaction
> *>::const_iterator>' requested here
>       return __foreign_iterator_aux3(__it, __other, __other_end, __tag());
>              ^
>
/usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/debug/functions.h:201:5:
> note: in instantiation of function template specialization
> '__gnu_debug::__foreign_iterator_aux2<__gnu_cxx::__normal_iterator<const
> content::IndexedDBTransaction *const *, std::__cxx1998::vector<const
> content::IndexedDBTransaction *, std::allocator<const
> content::IndexedDBTransaction *> > >, std::__debug::vector<const
> content::IndexedDBTransaction *, std::allocator<const
> content::IndexedDBTransaction *> >, list_set<content::IndexedDBTransaction
> *>::const_iterator>' requested here
>         || __foreign_iterator_aux2(__it, std::__miter_base(__other),
>            ^
>
/usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/debug/functions.h:212:14:
> note: in instantiation of function template specialization
> '__gnu_debug::__foreign_iterator_aux<__gnu_cxx::__normal_iterator<const
> content::IndexedDBTransaction *const *, std::__cxx1998::vector<const
> content::IndexedDBTransaction *, std::allocator<const
> content::IndexedDBTransaction *> > >, std::__debug::vector<const
> content::IndexedDBTransaction *, std::allocator<const
> content::IndexedDBTransaction *> >, list_set<content::IndexedDBTransaction
> *>::const_iterator>' requested here
>       return __foreign_iterator_aux(__it, __other, __other_end, _Integral());
>              ^
>
/usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/debug/vector:587:4:
> note: in instantiation of function template specialization
> '__gnu_debug::__foreign_iterator<__gnu_cxx::__normal_iterator<const
> content::IndexedDBTransaction *const *, std::__cxx1998::vector<const
> content::IndexedDBTransaction *, std::allocator<const
> content::IndexedDBTransaction *> > >, std::__debug::vector<const
> content::IndexedDBTransaction *, std::allocator<const
> content::IndexedDBTransaction *> >, list_set<content::IndexedDBTransaction
> *>::const_iterator>' requested here
>           __glibcxx_check_insert_range(__position, __first, __last, __dist);
>           ^
>
/usr/lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/debug/macros.h:116:36:
> note: expanded from macro '__glibcxx_check_insert_range'
> _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__foreign_iterator(_Position,_First,_Last),
>                                    ^
> ../../content/browser/indexed_db/indexed_db_transaction_coordinator.cc:69:10:
> note: in instantiation of function template specialization
> 'std::__debug::vector<const content::IndexedDBTransaction *,
> std::allocator<const content::IndexedDBTransaction *>
> >::insert<list_set<content::IndexedDBTransaction *>::const_iterator, void>'
> requested here
>   result.insert(result.end(), started_transactions_.begin(),
>          ^
> 1 error generated.
> ninja: build stopped: subcommand failed.
> 
> Same happens with the g++ 4.9 STL headers on a different workstation (both
with
> the default is_clang=true) -- no one else has reported similar issues and/or
> known cause?

Weird - I haven't heard any other reports. 

list_set isn't too fancy - fixes welcome!

Powered by Google App Engine
This is Rietveld 408576698