Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Issue 546138: Implementation of the database safe worker model. (Closed)

Created:
10 years, 11 months ago by albertb
Modified:
9 years, 3 months ago
CC:
chromium-reviews_googlegroups.com, ncarter (slow), ben+cc_chromium.org, idana, Paweł Hajdan Jr., tim (not reviewing)
Visibility:
Public.

Description

Implementation of the database safe worker model. BUG=none TEST=unit test Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=37367

Patch Set 1 #

Patch Set 2 : Added test #

Patch Set 3 : Switch to static method to run the closure #

Total comments: 11

Patch Set 4 : Make ModelSafeWorker RefCounted #

Patch Set 5 : Better error handling #

Total comments: 3

Patch Set 6 : Used OneShotTimer and fixed sync_unit_tests. #

Total comments: 2

Patch Set 7 : Use a ScoppedRunnableMethodFactory and fix MessageLoop race. #

Total comments: 1

Patch Set 8 : Verify that work was done and fix win compile warning #

Unified diffs Side-by-side diffs Delta from patch set Stats (+177 lines, -12 lines) Patch
M chrome/browser/sync/engine/model_safe_worker.h View 3 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/syncer_thread_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/engine/syncer_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
A chrome/browser/sync/glue/database_model_worker.h View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/browser/sync/glue/database_model_worker.cc View 1 2 3 4 5 1 chunk +36 lines, -0 lines 0 comments Download
A chrome/browser/sync/glue/database_model_worker_unittest.cc View 2 3 4 5 6 7 1 chunk +90 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/glue/ui_model_worker_unittest.cc View 5 chunks +5 lines, -4 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
albertb
10 years, 11 months ago (2010-01-26 00:41:43 UTC) #1
tim (not reviewing)
http://codereview.chromium.org/546138/diff/1002/1003 File chrome/browser/sync/glue/database_model_worker.cc (right): http://codereview.chromium.org/546138/diff/1002/1003#newcode18 chrome/browser/sync/glue/database_model_worker.cc:18: ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, NewRunnableFunction( I'd check the return value here ...
10 years, 11 months ago (2010-01-26 01:28:48 UTC) #2
Paweł Hajdan Jr.
Drive-by with some test-related comments. http://codereview.chromium.org/546138/diff/1002/1005 File chrome/browser/sync/glue/database_model_worker_unittest.cc (right): http://codereview.chromium.org/546138/diff/1002/1005#newcode17 chrome/browser/sync/glue/database_model_worker_unittest.cc:17: db_thread_.reset(new ChromeThread(ChromeThread::DB)); Why this ...
10 years, 11 months ago (2010-01-26 06:38:07 UTC) #3
albertb
http://codereview.chromium.org/546138/diff/1002/1003 File chrome/browser/sync/glue/database_model_worker.cc (right): http://codereview.chromium.org/546138/diff/1002/1003#newcode18 chrome/browser/sync/glue/database_model_worker.cc:18: ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, NewRunnableFunction( On 2010/01/26 01:28:48, timsteele wrote: > ...
10 years, 11 months ago (2010-01-26 22:32:38 UTC) #4
tim (not reviewing)
http://codereview.chromium.org/546138/diff/1002/1003 File chrome/browser/sync/glue/database_model_worker.cc (right): http://codereview.chromium.org/546138/diff/1002/1003#newcode18 chrome/browser/sync/glue/database_model_worker.cc:18: ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, NewRunnableFunction( We could do that.. I was ...
10 years, 11 months ago (2010-01-26 22:55:14 UTC) #5
albertb
http://codereview.chromium.org/546138/diff/1002/1003 File chrome/browser/sync/glue/database_model_worker.cc (right): http://codereview.chromium.org/546138/diff/1002/1003#newcode18 chrome/browser/sync/glue/database_model_worker.cc:18: ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, NewRunnableFunction( On 2010/01/26 22:55:14, timsteele wrote: > ...
10 years, 11 months ago (2010-01-26 23:02:07 UTC) #6
albertb
http://codereview.chromium.org/546138/diff/1002/1003 File chrome/browser/sync/glue/database_model_worker.cc (right): http://codereview.chromium.org/546138/diff/1002/1003#newcode18 chrome/browser/sync/glue/database_model_worker.cc:18: ChromeThread::PostTask(ChromeThread::DB, FROM_HERE, NewRunnableFunction( On 2010/01/26 23:02:07, albertb wrote: > ...
10 years, 11 months ago (2010-01-26 23:20:30 UTC) #7
tim (not reviewing)
http://codereview.chromium.org/546138/diff/2009/1014 File chrome/browser/sync/glue/database_model_worker_unittest.cc (right): http://codereview.chromium.org/546138/diff/2009/1014#newcode36 chrome/browser/sync/glue/database_model_worker_unittest.cc:36: NewCallback(&done, &base::WaitableEvent::Signal)); the callback will leak, as the chrome ...
10 years, 11 months ago (2010-01-26 23:46:51 UTC) #8
albertb
Updated, I also fixed the sync_unit_tests to use scoped_refptr when holding ModelSafeWorkers. http://codereview.chromium.org/546138/diff/2009/1014 File chrome/browser/sync/glue/database_model_worker_unittest.cc ...
10 years, 11 months ago (2010-01-27 21:56:14 UTC) #9
tim (not reviewing)
yeah, you're right :) thanks for doing this though, patch looks nice. LGTM if you ...
10 years, 11 months ago (2010-01-27 22:06:50 UTC) #10
tim (not reviewing)
Hmm, except for strange linux/mac errors: [----------] 1 test from DatabaseModelWorkerTest [ RUN ] DatabaseModelWorkerTest.DoesWorkOnDatabaseThread ...
10 years, 11 months ago (2010-01-27 22:07:33 UTC) #11
albertb
Hmm, I *think* that was a race between the creation of the IO ChromeThread and ...
10 years, 11 months ago (2010-01-27 23:53:56 UTC) #12
tim (not reviewing)
10 years, 11 months ago (2010-01-28 00:02:06 UTC) #13
If the try succeeds (or fails in some unrelated/flaky way), this LGTM.

http://codereview.chromium.org/546138/diff/5008/5014
File chrome/browser/sync/glue/database_model_worker_unittest.cc (right):

http://codereview.chromium.org/546138/diff/5008/5014#newcode81
chrome/browser/sync/glue/database_model_worker_unittest.cc:81:
MessageLoop::current()->Run();
one final thing - may want to add setting of a bool to DoWork() (like
did_do_work_ = true) and here do EXPECT_TRUE to make sure the work was actually
done.

Powered by Google App Engine
This is Rietveld 408576698