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

Issue 7190001: [Sync] Split DirectoryChangeListener for thread-safety (Closed)

Created:
9 years, 6 months ago by akalin
Modified:
9 years, 6 months ago
CC:
chromium-reviews, ncarter (slow), idana, Raghu Simha, Paweł Hajdan Jr., arv (Not doing code reviews), brettw-cc_chromium.org, tim (not reviewing)
Visibility:
Public.

Description

[Sync] Split DirectoryChangeListener for thread-safety Split DirectoryChangeListener into DirectoryChangeDelegate and TransactionObserver classes. This removes a remove/notify race condition with the DirectoryChange events. Make syncable::{Read,Write}Transaction take Locations instead of file/line pairs. Move construction of sync_manager_ into sync thread. Add logging utils in sync/logging.{h,cc}. Add overloads to ObserverListThreadSafe::Notify for 2, 3, and 4 arguments. Fixed 'Inital' misspelling in SyncBackendHost (finally). BUG=85656 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=89413

Patch Set 1 #

Patch Set 2 : Fix lint #

Patch Set 3 : Fix windows compile #

Patch Set 4 : Sync to head #

Patch Set 5 : Fix test failures #

Total comments: 2

Patch Set 6 : address willchan's comments #

Total comments: 6

Patch Set 7 : Address comments #

Patch Set 8 : fix copyright #

Unified diffs Side-by-side diffs Delta from patch set Stats (+899 lines, -771 lines) Patch
M base/observer_list_threadsafe.h View 1 2 3 4 5 1 chunk +22 lines, -1 line 0 comments Download
M chrome/browser/resources/sync_internals/chrome_sync.js View 1 chunk +4 lines, -5 lines 0 comments Download
M chrome/browser/sync/abstract_profile_sync_service_test.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/apply_updates_command.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/apply_updates_command_unittest.cc View 13 chunks +13 lines, -12 lines 0 comments Download
M chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/conflict_resolver.cc View 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/engine/post_commit_message_command.cc View 1 2 3 4 5 6 7 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/engine/process_commit_response_command.cc View 1 2 3 4 5 6 7 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/engine/process_commit_response_command_unittest.cc View 1 2 3 4 5 6 7 6 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/sync/engine/process_updates_command.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/sync_scheduler.cc View 1 2 3 2 chunks +1 line, -21 lines 0 comments Download
M chrome/browser/sync/engine/syncapi.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/engine/syncapi.cc View 1 2 3 4 5 18 chunks +17 lines, -31 lines 0 comments Download
M chrome/browser/sync/engine/syncapi_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/syncer.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/syncer_unittest.cc View 174 chunks +175 lines, -174 lines 0 comments Download
M chrome/browser/sync/engine/syncer_util.cc View 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/engine/verify_updates_command.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/engine/verify_updates_command_unittest.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.h View 1 2 3 4 5 6 5 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 2 3 4 5 6 20 chunks +67 lines, -57 lines 0 comments Download
D chrome/browser/sync/js_directory_change_listener.h View 1 chunk +0 lines, -49 lines 0 comments Download
D chrome/browser/sync/js_directory_change_listener.cc View 1 chunk +0 lines, -61 lines 0 comments Download
A chrome/browser/sync/js_transaction_observer.h View 1 1 chunk +50 lines, -0 lines 0 comments Download
A chrome/browser/sync/js_transaction_observer.cc View 1 chunk +77 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_autofill_unittest.cc View 3 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_unittest.cc View 1 2 3 4 3 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/sync/sessions/sync_session_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
A + chrome/browser/sync/syncable/directory_change_delegate.h View 2 chunks +10 lines, -8 lines 0 comments Download
D chrome/browser/sync/syncable/directory_change_listener.h View 1 chunk +0 lines, -42 lines 0 comments Download
M chrome/browser/sync/syncable/directory_manager.h View 3 chunks +14 lines, -8 lines 0 comments Download
M chrome/browser/sync/syncable/directory_manager.cc View 2 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/sync/syncable/syncable.h View 12 chunks +40 lines, -37 lines 0 comments Download
M chrome/browser/sync/syncable/syncable.cc View 1 2 3 4 18 chunks +62 lines, -127 lines 0 comments Download
M chrome/browser/sync/syncable/syncable_mock.h View 1 2 3 4 5 6 7 3 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/sync/syncable/syncable_mock.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/sync/syncable/syncable_unittest.cc View 73 chunks +95 lines, -85 lines 0 comments Download
A chrome/browser/sync/syncable/transaction_observer.h View 1 chunk +39 lines, -0 lines 0 comments Download
A chrome/browser/sync/util/logging.h View 1 2 3 1 chunk +34 lines, -0 lines 0 comments Download
A chrome/browser/sync/util/logging.cc View 1 2 3 1 chunk +18 lines, -0 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/test/sync/engine/mock_connection_manager.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/test/sync/engine/test_directory_setter_upper.h View 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/test/sync/engine/test_directory_setter_upper.cc View 5 chunks +6 lines, -5 lines 0 comments Download
A chrome/test/sync/null_directory_change_delegate.h View 1 2 3 4 5 6 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/test/sync/null_directory_change_delegate.cc View 1 2 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
akalin
+tim for review Don't be alarmed; most of the files only change __FILE__, __LINE__ to ...
9 years, 6 months ago (2011-06-16 01:05:59 UTC) #1
akalin
+willchan for base stuff
9 years, 6 months ago (2011-06-16 03:09:13 UTC) #2
willchan no longer on Chromium
base/ LGTM http://codereview.chromium.org/7190001/diff/4006/base/observer_list_threadsafe.h File base/observer_list_threadsafe.h (right): http://codereview.chromium.org/7190001/diff/4006/base/observer_list_threadsafe.h#newcode151 base/observer_list_threadsafe.h:151: void Notify(Method m, const A &a) { ...
9 years, 6 months ago (2011-06-16 09:50:17 UTC) #3
akalin
http://codereview.chromium.org/7190001/diff/4006/base/observer_list_threadsafe.h File base/observer_list_threadsafe.h (right): http://codereview.chromium.org/7190001/diff/4006/base/observer_list_threadsafe.h#newcode151 base/observer_list_threadsafe.h:151: void Notify(Method m, const A &a) { On 2011/06/16 ...
9 years, 6 months ago (2011-06-16 20:08:33 UTC) #4
tim (not reviewing)
LGTM http://codereview.chromium.org/7190001/diff/6051/chrome/browser/sync/glue/sync_backend_host.h File chrome/browser/sync/glue/sync_backend_host.h (right): http://codereview.chromium.org/7190001/diff/6051/chrome/browser/sync/glue/sync_backend_host.h#newcode506 chrome/browser/sync/glue/sync_backend_host.h:506: const std::string name_; what is |name_|? name of ...
9 years, 6 months ago (2011-06-16 21:10:58 UTC) #5
akalin
9 years, 6 months ago (2011-06-16 22:23:12 UTC) #6
Addressed comments, committing.

