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

Issue 7633077: Refactor syncapi.h (Closed)

Created:
9 years, 4 months ago by rlarocque
Modified:
9 years, 4 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Fragment syncapi.h into sync/internal_api/* This commit splits syncapi.cc and syncapi.h into many files. Most of these files have been moved to the newly created chrome/browser/sync/internal_api. Each of the following classes now have their own .cc and .h files: - BaseNode - ReadNode - WriteNode - BaseTransaction - ReadTransaction - WriteTransaction - UserShare - SyncManager Functions formerly declared at file-scope in syncapi.cc and shared among several classes are now declared in engine/syncapi_internal.h. We intend to use DEPS rules to prevent these functions from being included in non-syncapi classes. Test classes closely related to syncapi.h classes have been moved from engine to internal_api. This change necessarily touches the #include lists for lots of files and some of the sources lists in .gyp. This change should have no effect on program behaviour. BUG=19878 TEST=

Patch Set 1 #

Total comments: 34

Patch Set 2 : Set of patches to refactor syncapi.h #

Total comments: 19

Patch Set 3 : Responses to review comments #

Patch Set 4 : This patch has compiled from a clean build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4732 lines, -5810 lines) Patch
M chrome/browser/sync/abstract_profile_sync_service_test.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/engine/DEPS View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/sync/engine/all_status.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/engine/change_reorder_buffer.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/change_reorder_buffer.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/engine/net/server_connection_manager.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/net/syncapi_server_connection_manager.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/nigori_util.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
D chrome/browser/sync/engine/read_node_mock.h View 1 1 chunk +0 lines, -31 lines 0 comments Download
D chrome/browser/sync/engine/read_node_mock.cc View 1 1 chunk +0 lines, -11 lines 0 comments Download
M chrome/browser/sync/engine/sync_scheduler.h View 1 1 chunk +3 lines, -4 lines 0 comments Download
D chrome/browser/sync/engine/syncapi.h View 1 2 1 chunk +0 lines, -1095 lines 0 comments Download
D chrome/browser/sync/engine/syncapi.cc View 1 chunk +0 lines, -3083 lines 0 comments Download
A chrome/browser/sync/engine/syncapi_internal.h View 1 1 chunk +34 lines, -0 lines 0 comments Download
A chrome/browser/sync/engine/syncapi_internal.cc View 1 2 1 chunk +78 lines, -0 lines 0 comments Download
D chrome/browser/sync/engine/syncapi_mock.h View 1 1 chunk +0 lines, -27 lines 0 comments Download
D chrome/browser/sync/engine/syncapi_unittest.cc View 1 1 chunk +0 lines, -1432 lines 0 comments Download
M chrome/browser/sync/glue/app_change_processor.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/app_change_processor.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/glue/app_model_associator.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/autofill_change_processor.h View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/autofill_change_processor.cc View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/autofill_model_associator.h View 1 2 2 chunks +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/autofill_model_associator.cc View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/autofill_profile_change_processor.h View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/autofill_profile_change_processor.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/autofill_profile_model_associator.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/autofill_profile_model_associator.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/autofill_profile_model_associator_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_change_processor.h View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/bookmark_change_processor.cc View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_model_associator.cc View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/change_processor.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/change_processor_mock.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/extension_change_processor.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/extension_change_processor.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/glue/extension_model_associator.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/extension_sync.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/extension_sync_traits.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/generic_change_processor.cc View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/http_bridge.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/glue/password_change_processor.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/password_model_associator.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/session_change_processor.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/session_change_processor.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/session_model_associator.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_unittest.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/glue/theme_change_processor.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/theme_change_processor.cc View 1 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/theme_model_associator.cc View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/typed_url_change_processor.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/typed_url_model_associator.cc View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/ui_model_worker.h View 1 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/sync/glue/ui_model_worker_unittest.cc View 1 1 chunk +2 lines, -3 lines 0 comments Download
A chrome/browser/sync/internal_api/DEPS View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/README View 1 1 chunk +32 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/base_node.h View 1 1 chunk +224 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/base_node.cc View 1 1 chunk +298 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/base_transaction.h View 1 2 1 chunk +59 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/base_transaction.cc View 1 2 1 chunk +35 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/read_node.h View 1 1 chunk +79 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/read_node.cc View 1 1 chunk +92 lines, -0 lines 0 comments Download
A + chrome/browser/sync/internal_api/read_node_mock.h View 1 1 chunk +31 lines, -31 lines 0 comments Download
A + chrome/browser/sync/internal_api/read_node_mock.cc View 1 1 chunk +1 line, -1 line 0 comments Download
A chrome/browser/sync/internal_api/read_transaction.h View 1 1 chunk +45 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/read_transaction.cc View 1 1 chunk +37 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/sync_manager.h View 1 2 1 chunk +546 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/sync_manager.cc View 1 2 1 chunk +2047 lines, -0 lines 0 comments Download
A + chrome/browser/sync/internal_api/syncapi_mock.h View 1 2 chunks +4 lines, -4 lines 0 comments Download
A + chrome/browser/sync/internal_api/syncapi_unittest.cc View 1 2 2 chunks +6 lines, -2 lines 0 comments Download
A chrome/browser/sync/internal_api/user_share.h View 1 1 chunk +37 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/user_share.cc View 1 1 chunk +15 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/write_node.h View 1 1 chunk +193 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/write_node.cc View 1 1 chunk +538 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/write_transaction.h View 1 1 chunk +56 lines, -0 lines 0 comments Download
A chrome/browser/sync/internal_api/write_transaction.cc View 1 1 chunk +29 lines, -0 lines 0 comments Download
M chrome/browser/sync/js/DEPS View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/sync/js/js_sync_manager_observer.h View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/js/js_sync_manager_observer_unittest.cc View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/notifier/DEPS View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_factory_impl_unittest.cc View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_autofill_unittest.cc View 1 2 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_bookmark_unittest.cc View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_password_unittest.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_preference_unittest.cc View 1 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_session_unittest.cc View 1 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_typed_url_unittest.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/sync/protocol/DEPS View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/sync/sessions/DEPS View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/sync/sync_setup_wizard_unittest.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/sync/syncable/DEPS View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/sync/syncable/syncable.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/ntp/foreign_session_handler.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/webui/sessions_ui.cc View 1 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/chrome.gyp View 1 2 1 chunk +19 lines, -3 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/test/sync/engine/test_user_share.h View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 18 (0 generated)
rlarocque
Here's part 1 of the syncapi refactor. I'm sending out this review for early feedback ...
9 years, 4 months ago (2011-08-15 22:16:46 UTC) #1
tim (not reviewing)
#happydance Still looking. Are you planning on making the dir changes as part of the ...
9 years, 4 months ago (2011-08-15 22:53:55 UTC) #2
rlarocque
The next code dump should respond to these code changes, among other things. I've got ...
9 years, 4 months ago (2011-08-16 18:12:46 UTC) #3
rlarocque
Here is the second patch set. It includes responses to Tim's review comments, and the ...
9 years, 4 months ago (2011-08-16 18:28:14 UTC) #4
Nicolas Zea
Some comments. Also, I wonder if the README is really necessary? Tim? http://codereview.chromium.org/7633077/diff/7001/chrome/browser/sync/engine/net/server_connection_manager.cc File chrome/browser/sync/engine/net/server_connection_manager.cc ...
9 years, 4 months ago (2011-08-16 19:39:07 UTC) #5
tim (not reviewing)
Getting there! Few more comments I think we should add DEPS rules on internal_api from ...
9 years, 4 months ago (2011-08-16 20:08:03 UTC) #6
rlarocque
I'll upload another code dump shortly. In response to Tim's latest comments: * I've updated ...
9 years, 4 months ago (2011-08-16 22:19:19 UTC) #7
rlarocque
The latest patch is now up.
9 years, 4 months ago (2011-08-16 22:25:34 UTC) #8
Nicolas Zea
On Tue, Aug 16, 2011 at 3:19 PM, <rlarocque@chromium.org> wrote: > > Sadly, no. > ...
9 years, 4 months ago (2011-08-16 22:31:10 UTC) #9
tim (not reviewing)
Looks great! Thanks! LGTM
9 years, 4 months ago (2011-08-16 22:47:57 UTC) #10
tim (not reviewing)
On 2011/08/16 22:47:57, timsteele wrote: > Looks great! Thanks! > LGTM Should have added - ...
9 years, 4 months ago (2011-08-16 22:50:49 UTC) #11
Nicolas Zea
I've uploaded the review at http://codereview.chromium.org/7624009. You can keep your eye on the try job ...
9 years, 4 months ago (2011-08-16 23:09:25 UTC) #12
Nicolas Zea
Looks like the integration tests aren't compiling. Make sure you've tested the following targets: unit_tests, ...
9 years, 4 months ago (2011-08-16 23:19:49 UTC) #13
rlarocque1
Minor complaint: The description of the changelog is no longer accurate. syncapi_functions.{h,cc} have been deleted. ...
9 years, 4 months ago (2011-08-16 23:23:53 UTC) #14
Nicolas Zea
Yeah, you can just edit your own changelog and I'll pull things from there to ...
9 years, 4 months ago (2011-08-16 23:27:09 UTC) #15
Nicolas Zea
This has landed in 95693.
9 years, 4 months ago (2011-08-18 17:16:50 UTC) #16
Nicolas Zea
On 2011/08/18 17:16:50, nzea wrote: > This has landed in 95693. On second thought, I ...
9 years, 4 months ago (2011-08-18 17:39:31 UTC) #17
rlarocque
9 years, 4 months ago (2011-08-18 20:18:32 UTC) #18
On 2011/08/16 20:08:03, timsteele wrote:
> I think we should add DEPS rules on internal_api from engine/ /syncable
> /protocol /notifier /sessions
> 
...
> 
> Also, there's a bunch of stuff that was already pulled out of syncapi in
/engine
> that could go in internal_api:
> 
> change_reorder_buffer*
> configure_reason*
> *model_safe_worker*
> http_post_provider_*
> 
> You can do it in a follow up change if you prefer.
> 

Now that we've got some of the code committed, I'm taking another look at Tim's
comments.

The first commit added DEPS rules for syncable, protocol, notifier, and
sessions.  However, I did not add a rule for engine.  There are three files that
would have failed checkdeps if I had done so:
* engine/all_status.h: Requires access to  sync_api::SyncManager::Status.
* engine/nigori_util.h: Requires access to sync_api::WriteNode
* engine/change_reorder_buffer.h: Requires access to a bunch of different
internal_api headers, but will soon be moved to that directory itself (more on
that later).

It might be possible to fix these issues by moving nigori_util and all_status to
syncapi, but I'm not sure that's the right move.  

As for moving some other syncapi files to internal_api, I'm running into some
issues with that:
* change_reorder_buffer: Actually, this one is OK.
* configure_reason: SyncScheduler needs it to implement "void
SyncScheduler::ScheduleConfig(const ModelTypeBitSet& types,
sync_api::ConfigureReason reason)".  I don't see any obvious way to move
configure_reason.h to internal_api without violating the rule that files in
engine should not include from internal_api.
* model_safe_worker: ModelChangingSyncerCommand needs access to ModelSafeWorker.
 SyncScheduler needs access to ModelSafeWorkerRegistrar.  Once again, I don't
see a way to move the file without violating the rule that engine should not
include from internal_api.
* http_post_provider_*: These classes are used by
SyncAPIServerConnectionManager.  I might be able to make this move work if we
also move engine/net/syncapi_server_connection_manager.* to internal_api.  Does
that sound like a good idea?

Powered by Google App Engine
This is Rietveld 408576698