http://codereview.chromium.org/7190001/diff/6051/chrome/browser/sync/glue/syn...
File chrome/browser/sync/glue/sync_backend_host.h (right):

http://codereview.chromium.org/7190001/diff/6051/chrome/browser/sync/glue/syn...
chrome/browser/sync/glue/sync_backend_host.h:506: const std::string name_;
On 2011/06/16 21:10:58, timsteele wrote:
> what is |name_|? name of what?

Done.

http://codereview.chromium.org/7190001/diff/6051/chrome/browser/sync/glue/syn...
chrome/browser/sync/glue/sync_backend_host.h:515:
scoped_ptr<sync_api::SyncManager> sync_manager_;
On 2011/06/16 21:10:58, timsteele wrote:
> I prefer the old name :\ but if you really want to change it shouldn't we
change
> it everywhere lest we make things more confusing? one example -
ui_model_worker
> still refers to it as "syncapi"

Well, the problem with the name "syncapi" is that it's overloaded.  Here it was
used to mean "instance of the SyncManager class", in ui_model_worker, according
to the comments, it's really referring to the sync *thread*, and in other places
(DirectoryChangeDelegate) it's used to mean "from Chrome" as opposed to "from
the cloud".

I'll fix ui_model_worker et al. in a separate CL.

http://codereview.chromium.org/7190001/diff/6051/chrome/test/sync/null_direct...
File chrome/test/sync/null_directory_change_delegate.h (right):

http://codereview.chromium.org/7190001/diff/6051/chrome/test/sync/null_direct...
chrome/test/sync/null_directory_change_delegate.h:14: class
NullDirectoryChangeDelegate : public DirectoryChangeDelegate {
On 2011/06/16 21:10:58, timsteele wrote:
> add class comment

Done.

Powered by Google App Engine
This is Rietveld 408576698