From 8c6b5192848be90633007b5a0f49b9c300e84bea Mon Sep 17 00:00:00 2001 From: "rsimha@chromium.org" Date: Fri, 1 Feb 2013 01:44:06 +0000 Subject: [sync] Componentize sync: Part Final: Target 'sync' is now its own component One of the long term goals of the sync team has been to pull sync out of chrome_dll and into its own component. This should result in faster link times for component builds, and cleaner demarcation between sync code and the rest of chrome. This patch does the following: - Splits off sync.gyp into gypi files for sync_core, sync_api, sync_internal_api, sync_notifier and sync_proto. - Audits the dependencies of various targets in sync.gyp, sync_tests.gyp, and other chrome gyp files, and makes sure all dependencies are explicitly declared. - Makes targets declared in gyp files outside sync.gyp directly depend on sync.gyp:sync instead of inner sync targets. - Implements two versions of the target 'sync.gyp:sync': 1) In static mode, the public 'sync' target has a target type of 'none', and is composed of the static library targets 'sync_api', 'sync_core', 'sync_internal_api', 'sync_notifier', and 'sync_proto'. 2) In component mode, we build the public 'sync' target into a single shared library, which includes the contents of sync_api.gypi, sync_core.gypi, sync_internal_api.gypi, sync_notifier.gypi, and sync_proto.gypi. TBR=akalin,robertshield,thakis BUG=136928 TEST=Set GYP_DEFINES="component=shared_library" and build the 'all' target on all platforms. Review URL: https://codereview.chromium.org/11412211 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180034 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/chrome.gyp | 4 +- chrome/chrome_browser.gypi | 12 +- chrome/chrome_browser_chromeos.gypi | 8 +- chrome/chrome_browser_extensions.gypi | 4 +- chrome/chrome_browser_ui.gypi | 8 +- chrome/chrome_tests.gypi | 27 +- chrome/chrome_tests_unit.gypi | 8 +- chrome_frame/chrome_frame.gyp | 6 +- jingle/jingle.gyp | 1 + sync/base/sync_export.h | 3 +- sync/internal_api/public/base/unique_position.h | 3 +- sync/internal_api/public/delete_journal.h | 3 +- sync/protocol/sync_proto.gyp | 49 - sync/sync.gyp | 1087 ++--------------------- sync/sync_api.gypi | 33 + sync/sync_core.gypi | 190 ++++ sync/sync_internal_api.gypi | 111 +++ sync/sync_notifier.gypi | 64 ++ sync/sync_proto.gypi | 51 ++ sync/sync_tests.gypi | 617 +++++++++++++ sync/syncable/syncable_base_transaction.cc | 8 + sync/syncable/syncable_base_transaction.h | 6 +- sync/syncable/syncable_delete_journal.h | 3 +- sync/syncable/syncable_read_transaction.h | 2 +- sync/syncable/syncable_write_transaction.h | 2 +- 25 files changed, 1197 insertions(+), 1113 deletions(-) delete mode 100644 sync/protocol/sync_proto.gyp create mode 100644 sync/sync_api.gypi create mode 100644 sync/sync_core.gypi create mode 100644 sync/sync_internal_api.gypi create mode 100644 sync/sync_notifier.gypi create mode 100644 sync/sync_proto.gypi create mode 100644 sync/sync_tests.gypi diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index eb94a43..352f264 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -14,7 +14,7 @@ 'common', 'browser', '../content/content.gyp:content_app', - '../sync/sync.gyp:sync_core', + '../sync/sync.gyp:sync', ], 'allocator_target': '../base/allocator/allocator.gyp:allocator', 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome', @@ -385,7 +385,7 @@ 'dependencies': [ 'test_support_common', '../skia/skia.gyp:skia', - '../sync/sync.gyp:sync_core', + '../sync/sync.gyp:sync', ], 'include_dirs': [ '..', diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index b6585a0..adb5d6a 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -35,12 +35,8 @@ '../google_apis/google_apis.gyp:google_apis', '../media/media.gyp:media', '../skia/skia.gyp:skia', - '../sync/protocol/sync_proto.gyp:sync_proto', - # TODO(akalin): Depend only on sync_api from sync. - '../sync/sync.gyp:sync_api', - '../sync/sync.gyp:sync_internal_api', - '../sync/sync.gyp:sync_notifier', - '../ui/ui.gyp:shell_dialogs', + '../sql/sql.gyp:sql', + '../sync/sync.gyp:sync', '../third_party/bzip2/bzip2.gyp:bzip2', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp', @@ -51,6 +47,7 @@ '../third_party/zlib/zlib.gyp:minizip', '../third_party/zlib/zlib.gyp:zlib', '../ui/base/strings/ui_strings.gyp:ui_strings', + '../ui/ui.gyp:shell_dialogs', '../ui/ui.gyp:ui', '../ui/ui.gyp:ui_resources', '../webkit/support/webkit_support.gyp:user_agent', @@ -62,7 +59,8 @@ '<(SHARED_INTERMEDIATE_DIR)', ], 'export_dependent_settings': [ - '../sync/sync.gyp:sync_notifier', + '../sql/sql.gyp:sql', + '../sync/sync.gyp:sync', ], 'sources': [ # All .cc, .h, .m, and .mm files under browser except for: diff --git a/chrome/chrome_browser_chromeos.gypi b/chrome/chrome_browser_chromeos.gypi index ab7c9fe..d352867 100644 --- a/chrome/chrome_browser_chromeos.gypi +++ b/chrome/chrome_browser_chromeos.gypi @@ -57,11 +57,7 @@ '../ppapi/ppapi_internal.gyp:ppapi_ipc', # For PpapiMsg_LoadPlugin '../printing/printing.gyp:printing', '../skia/skia.gyp:skia', - '../sync/protocol/sync_proto.gyp:sync_proto', - # TODO(akalin): Depend only on sync_api from sync. - '../sync/sync.gyp:sync_api', - '../sync/sync.gyp:sync_internal_api', - '../sync/sync.gyp:sync_notifier', + '../sync/sync.gyp:sync', '../third_party/adobe/flash/flash_player.gyp:flapper_version_h', '../third_party/bzip2/bzip2.gyp:bzip2', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', @@ -104,7 +100,7 @@ ], }, 'export_dependent_settings': [ - '../sync/sync.gyp:sync_notifier', + '../sync/sync.gyp:sync', ], 'sources': [ # All .cc, .h, .m, and .mm files unde browser/chromeos, except for tests diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi index c5e8557..e0497de 100644 --- a/chrome/chrome_browser_extensions.gypi +++ b/chrome/chrome_browser_extensions.gypi @@ -14,7 +14,6 @@ # have the same dependencies. Once browser_extensions is untangled from # browser, then we can clean up these dependencies. 'dependencies': [ - '../sync/protocol/sync_proto.gyp:sync_proto', 'chrome_resources.gyp:chrome_extra_resources', 'chrome_resources.gyp:chrome_resources', 'chrome_resources.gyp:chrome_strings', @@ -32,8 +31,9 @@ '../device/device.gyp:device_bluetooth', '../net/net.gyp:net', '../skia/skia.gyp:skia', - '../sync/sync.gyp:sync_notifier', + '../sync/sync.gyp:sync', '../third_party/bzip2/bzip2.gyp:bzip2', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase', diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi index 505a8ba..8923e07 100644 --- a/chrome/chrome_browser_ui.gypi +++ b/chrome/chrome_browser_ui.gypi @@ -36,11 +36,7 @@ '../crypto/crypto.gyp:crypto', '../media/media.gyp:media', '../skia/skia.gyp:skia', - '../sync/protocol/sync_proto.gyp:sync_proto', - # TODO(akalin): Depend only on sync_api from sync. - '../sync/sync.gyp:sync_api', - '../sync/sync.gyp:sync_internal_api', - '../sync/sync.gyp:sync_notifier', + '../sync/sync.gyp:sync', '../third_party/bzip2/bzip2.gyp:bzip2', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp', @@ -63,7 +59,7 @@ '<(SHARED_INTERMEDIATE_DIR)', ], 'export_dependent_settings': [ - '../sync/sync.gyp:sync_notifier', + '../sync/sync.gyp:sync', ], 'sources': [ # All .cc, .h, .m, and .mm files under browser/ui except for: diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index b1a966f..c04b4084 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -153,8 +153,7 @@ '../net/net.gyp:net_resources', '../net/net.gyp:net_test_support', '../skia/skia.gyp:skia', - '../sync/protocol/sync_proto.gyp:sync_proto', - '../sync/sync.gyp:sync_api', + '../sync/sync.gyp:sync', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', '../third_party/libpng/libpng.gyp:libpng', @@ -462,7 +461,7 @@ '../build/temp_gyp/googleurl.gyp:googleurl', '../net/net.gyp:net', '../skia/skia.gyp:skia', - '../sync/sync.gyp:sync_api', + '../sync/sync.gyp:sync', '../testing/gtest.gyp:gtest', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', @@ -928,11 +927,11 @@ '../net/net.gyp:net', '../net/net.gyp:net_test_support', '../skia/skia.gyp:skia', - '../sync/protocol/sync_proto.gyp:sync_proto', - '../sync/sync.gyp:sync_notifier', + '../sync/sync.gyp:sync', '../sync/sync.gyp:test_support_sync_api', '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', '../third_party/cld/cld.gyp:cld', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', @@ -1768,7 +1767,6 @@ 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'], 'dependencies': [ 'browser', - '../sync/protocol/sync_proto.gyp:sync_proto', 'chrome_resources.gyp:chrome_resources', 'chrome_resources.gyp:chrome_strings', 'chrome_resources.gyp:packed_extra_resources', @@ -1781,6 +1779,7 @@ '../net/net.gyp:net', '../net/net.gyp:net_test_support', '../skia/skia.gyp:skia', + '../sync/sync.gyp:sync', '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', '../third_party/cld/cld.gyp:cld', @@ -2070,7 +2069,6 @@ 'type': 'executable', 'dependencies': [ 'browser', - '../sync/protocol/sync_proto.gyp:sync_proto', 'chrome', 'chrome_resources.gyp:chrome_resources', 'chrome_resources.gyp:chrome_strings', @@ -2083,7 +2081,7 @@ '../net/net.gyp:net', '../printing/printing.gyp:printing', '../skia/skia.gyp:skia', - '../sync/sync.gyp:sync_notifier', + '../sync/sync.gyp:sync', '../sync/sync.gyp:test_support_sync_testserver', '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', @@ -2107,8 +2105,6 @@ 'app/chrome_dll.rc', 'app/chrome_dll_resource.h', 'app/chrome_version.rc.version', - 'browser/sessions/session_backend.cc', - 'browser/sync/glue/session_model_associator.cc', 'test/base/chrome_test_launcher.cc', 'test/data/resource.rc', 'browser/sync/test/integration/apps_helper.cc', @@ -2246,13 +2242,12 @@ 'target_name': 'sync_performance_tests', 'type': 'executable', 'dependencies': [ - '../sync/protocol/sync_proto.gyp:sync_proto', 'browser', 'chrome', 'common/extensions/api/api.gyp:api', 'test_support_common', '../skia/skia.gyp:skia', - '../sync/sync.gyp:sync_notifier', + '../sync/sync.gyp:sync', '../sync/sync.gyp:test_support_sync_testserver', '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', @@ -2270,8 +2265,6 @@ 'app/chrome_dll.rc', 'app/chrome_dll_resource.h', 'app/chrome_version.rc.version', - 'browser/sessions/session_backend.cc', - 'browser/sync/glue/session_model_associator.cc', 'browser/sync/test/integration/autofill_helper.cc', 'browser/sync/test/integration/autofill_helper.h', 'browser/sync/test/integration/bookmarks_helper.cc', @@ -2557,11 +2550,11 @@ 'test_support_common', 'browser', 'renderer', - 'chrome_resources.gyp:packed_resources', + 'chrome_resources.gyp:packed_resources', '../base/base.gyp:base', '../net/net.gyp:net_test_support', '../skia/skia.gyp:skia', - '../sync/sync.gyp:sync_api', + '../sync/sync.gyp:sync', ], 'include_dirs': [ '..', @@ -2610,7 +2603,7 @@ 'debugger', 'test_support_common', '../skia/skia.gyp:skia', - '../sync/sync.gyp:sync_api', + '../sync/sync.gyp:sync', '../testing/gtest.gyp:gtest', ], 'export_dependent_settings': [ diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index 2dcc754..6b3ba32 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -13,7 +13,6 @@ # dependencies block below, rather than here. 'app/policy/cloud_policy_codegen.gyp:policy_test_support', 'browser', - '../sync/protocol/sync_proto.gyp:sync_proto', 'chrome_resources.gyp:chrome_resources', 'chrome_resources.gyp:chrome_strings', 'chrome_resources.gyp:theme_resources', @@ -26,6 +25,7 @@ '../net/net.gyp:net', '../net/net.gyp:net_test_support', '../skia/skia.gyp:skia', + '../sync/sync.gyp:sync', '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', ], @@ -374,13 +374,13 @@ '../media/media.gyp:media_test_support', '../net/net.gyp:net', '../net/net.gyp:net_test_support', - '../testing/gmock.gyp:gmock', - '../testing/gtest.gyp:gtest', - 'test_support_common', '../sync/sync.gyp:test_support_sync_api', '../sync/sync.gyp:test_support_sync_core', '../sync/sync.gyp:test_support_sync_internal_api', '../sync/sync.gyp:test_support_sync_notifier', + '../testing/gmock.gyp:gmock', + '../testing/gtest.gyp:gtest', + 'test_support_common', 'test_support_unit', # 3) anything tests directly depend on '../google_apis/google_apis.gyp:google_apis', diff --git a/chrome_frame/chrome_frame.gyp b/chrome_frame/chrome_frame.gyp index 4b9e5bd..797f731 100644 --- a/chrome_frame/chrome_frame.gyp +++ b/chrome_frame/chrome_frame.gyp @@ -417,7 +417,7 @@ '../net/net.gyp:net', '../net/net.gyp:net_test_support', '../skia/skia.gyp:skia', - '../sync/sync.gyp:sync_api', + '../sync/sync.gyp:sync', '../testing/gtest.gyp:gtest', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', @@ -800,7 +800,7 @@ '../chrome/chrome.gyp:installer_util', '../google_update/google_update.gyp:google_update', # Make the archive build happy. - '../sync/sync.gyp:sync_api', + '../sync/sync.gyp:sync', # Crash Reporting 'crash_reporting/crash_reporting.gyp:crash_report', ], @@ -923,7 +923,7 @@ '../chrome/chrome.gyp:installer_util', '../google_update/google_update.gyp:google_update', # Make the archive build happy. - '../sync/sync.gyp:sync_api', + '../sync/sync.gyp:sync', # Crash Reporting 'crash_reporting/crash_reporting.gyp:crash_report', ], diff --git a/jingle/jingle.gyp b/jingle/jingle.gyp index 0fd9811..2506978 100644 --- a/jingle/jingle.gyp +++ b/jingle/jingle.gyp @@ -111,6 +111,7 @@ '../net/net.gyp:net', '../third_party/expat/expat.gyp:expat', '../third_party/libjingle/libjingle.gyp:libjingle', + 'jingle_glue', ], 'export_dependent_settings': [ '../third_party/libjingle/libjingle.gyp:libjingle', diff --git a/sync/base/sync_export.h b/sync/base/sync_export.h index a38e8b2..83c65a6 100644 --- a/sync/base/sync_export.h +++ b/sync/base/sync_export.h @@ -5,8 +5,7 @@ #ifndef SYNC_SYNC_EXPORT_H_ #define SYNC_SYNC_EXPORT_H_ -// TODO(akalin): Remove '0 && ' when sync becomes a component. -#if 0 && defined(COMPONENT_BUILD) +#if defined(COMPONENT_BUILD) #if defined(WIN32) #if defined(SYNC_IMPLEMENTATION) diff --git a/sync/internal_api/public/base/unique_position.h b/sync/internal_api/public/base/unique_position.h index 8a0a1ba..3fbd5af 100644 --- a/sync/internal_api/public/base/unique_position.h +++ b/sync/internal_api/public/base/unique_position.h @@ -8,6 +8,7 @@ #include #include "base/basictypes.h" +#include "sync/base/sync_export.h" namespace sync_pb { class UniquePosition; @@ -37,7 +38,7 @@ namespace syncer { // // This class currently has several bookmarks-related assumptions built in, // though it could be adapted to be more generally useful. -class UniquePosition { +class SYNC_EXPORT_PRIVATE UniquePosition { public: static const size_t kSuffixLength; diff --git a/sync/internal_api/public/delete_journal.h b/sync/internal_api/public/delete_journal.h index 1e66b3c..3152b02 100644 --- a/sync/internal_api/public/delete_journal.h +++ b/sync/internal_api/public/delete_journal.h @@ -7,6 +7,7 @@ #include +#include "sync/base/sync_export.h" #include "sync/internal_api/public/base/model_type.h" #include "sync/protocol/sync.pb.h" @@ -23,7 +24,7 @@ typedef std::vector BookmarkDeleteJournalList; // Static APIs for passing delete journals between syncer::syncable namspace // and syncer namespace. -class DeleteJournal { +class SYNC_EXPORT DeleteJournal { public: // Return info about deleted bookmark entries stored in the delete journal // of |trans|'s directory. diff --git a/sync/protocol/sync_proto.gyp b/sync/protocol/sync_proto.gyp deleted file mode 100644 index edcb897..0000000 --- a/sync/protocol/sync_proto.gyp +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -{ - 'variables': { - 'chromium_code': 1, - }, - 'targets': [ - { - 'target_name': 'sync_proto', - 'type': 'static_library', - 'sources': [ - 'app_notification_specifics.proto', - 'app_setting_specifics.proto', - 'app_specifics.proto', - 'autofill_specifics.proto', - 'bookmark_specifics.proto', - 'client_commands.proto', - 'client_debug_info.proto', - 'device_info_specifics.proto', - 'dictionary_specifics.proto', - 'encryption.proto', - 'experiments_specifics.proto', - 'extension_setting_specifics.proto', - 'extension_specifics.proto', - 'get_updates_caller_info.proto', - 'history_delete_directive_specifics.proto', - 'nigori_specifics.proto', - 'password_specifics.proto', - 'preference_specifics.proto', - 'priority_preference_specifics.proto', - 'search_engine_specifics.proto', - 'session_specifics.proto', - 'sync.proto', - 'sync_enums.proto', - 'synced_notification_specifics.proto', - 'test.proto', - 'theme_specifics.proto', - 'typed_url_specifics.proto', - 'unique_position.proto', - ], - 'variables': { - 'proto_out_dir': 'sync/protocol', - }, - 'includes': ['../../build/protoc.gypi'], - }, - ], -} diff --git a/sync/sync.gyp b/sync/sync.gyp index 12f5267..baeffba 100644 --- a/sync/sync.gyp +++ b/sync/sync.gyp @@ -6,1054 +6,127 @@ 'variables': { 'chromium_code': 1, }, - 'targets': [ - # The core sync library. - { - 'target_name': 'sync_core', - 'type': 'static_library', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'include_dirs': [ - '..', - ], - 'defines': [ - 'SYNC_IMPLEMENTATION', - ], - 'dependencies': [ - '../base/base.gyp:base', - '../build/temp_gyp/googleurl.gyp:googleurl', - '../crypto/crypto.gyp:crypto', - '../google_apis/google_apis.gyp:google_apis', - '../net/net.gyp:net', - '../sql/sql.gyp:sql', - 'protocol/sync_proto.gyp:sync_proto', - ], - 'conditions': [ - ['OS=="linux" and chromeos==1', { - # Required by get_session_name.cc on Chrome OS. - 'dependencies': [ - '../chromeos/chromeos.gyp:chromeos', - ], - }], - ], - 'export_dependent_settings': [ - # Propagate sync_proto since our headers include its generated - # files. - 'protocol/sync_proto.gyp:sync_proto', - ], - 'sources': [ - 'base/sync_export.h', - 'engine/all_status.cc', - 'engine/all_status.h', - 'engine/apply_control_data_updates.cc', - 'engine/apply_control_data_updates.h', - 'engine/apply_updates_and_resolve_conflicts_command.cc', - 'engine/apply_updates_and_resolve_conflicts_command.h', - 'engine/backoff_delay_provider.cc', - 'engine/backoff_delay_provider.h', - 'engine/build_commit_command.cc', - 'engine/build_commit_command.h', - 'engine/commit.cc', - 'engine/commit.h', - 'engine/conflict_resolver.cc', - 'engine/conflict_resolver.h', - 'engine/conflict_util.cc', - 'engine/conflict_util.h', - 'engine/download_updates_command.cc', - 'engine/download_updates_command.h', - 'engine/get_commit_ids_command.cc', - 'engine/get_commit_ids_command.h', - 'engine/model_changing_syncer_command.cc', - 'engine/model_changing_syncer_command.h', - 'engine/net/server_connection_manager.cc', - 'engine/net/server_connection_manager.h', - 'engine/net/url_translator.cc', - 'engine/net/url_translator.h', - 'engine/nudge_source.cc', - 'engine/nudge_source.h', - 'engine/process_commit_response_command.cc', - 'engine/process_commit_response_command.h', - 'engine/process_updates_command.cc', - 'engine/process_updates_command.h', - 'engine/store_timestamps_command.cc', - 'engine/store_timestamps_command.h', - 'engine/sync_engine_event.cc', - 'engine/sync_engine_event.h', - 'engine/sync_scheduler.cc', - 'engine/sync_scheduler.h', - 'engine/sync_scheduler_impl.cc', - 'engine/sync_scheduler_impl.h', - 'engine/sync_session_job.cc', - 'engine/sync_session_job.h', - 'engine/syncer.cc', - 'engine/syncer.h', - 'engine/syncer_command.cc', - 'engine/syncer_command.h', - 'engine/syncer_proto_util.cc', - 'engine/syncer_proto_util.h', - 'engine/syncer_types.h', - 'engine/syncer_util.cc', - 'engine/syncer_util.h', - 'engine/throttled_data_type_tracker.cc', - 'engine/throttled_data_type_tracker.h', - 'engine/traffic_logger.cc', - 'engine/traffic_logger.h', - 'engine/traffic_recorder.cc', - 'engine/traffic_recorder.h', - 'engine/update_applicator.cc', - 'engine/update_applicator.h', - 'js/js_arg_list.cc', - 'js/js_arg_list.h', - 'js/js_backend.h', - 'js/js_controller.h', - 'js/js_event_details.cc', - 'js/js_event_details.h', - 'js/js_event_handler.h', - 'js/js_reply_handler.h', - 'js/sync_js_controller.cc', - 'js/sync_js_controller.h', - 'protocol/proto_enum_conversions.cc', - 'protocol/proto_enum_conversions.h', - 'protocol/proto_value_conversions.cc', - 'protocol/proto_value_conversions.h', - 'protocol/sync_protocol_error.cc', - 'protocol/sync_protocol_error.h', - 'sessions/debug_info_getter.h', - 'sessions/ordered_commit_set.cc', - 'sessions/ordered_commit_set.h', - 'sessions/status_controller.cc', - 'sessions/status_controller.h', - 'sessions/sync_session.cc', - 'sessions/sync_session.h', - 'sessions/sync_session_context.cc', - 'sessions/sync_session_context.h', - 'syncable/blob.h', - 'syncable/dir_open_result.h', - 'syncable/directory.cc', - 'syncable/directory.h', - 'syncable/directory_backing_store.cc', - 'syncable/directory_backing_store.h', - 'syncable/directory_change_delegate.h', - 'syncable/entry.cc', - 'syncable/entry.h', - 'syncable/entry_kernel.cc', - 'syncable/entry_kernel.h', - 'syncable/in_memory_directory_backing_store.cc', - 'syncable/in_memory_directory_backing_store.h', - 'syncable/invalid_directory_backing_store.cc', - 'syncable/invalid_directory_backing_store.h', - 'syncable/metahandle_set.h', - 'syncable/model_type.cc', - 'syncable/mutable_entry.cc', - 'syncable/mutable_entry.h', - 'syncable/nigori_handler.cc', - 'syncable/nigori_handler.h', - 'syncable/nigori_util.cc', - 'syncable/nigori_util.h', - 'syncable/on_disk_directory_backing_store.cc', - 'syncable/on_disk_directory_backing_store.h', - 'syncable/scoped_kernel_lock.h', - 'syncable/syncable-inl.h', - 'syncable/syncable_base_transaction.cc', - 'syncable/syncable_base_transaction.h', - 'syncable/syncable_changes_version.h', - 'syncable/syncable_columns.h', - 'syncable/syncable_delete_journal.cc', - 'syncable/syncable_delete_journal.h', - 'syncable/syncable_enum_conversions.cc', - 'syncable/syncable_enum_conversions.h', - 'syncable/syncable_id.cc', - 'syncable/syncable_id.h', - 'syncable/syncable_proto_util.cc', - 'syncable/syncable_proto_util.h', - 'syncable/syncable_read_transaction.cc', - 'syncable/syncable_read_transaction.h', - 'syncable/syncable_util.cc', - 'syncable/syncable_util.h', - 'syncable/syncable_write_transaction.cc', - 'syncable/syncable_write_transaction.h', - 'syncable/transaction_observer.h', - 'syncable/write_transaction_info.cc', - 'syncable/write_transaction_info.h', - 'util/cryptographer.cc', - 'util/cryptographer.h', - - # TODO(akalin): Figure out a better place to put - # data_encryption_win*; it's also used by autofill. - 'util/data_encryption_win.cc', - 'util/data_encryption_win.h', - - 'util/data_type_histogram.h', - 'util/encryptor.h', - 'util/extensions_activity_monitor.cc', - 'util/extensions_activity_monitor.h', - 'util/get_session_name.cc', - 'util/get_session_name.h', - 'util/get_session_name_ios.mm', - 'util/get_session_name_ios.h', - 'util/get_session_name_mac.mm', - 'util/get_session_name_mac.h', - 'util/get_session_name_win.cc', - 'util/get_session_name_win.h', - 'util/logging.cc', - 'util/logging.h', - 'util/nigori.cc', - 'util/nigori.h', - 'util/time.cc', - 'util/time.h', - ], - }, - - # The sync notifications library. - { - 'target_name': 'sync_notifier', - 'type': 'static_library', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'include_dirs': [ - '..', - ], - 'dependencies': [ - '../base/base.gyp:base', - '../jingle/jingle.gyp:jingle_glue', - '../jingle/jingle.gyp:notifier', - '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', - # TODO(akalin): Remove this (http://crbug.com/133352). - '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp', - '../third_party/libjingle/libjingle.gyp:libjingle', - 'sync_core', - ], - 'export_dependent_settings': [ - '../jingle/jingle.gyp:notifier', - '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', - ], - 'sources': [ - 'notifier/invalidation_handler.h', - 'notifier/invalidation_state_tracker.cc', - 'notifier/invalidation_state_tracker.h', - 'notifier/invalidation_util.cc', - 'notifier/invalidation_util.h', - 'notifier/invalidator_factory.cc', - 'notifier/invalidator_factory.h', - 'notifier/invalidator.h', - 'notifier/invalidator_registrar.cc', - 'notifier/invalidator_registrar.h', - 'notifier/invalidator_state.cc', - 'notifier/invalidator_state.h', - 'notifier/object_id_invalidation_map.cc', - 'notifier/object_id_invalidation_map.h', - ], - 'conditions': [ - ['OS != "android"', { - 'sources': [ - 'notifier/ack_tracker.cc', - 'notifier/ack_tracker.h', - 'notifier/invalidation_notifier.cc', - 'notifier/invalidation_notifier.h', - 'notifier/non_blocking_invalidator.cc', - 'notifier/non_blocking_invalidator.h', - 'notifier/p2p_invalidator.cc', - 'notifier/p2p_invalidator.h', - 'notifier/push_client_channel.cc', - 'notifier/push_client_channel.h', - 'notifier/registration_manager.cc', - 'notifier/registration_manager.h', - 'notifier/state_writer.h', - 'notifier/sync_invalidation_listener.cc', - 'notifier/sync_invalidation_listener.h', - 'notifier/sync_system_resources.cc', - 'notifier/sync_system_resources.h', - ], - }], - ], - }, - # The sync internal API library. - { - 'target_name': 'sync_internal_api', - 'type': 'static_library', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'include_dirs': [ - '..', - ], - 'dependencies': [ - '../base/base.gyp:base', - '../build/temp_gyp/googleurl.gyp:googleurl', - '../net/net.gyp:net', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - 'sync_notifier', - ], - 'export_dependent_settings': [ - # Propagate sync_proto since our headers include its generated - # files. - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - ], - 'sources': [ - 'internal_api/base_node.cc', - 'internal_api/base_transaction.cc', - 'internal_api/change_record.cc', - 'internal_api/change_reorder_buffer.cc', - 'internal_api/change_reorder_buffer.h', - 'internal_api/debug_info_event_listener.cc', - 'internal_api/debug_info_event_listener.h', - 'internal_api/http_bridge.cc', - 'internal_api/internal_components_factory_impl.cc', - 'internal_api/js_mutation_event_observer.cc', - 'internal_api/js_mutation_event_observer.h', - 'internal_api/js_sync_encryption_handler_observer.cc', - 'internal_api/js_sync_encryption_handler_observer.h', - 'internal_api/js_sync_manager_observer.cc', - 'internal_api/js_sync_manager_observer.h', - 'internal_api/public/base/enum_set.h', - 'internal_api/public/base/invalidation.cc', - 'internal_api/public/base/invalidation.h', - 'internal_api/public/base/model_type.h', - 'internal_api/public/base/model_type_invalidation_map.cc', - 'internal_api/public/base/model_type_invalidation_map.h', - 'internal_api/public/base/node_ordinal.cc', - 'internal_api/public/base/node_ordinal.h', - 'internal_api/public/base/ordinal.h', - 'internal_api/public/base/progress_marker_map.cc', - 'internal_api/public/base/progress_marker_map.h', - 'internal_api/public/base/unique_position.cc', - 'internal_api/public/base/unique_position.h', - 'internal_api/public/base_node.h', - 'internal_api/public/base_transaction.h', - 'internal_api/public/change_record.h', - 'internal_api/public/configure_reason.h', - 'internal_api/public/data_type_association_stats.cc', - 'internal_api/public/data_type_association_stats.h', - 'internal_api/public/data_type_debug_info_listener.h', - 'internal_api/public/engine/model_safe_worker.cc', - 'internal_api/public/engine/model_safe_worker.h', - 'internal_api/public/engine/passive_model_worker.cc', - 'internal_api/public/engine/passive_model_worker.h', - 'internal_api/public/engine/polling_constants.cc', - 'internal_api/public/engine/polling_constants.h', - 'internal_api/public/engine/sync_status.cc', - 'internal_api/public/engine/sync_status.h', - 'internal_api/public/http_bridge.h', - 'internal_api/public/http_post_provider_factory.h', - 'internal_api/public/http_post_provider_interface.h', - 'internal_api/public/internal_components_factory_impl.h', - 'internal_api/public/internal_components_factory.h', - 'internal_api/public/delete_journal.h', - 'internal_api/public/read_node.h', - 'internal_api/public/read_transaction.h', - 'internal_api/public/sessions/model_neutral_state.cc', - 'internal_api/public/sessions/model_neutral_state.h', - 'internal_api/public/sessions/sync_session_snapshot.cc', - 'internal_api/public/sessions/sync_session_snapshot.h', - 'internal_api/public/sessions/sync_source_info.cc', - 'internal_api/public/sessions/sync_source_info.h', - 'internal_api/public/sync_encryption_handler.cc', - 'internal_api/public/sync_encryption_handler.h', - 'internal_api/public/sync_manager_factory.h', - 'internal_api/public/sync_manager.cc', - 'internal_api/public/sync_manager.h', - 'internal_api/public/user_share.h', - 'internal_api/public/util/experiments.h', - 'internal_api/public/util/immutable.h', - 'internal_api/public/util/report_unrecoverable_error_function.h', - 'internal_api/public/util/sync_string_conversions.cc', - 'internal_api/public/util/sync_string_conversions.h', - 'internal_api/public/util/syncer_error.cc', - 'internal_api/public/util/syncer_error.h', - 'internal_api/public/util/unrecoverable_error_handler.h', - 'internal_api/public/util/unrecoverable_error_info.cc', - 'internal_api/public/util/unrecoverable_error_info.h', - 'internal_api/public/util/weak_handle.cc', - 'internal_api/public/util/weak_handle.h', - 'internal_api/public/write_node.h', - 'internal_api/public/write_transaction.h', - 'internal_api/delete_journal.cc', - 'internal_api/read_node.cc', - 'internal_api/read_transaction.cc', - 'internal_api/sync_encryption_handler_impl.cc', - 'internal_api/sync_encryption_handler_impl.h', - 'internal_api/sync_manager_factory.cc', - 'internal_api/sync_manager_impl.cc', - 'internal_api/sync_manager_impl.h', - 'internal_api/syncapi_internal.cc', - 'internal_api/syncapi_internal.h', - 'internal_api/syncapi_server_connection_manager.cc', - 'internal_api/syncapi_server_connection_manager.h', - 'internal_api/user_share.cc', - 'internal_api/write_node.cc', - 'internal_api/write_transaction.cc', - ], - }, - - # The sync external API library. - { - 'target_name': 'sync_api', - 'type': 'static_library', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'include_dirs': [ - '..', - ], - 'dependencies': [ - '../base/base.gyp:base', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_internal_api', - ], - # We avoid including header files from sync_proto in our public - # header files so we don't need to export its settings. - 'sources': [ - 'api/string_ordinal.h', - 'api/syncable_service.cc', - 'api/syncable_service.h', - 'api/sync_data.h', - 'api/sync_data.cc', - 'api/sync_change.h', - 'api/sync_change.cc', - 'api/sync_change_processor.h', - 'api/sync_change_processor.cc', - 'api/sync_error.h', - 'api/sync_error.cc', - 'api/sync_error_factory.h', - 'api/sync_error_factory.cc', - 'api/sync_merge_result.h', - 'api/sync_merge_result.cc', - 'api/time.h', - ], - }, - - # The componentized sync library. - { - 'target_name': 'sync_component', - # TODO(rsimha): Change the type of this target to '<(component)' after - # exporting dependencies on 'sync_proto'. - 'type': 'none', - 'dependencies': [ - 'sync_api', - 'sync_core', - 'sync_notifier', - 'sync_internal_api', - ], - 'export_dependent_settings': [ - 'sync_api', - 'sync_core', - 'sync_notifier', - 'sync_internal_api', - ], - }, - - # The public sync target. This depends on 'sync_component' and - # 'sync_proto' separately since 'sync_proto' isn't exportable from - # 'sync_component' (for now). - { - 'target_name': 'sync', - 'type': 'none', - 'dependencies': [ - 'sync_component', - 'protocol/sync_proto.gyp:sync_proto', - ], - 'export_dependent_settings': [ - 'sync_component', - 'protocol/sync_proto.gyp:sync_proto', - ], - }, - - # Test support files for the 'sync_core' target. - { - 'target_name': 'test_support_sync_core', - 'type': 'static_library', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'include_dirs': [ - '..', - ], - 'dependencies': [ - '../base/base.gyp:base', - '../testing/gmock.gyp:gmock', - '../testing/gtest.gyp:gtest', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - ], - 'export_dependent_settings': [ - '../testing/gmock.gyp:gmock', - '../testing/gtest.gyp:gtest', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - ], - 'sources': [ - 'js/js_test_util.cc', - 'js/js_test_util.h', - 'sessions/test_util.cc', - 'sessions/test_util.h', - 'syncable/syncable_mock.cc', - 'syncable/syncable_mock.h', - 'test/callback_counter.h', - 'test/engine/fake_model_worker.cc', - 'test/engine/fake_model_worker.h', - 'test/engine/fake_sync_scheduler.cc', - 'test/engine/fake_sync_scheduler.h', - 'test/engine/mock_connection_manager.cc', - 'test/engine/mock_connection_manager.h', - 'test/engine/syncer_command_test.cc', - 'test/engine/syncer_command_test.h', - 'test/engine/test_directory_setter_upper.cc', - 'test/engine/test_directory_setter_upper.h', - 'test/engine/test_id_factory.h', - 'test/engine/test_syncable_utils.cc', - 'test/engine/test_syncable_utils.h', - 'test/fake_encryptor.cc', - 'test/fake_encryptor.h', - 'test/fake_sync_encryption_handler.h', - 'test/fake_sync_encryption_handler.cc', - 'test/fake_extensions_activity_monitor.cc', - 'test/fake_extensions_activity_monitor.h', - 'test/test_transaction_observer.cc', - 'test/test_transaction_observer.h', - 'test/null_directory_change_delegate.cc', - 'test/null_directory_change_delegate.h', - 'test/null_transaction_observer.cc', - 'test/null_transaction_observer.h', - 'test/sessions/test_scoped_session_event_listener.h', - 'test/test_directory_backing_store.cc', - 'test/test_directory_backing_store.h', - 'util/test_unrecoverable_error_handler.cc', - 'util/test_unrecoverable_error_handler.h', - ], - }, - - # Test support files for the python sync test server. - { - 'target_name': 'test_support_sync_testserver', - 'type': 'static_library', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'include_dirs': [ - '..', - ], - 'dependencies': [ - '../base/base.gyp:base', - '../net/net.gyp:net_test_support', - - # The sync test server uses Python modules generated by the sync protos. - '../third_party/protobuf/protobuf.gyp:py_proto', - 'protocol/sync_proto.gyp:sync_proto', - ], - 'export_dependent_settings': [ - '../base/base.gyp:base', - '../net/net.gyp:net_test_support', - ], - 'sources': [ - 'test/local_sync_test_server.cc', - 'test/local_sync_test_server.h', - ], - }, - - # Test support files for the 'sync_notifier' target. - { - 'target_name': 'test_support_sync_notifier', - 'type': 'static_library', - 'include_dirs': [ - '..', - ], - 'dependencies': [ - '../testing/gmock.gyp:gmock', - '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp', - 'sync_internal_api', - 'sync_notifier', - ], - 'export_dependent_settings': [ - '../testing/gmock.gyp:gmock', - '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp', - 'sync_internal_api', - 'sync_notifier', - ], - 'sources': [ - 'notifier/fake_invalidation_state_tracker.cc', - 'notifier/fake_invalidation_state_tracker.h', - 'notifier/fake_invalidator.cc', - 'notifier/fake_invalidator.h', - 'notifier/fake_invalidation_handler.cc', - 'notifier/fake_invalidation_handler.h', - 'notifier/invalidator_test_template.cc', - 'notifier/invalidator_test_template.h', - 'notifier/object_id_invalidation_map_test_util.cc', - 'notifier/object_id_invalidation_map_test_util.h', - ], - }, - - # Test support files for the 'sync_internal_api' target. - { - 'target_name': 'test_support_sync_internal_api', - 'type': 'static_library', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'include_dirs': [ - '..', - ], - 'dependencies': [ - '../base/base.gyp:base', - '../testing/gtest.gyp:gtest', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - 'sync_internal_api', - 'sync_notifier', - 'test_support_sync_core', - ], - 'export_dependent_settings': [ - '../testing/gtest.gyp:gtest', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - 'sync_internal_api', - 'sync_notifier', - 'test_support_sync_core', - ], - 'sources': [ - 'internal_api/public/base/invalidation_test_util.cc', - 'internal_api/public/base/invalidation_test_util.h', - 'internal_api/public/base/model_type_invalidation_map_test_util.cc', - 'internal_api/public/base/model_type_invalidation_map_test_util.h', - 'internal_api/public/base/model_type_test_util.cc', - 'internal_api/public/base/model_type_test_util.h', - 'internal_api/public/test/fake_sync_manager.h', - 'internal_api/public/test/test_entry_factory.h', - 'internal_api/public/test/test_internal_components_factory.h', - 'internal_api/public/test/test_user_share.h', - 'internal_api/test/fake_sync_manager.cc', - 'internal_api/test/test_entry_factory.cc', - 'internal_api/test/test_internal_components_factory.cc', - 'internal_api/test/test_user_share.cc', - ], - }, - - # Test support files for the 'sync_api' target. - { - 'target_name': 'test_support_sync_api', - 'type': 'static_library', - 'include_dirs': [ - '..', - ], - 'dependencies': [ - '../testing/gmock.gyp:gmock', - 'sync_api', - ], - 'export_dependent_settings': [ - '../testing/gmock.gyp:gmock', - 'sync_api', - ], - 'sources': [ - 'api/fake_syncable_service.cc', - 'api/fake_syncable_service.h', - 'api/sync_error_factory_mock.cc', - 'api/sync_error_factory_mock.h', - ], - }, - - # Unit tests for the 'sync_core' target. This cannot be a static - # library because the unit test files have to be compiled directly - # into the executable, so we push the target files to the - # depending executable target via direct_dependent_settings. - { - 'target_name': 'sync_core_tests', - 'type': 'none', - # We only want unit test executables to include this target. - 'suppress_wildcard': 1, - 'dependencies': [ - '../base/base.gyp:base', - '../testing/gmock.gyp:gmock', - '../testing/gtest.gyp:gtest', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - 'test_support_sync_core', - ], - # Propagate all dependencies since the actual compilation - # happens in the dependents. - 'export_dependent_settings': [ - '../base/base.gyp:base', - '../testing/gmock.gyp:gmock', - '../testing/gtest.gyp:gtest', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - 'test_support_sync_core', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '..', - ], - 'sources': [ - 'internal_api/public/base/enum_set_unittest.cc', - 'internal_api/public/base/model_type_invalidation_map_unittest.cc', - 'internal_api/public/base/node_ordinal_unittest.cc', - 'internal_api/public/base/ordinal_unittest.cc', - 'internal_api/public/base/unique_position_unittest.cc', - 'internal_api/public/engine/model_safe_worker_unittest.cc', - 'internal_api/public/util/immutable_unittest.cc', - 'internal_api/public/util/weak_handle_unittest.cc', - 'engine/apply_control_data_updates_unittest.cc', - 'engine/apply_updates_and_resolve_conflicts_command_unittest.cc', - 'engine/backoff_delay_provider_unittest.cc', - 'engine/build_commit_command_unittest.cc', - 'engine/download_updates_command_unittest.cc', - 'engine/model_changing_syncer_command_unittest.cc', - 'engine/process_commit_response_command_unittest.cc', - 'engine/process_updates_command_unittest.cc', - 'engine/store_timestamps_command_unittest.cc', - 'engine/sync_session_job_unittest.cc', - 'engine/sync_scheduler_unittest.cc', - 'engine/sync_scheduler_whitebox_unittest.cc', - 'engine/syncer_proto_util_unittest.cc', - 'engine/syncer_unittest.cc', - 'engine/throttled_data_type_tracker_unittest.cc', - 'engine/traffic_recorder_unittest.cc', - 'js/js_arg_list_unittest.cc', - 'js/js_event_details_unittest.cc', - 'js/sync_js_controller_unittest.cc', - 'protocol/proto_enum_conversions_unittest.cc', - 'protocol/proto_value_conversions_unittest.cc', - 'sessions/ordered_commit_set_unittest.cc', - 'sessions/status_controller_unittest.cc', - 'sessions/sync_session_unittest.cc', - 'syncable/directory_backing_store_unittest.cc', - 'syncable/model_type_unittest.cc', - 'syncable/nigori_util_unittest.cc', - 'syncable/syncable_enum_conversions_unittest.cc', - 'syncable/syncable_id_unittest.cc', - 'syncable/syncable_unittest.cc', - 'syncable/syncable_util_unittest.cc', - 'util/cryptographer_unittest.cc', - 'util/data_encryption_win_unittest.cc', - 'util/data_type_histogram_unittest.cc', - 'util/get_session_name_unittest.cc', - 'util/nigori_unittest.cc', - 'util/protobuf_unittest.cc', - ], - 'conditions': [ - ['OS == "ios" and coverage != 0', { - 'sources!': [ - # These sources can't be built with coverage due to a toolchain - # bug: http://openradar.appspot.com/radar?id=1499403 - 'engine/syncer_unittest.cc', - - # These tests crash when run with coverage turned on due to an - # issue with llvm_gcda_increment_indirect_counter: - # http://crbug.com/156058 - 'syncable/directory_backing_store_unittest.cc', - ], - }], - ], - }, - }, - - # Unit tests for the 'sync_notifier' target. This cannot be a static - # library because the unit test files have to be compiled directly - # into the executable, so we push the target files to the - # depending executable target via direct_dependent_settings. - { - 'target_name': 'sync_notifier_tests', - 'type': 'none', - # We only want unit test executables to include this target. - 'suppress_wildcard': 1, - 'dependencies': [ - '../base/base.gyp:base', - '../jingle/jingle.gyp:notifier_test_util', - '../net/net.gyp:net_test_support', - '../testing/gmock.gyp:gmock', - '../testing/gtest.gyp:gtest', - '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', - '../third_party/libjingle/libjingle.gyp:libjingle', - 'sync_core', - 'sync_notifier', - 'test_support_sync_notifier', - ], - # Propagate all dependencies since the actual compilation - # happens in the dependents. - 'export_dependent_settings': [ - '../base/base.gyp:base', - '../jingle/jingle.gyp:notifier_test_util', - '../net/net.gyp:net_test_support', - '../testing/gmock.gyp:gmock', - '../testing/gtest.gyp:gtest', - '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', - '../third_party/libjingle/libjingle.gyp:libjingle', - 'sync_core', - 'sync_notifier', - 'test_support_sync_notifier', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '..', - ], - 'sources': [ - 'notifier/invalidator_factory_unittest.cc', - ], - 'conditions': [ - ['OS != "android"', { - 'sources': [ - 'notifier/ack_tracker_unittest.cc', - 'notifier/fake_invalidator_unittest.cc', - 'notifier/invalidation_notifier_unittest.cc', - 'notifier/invalidator_registrar_unittest.cc', - 'notifier/non_blocking_invalidator_unittest.cc', - 'notifier/p2p_invalidator_unittest.cc', - 'notifier/push_client_channel_unittest.cc', - 'notifier/registration_manager_unittest.cc', - 'notifier/sync_invalidation_listener_unittest.cc', - 'notifier/sync_system_resources_unittest.cc', - ], - }], - ], - }, - }, - # Unit tests for the 'sync_internal_api' target. This cannot be a static - # library because the unit test files have to be compiled directly - # into the executable, so we push the target files to the - # depending executable target via direct_dependent_settings. - { - 'target_name': 'sync_internal_api_tests', - 'type': 'none', - # We only want unit test executables to include this target. - 'suppress_wildcard': 1, - 'dependencies': [ - '../base/base.gyp:base', - '../net/net.gyp:net', - '../net/net.gyp:net_test_support', - '../testing/gmock.gyp:gmock', - '../testing/gtest.gyp:gtest', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - 'sync_internal_api', - 'sync_notifier', - 'test_support_sync_internal_api', - ], - # Propagate all dependencies since the actual compilation - # happens in the dependents. - 'export_dependent_settings': [ - '../base/base.gyp:base', - '../net/net.gyp:net', - '../net/net.gyp:net_test_support', - '../testing/gmock.gyp:gmock', - '../testing/gtest.gyp:gtest', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - 'sync_internal_api', - 'sync_notifier', - 'test_support_sync_internal_api', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '..', - ], - 'sources': [ - 'internal_api/debug_info_event_listener_unittest.cc', - 'internal_api/http_bridge_unittest.cc', - 'internal_api/js_mutation_event_observer_unittest.cc', - 'internal_api/js_sync_encryption_handler_observer_unittest.cc', - 'internal_api/js_sync_manager_observer_unittest.cc', - 'internal_api/public/change_record_unittest.cc', - 'internal_api/public/sessions/sync_session_snapshot_unittest.cc', - 'internal_api/public/sessions/sync_source_info_unittest.cc', - 'internal_api/syncapi_server_connection_manager_unittest.cc', - 'internal_api/sync_encryption_handler_impl_unittest.cc', - 'internal_api/sync_manager_impl_unittest.cc', - ], - 'conditions': [ - ['OS == "ios"', { - 'sources!': [ - 'internal_api/http_bridge_unittest.cc', - ], - }], - ], - }, - }, - - # Unit tests for the 'sync_api' target. This cannot be a static - # library because the unit test files have to be compiled directly - # into the executable, so we push the target files to the - # depending executable target via direct_dependent_settings. - { - 'target_name': 'sync_api_tests', - 'type': 'none', - # We only want unit test executables to include this target. - 'suppress_wildcard': 1, - 'dependencies': [ - '../base/base.gyp:base', - '../testing/gtest.gyp:gtest', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - 'sync_internal_api', - 'test_support_sync_internal_api', - ], - # Propagate all dependencies since the actual compilation - # happens in the dependents. - 'export_dependent_settings': [ - '../base/base.gyp:base', - '../testing/gtest.gyp:gtest', - 'protocol/sync_proto.gyp:sync_proto', - 'sync_core', - 'sync_internal_api', - 'test_support_sync_internal_api', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '..', - ], - 'sources': [ - 'api/sync_change_unittest.cc', - 'api/sync_error_unittest.cc', - 'api/sync_merge_result_unittest.cc', - ], - }, - }, - - # The unit test executable for sync tests. - { - 'target_name': 'sync_unit_tests', - 'type': '<(gtest_target_type)', - # Typed-parametrized tests generate exit-time destructors. - 'variables': { 'enable_wexit_time_destructors': 0, }, - 'dependencies': [ - '../base/base.gyp:run_all_unittests', - 'sync', - 'sync_api_tests', - 'sync_core_tests', - 'sync_internal_api_tests', - 'sync_notifier_tests', - ], - 'conditions': [ - # TODO(akalin): This is needed because histogram.cc uses - # leak_annotations.h, which pulls this in. Make 'base' - # propagate this dependency. - ['OS=="linux" and linux_use_tcmalloc==1', { - 'dependencies': [ - '../base/allocator/allocator.gyp:allocator', - ], - }], - ['OS == "android" and gtest_target_type == "shared_library"', { - 'dependencies': [ - '../testing/android/native_test.gyp:native_test_native_code', - ], - }], - ], - }, + 'includes': [ + 'sync_tests.gypi', ], + 'conditions': [ - ['OS != "ios"', { + # Notes: + # 1) In static mode, the public 'sync' target has a target type of 'none', + # and is composed of the static library targets 'sync_api', 'sync_core', + # 'sync_internal_api', 'sync_notifier', and 'sync_proto'. + # 2) In component mode, we build the public 'sync' target into a single DLL, + # which includes the contents of sync_api.gypi, sync_core.gypi, + # sync_internal_api.gypi, sync_notifier.gypi, and sync_proto.gypi. + # 3) All external targets that depend on anything in sync/ must simply + # declare a dependency on 'sync.gyp:sync' + ['component=="static_library"', { 'targets': [ + # The public sync static library target. { - 'target_name': 'sync_tools_helper', - 'type': 'static_library', - 'include_dirs': [ - '..', - ], + 'target_name': 'sync', + 'type': 'none', 'dependencies': [ - '../base/base.gyp:base', + 'sync_api', + 'sync_core', + 'sync_internal_api', 'sync_notifier', + 'sync_proto', ], 'export_dependent_settings': [ - '../base/base.gyp:base', 'sync_notifier', - ], - 'sources': [ - 'tools/null_invalidation_state_tracker.cc', - 'tools/null_invalidation_state_tracker.h', + 'sync_proto', ], }, - # A tool that can be used to launch a python sync server instance. + # The sync external API library. { - 'target_name': 'run_sync_testserver', - 'type': 'executable', - 'dependencies': [ - '../base/base.gyp:base', - '../base/base.gyp:test_support_base', - '../net/net.gyp:net_test_support', - '../testing/gtest.gyp:gtest', - 'test_support_sync_testserver', + 'target_name': 'sync_api', + 'type': 'static_library', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'includes': [ + 'sync_api.gypi', ], - 'sources': [ - 'tools/testserver/run_sync_testserver.cc', + 'dependencies': [ + 'sync_internal_api', + 'sync_proto', ], }, - # A tool to listen to sync notifications and print them out. + # The core sync library. { - 'target_name': 'sync_listen_notifications', - 'type': 'executable', + 'target_name': 'sync_core', + 'type': 'static_library', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'includes': [ + 'sync_core.gypi', + ], 'dependencies': [ - '../base/base.gyp:base', - '../jingle/jingle.gyp:notifier', - '../net/net.gyp:net', - '../net/net.gyp:net_test_support', - 'sync', - 'sync_tools_helper', + 'sync_proto', ], - 'sources': [ - 'tools/sync_listen_notifications.cc', + 'export_dependent_settings': [ + 'sync_proto', ], }, - # A standalone command-line sync client. + # The sync internal API library. { - 'target_name': 'sync_client', - 'type': 'executable', - 'defines': [ - 'SYNC_TEST', + 'target_name': 'sync_internal_api', + 'type': 'static_library', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'includes': [ + 'sync_internal_api.gypi', ], 'dependencies': [ - '../base/base.gyp:base', - '../jingle/jingle.gyp:notifier', - '../net/net.gyp:net', - '../net/net.gyp:net_test_support', - 'sync', - 'sync_tools_helper', + 'sync_core', + 'sync_notifier', + 'sync_proto', ], - 'sources': [ - 'tools/sync_client.cc', + 'export_dependent_settings': [ + 'sync_core', + 'sync_proto', ], }, - ], - }], - ['OS == "android"', { - 'targets': [ + + # The sync notifications library. { - 'target_name': 'sync_java', - 'type': 'none', - 'variables': { - 'package_name': 'sync', - 'java_in_dir': '../sync/android/java', - }, + 'target_name': 'sync_notifier', + 'type': 'static_library', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'includes': [ + 'sync_notifier.gypi', + ], 'dependencies': [ - '../base/base.gyp:base_java', - '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_javalib', - '../third_party/guava/guava.gyp:guava_javalib', - '../third_party/jsr-305/jsr-305.gyp:jsr_305_javalib', + 'sync_core', ], - 'includes': [ '../build/java.gypi' ], }, + + # The sync protocol buffer library. { - 'target_name': 'sync_javatests', - 'type': 'none', - 'variables': { - 'package_name': 'sync_javatests', - 'java_in_dir': '../sync/android/javatests', - }, - 'dependencies': [ - 'sync_java', - '../base/base.gyp:base_java_test_support', + 'target_name': 'sync_proto', + 'type': 'static_library', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'includes': [ + 'sync_proto.gypi', ], - 'includes': [ '../build/java.gypi' ], }, ], - }], - - # Special target to wrap a gtest_target_type==shared_library - # sync_unit_tests into an android apk for execution. - ['OS == "android" and gtest_target_type == "shared_library"', { + }, + { # component != static_library 'targets': [ + # The public sync shared library target. { - 'target_name': 'sync_unit_tests_apk', - 'type': 'none', - 'dependencies': [ - 'sync_unit_tests', + 'target_name': 'sync', + 'type': 'shared_library', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'includes': [ + 'sync_api.gypi', + 'sync_core.gypi', + 'sync_internal_api.gypi', + 'sync_notifier.gypi', + 'sync_proto.gypi', ], - 'variables': { - 'test_suite_name': 'sync_unit_tests', - 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)sync_unit_tests<(SHARED_LIB_SUFFIX)', - }, - 'includes': [ '../build/apk_test.gypi' ], }, ], }], diff --git a/sync/sync_api.gypi b/sync/sync_api.gypi new file mode 100644 index 0000000..188fc32 --- /dev/null +++ b/sync/sync_api.gypi @@ -0,0 +1,33 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'include_dirs': [ + '..', + ], + 'defines': [ + 'SYNC_IMPLEMENTATION', + ], + 'dependencies': [ + '../base/base.gyp:base', + ], + 'sources': [ + 'api/string_ordinal.h', + 'api/syncable_service.cc', + 'api/syncable_service.h', + 'api/sync_data.h', + 'api/sync_data.cc', + 'api/sync_change.h', + 'api/sync_change.cc', + 'api/sync_change_processor.h', + 'api/sync_change_processor.cc', + 'api/sync_error.h', + 'api/sync_error.cc', + 'api/sync_error_factory.h', + 'api/sync_error_factory.cc', + 'api/sync_merge_result.h', + 'api/sync_merge_result.cc', + 'api/time.h', + ], +} diff --git a/sync/sync_core.gypi b/sync/sync_core.gypi new file mode 100644 index 0000000..716f2af --- /dev/null +++ b/sync/sync_core.gypi @@ -0,0 +1,190 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'include_dirs': [ + '..', + ], + 'defines': [ + 'SYNC_IMPLEMENTATION', + ], + 'dependencies': [ + '../base/base.gyp:base', + '../base/base.gyp:base_i18n', + '../build/temp_gyp/googleurl.gyp:googleurl', + '../crypto/crypto.gyp:crypto', + '../google_apis/google_apis.gyp:google_apis', + '../net/net.gyp:net', + '../sql/sql.gyp:sql', + ], + 'conditions': [ + ['OS=="linux" and chromeos==1', { + # Required by get_session_name.cc on Chrome OS. + 'dependencies': [ + '../chromeos/chromeos.gyp:chromeos', + ], + }], + ], + 'sources': [ + 'base/sync_export.h', + 'engine/all_status.cc', + 'engine/all_status.h', + 'engine/apply_control_data_updates.cc', + 'engine/apply_control_data_updates.h', + 'engine/apply_updates_and_resolve_conflicts_command.cc', + 'engine/apply_updates_and_resolve_conflicts_command.h', + 'engine/backoff_delay_provider.cc', + 'engine/backoff_delay_provider.h', + 'engine/build_commit_command.cc', + 'engine/build_commit_command.h', + 'engine/commit.cc', + 'engine/commit.h', + 'engine/conflict_resolver.cc', + 'engine/conflict_resolver.h', + 'engine/conflict_util.cc', + 'engine/conflict_util.h', + 'engine/download_updates_command.cc', + 'engine/download_updates_command.h', + 'engine/get_commit_ids_command.cc', + 'engine/get_commit_ids_command.h', + 'engine/model_changing_syncer_command.cc', + 'engine/model_changing_syncer_command.h', + 'engine/net/server_connection_manager.cc', + 'engine/net/server_connection_manager.h', + 'engine/net/url_translator.cc', + 'engine/net/url_translator.h', + 'engine/nudge_source.cc', + 'engine/nudge_source.h', + 'engine/process_commit_response_command.cc', + 'engine/process_commit_response_command.h', + 'engine/process_updates_command.cc', + 'engine/process_updates_command.h', + 'engine/store_timestamps_command.cc', + 'engine/store_timestamps_command.h', + 'engine/sync_engine_event.cc', + 'engine/sync_engine_event.h', + 'engine/sync_scheduler.cc', + 'engine/sync_scheduler.h', + 'engine/sync_scheduler_impl.cc', + 'engine/sync_scheduler_impl.h', + 'engine/sync_session_job.cc', + 'engine/sync_session_job.h', + 'engine/syncer.cc', + 'engine/syncer.h', + 'engine/syncer_command.cc', + 'engine/syncer_command.h', + 'engine/syncer_proto_util.cc', + 'engine/syncer_proto_util.h', + 'engine/syncer_types.h', + 'engine/syncer_util.cc', + 'engine/syncer_util.h', + 'engine/throttled_data_type_tracker.cc', + 'engine/throttled_data_type_tracker.h', + 'engine/traffic_logger.cc', + 'engine/traffic_logger.h', + 'engine/traffic_recorder.cc', + 'engine/traffic_recorder.h', + 'engine/update_applicator.cc', + 'engine/update_applicator.h', + 'js/js_arg_list.cc', + 'js/js_arg_list.h', + 'js/js_backend.h', + 'js/js_controller.h', + 'js/js_event_details.cc', + 'js/js_event_details.h', + 'js/js_event_handler.h', + 'js/js_reply_handler.h', + 'js/sync_js_controller.cc', + 'js/sync_js_controller.h', + 'protocol/proto_enum_conversions.cc', + 'protocol/proto_enum_conversions.h', + 'protocol/proto_value_conversions.cc', + 'protocol/proto_value_conversions.h', + 'protocol/sync_protocol_error.cc', + 'protocol/sync_protocol_error.h', + 'sessions/debug_info_getter.h', + 'sessions/ordered_commit_set.cc', + 'sessions/ordered_commit_set.h', + 'sessions/status_controller.cc', + 'sessions/status_controller.h', + 'sessions/sync_session.cc', + 'sessions/sync_session.h', + 'sessions/sync_session_context.cc', + 'sessions/sync_session_context.h', + 'syncable/blob.h', + 'syncable/dir_open_result.h', + 'syncable/directory.cc', + 'syncable/directory.h', + 'syncable/directory_backing_store.cc', + 'syncable/directory_backing_store.h', + 'syncable/directory_change_delegate.h', + 'syncable/entry.cc', + 'syncable/entry.h', + 'syncable/entry_kernel.cc', + 'syncable/entry_kernel.h', + 'syncable/in_memory_directory_backing_store.cc', + 'syncable/in_memory_directory_backing_store.h', + 'syncable/invalid_directory_backing_store.cc', + 'syncable/invalid_directory_backing_store.h', + 'syncable/metahandle_set.h', + 'syncable/model_type.cc', + 'syncable/mutable_entry.cc', + 'syncable/mutable_entry.h', + 'syncable/nigori_handler.cc', + 'syncable/nigori_handler.h', + 'syncable/nigori_util.cc', + 'syncable/nigori_util.h', + 'syncable/on_disk_directory_backing_store.cc', + 'syncable/on_disk_directory_backing_store.h', + 'syncable/scoped_kernel_lock.h', + 'syncable/syncable-inl.h', + 'syncable/syncable_base_transaction.cc', + 'syncable/syncable_base_transaction.h', + 'syncable/syncable_changes_version.h', + 'syncable/syncable_columns.h', + 'syncable/syncable_delete_journal.cc', + 'syncable/syncable_delete_journal.h', + 'syncable/syncable_enum_conversions.cc', + 'syncable/syncable_enum_conversions.h', + 'syncable/syncable_id.cc', + 'syncable/syncable_id.h', + 'syncable/syncable_proto_util.cc', + 'syncable/syncable_proto_util.h', + 'syncable/syncable_read_transaction.cc', + 'syncable/syncable_read_transaction.h', + 'syncable/syncable_util.cc', + 'syncable/syncable_util.h', + 'syncable/syncable_write_transaction.cc', + 'syncable/syncable_write_transaction.h', + 'syncable/transaction_observer.h', + 'syncable/write_transaction_info.cc', + 'syncable/write_transaction_info.h', + 'util/cryptographer.cc', + 'util/cryptographer.h', + + # TODO(akalin): Figure out a better place to put + # data_encryption_win*; it's also used by autofill. + 'util/data_encryption_win.cc', + 'util/data_encryption_win.h', + + 'util/data_type_histogram.h', + 'util/encryptor.h', + 'util/extensions_activity_monitor.cc', + 'util/extensions_activity_monitor.h', + 'util/get_session_name.cc', + 'util/get_session_name.h', + 'util/get_session_name_ios.mm', + 'util/get_session_name_ios.h', + 'util/get_session_name_mac.mm', + 'util/get_session_name_mac.h', + 'util/get_session_name_win.cc', + 'util/get_session_name_win.h', + 'util/logging.cc', + 'util/logging.h', + 'util/nigori.cc', + 'util/nigori.h', + 'util/time.cc', + 'util/time.h', + ], +} diff --git a/sync/sync_internal_api.gypi b/sync/sync_internal_api.gypi new file mode 100644 index 0000000..04c36a6 --- /dev/null +++ b/sync/sync_internal_api.gypi @@ -0,0 +1,111 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'include_dirs': [ + '..', + ], + 'defines': [ + 'SYNC_IMPLEMENTATION', + ], + 'dependencies': [ + '../base/base.gyp:base', + '../build/temp_gyp/googleurl.gyp:googleurl', + '../net/net.gyp:net', + ], + 'sources': [ + 'internal_api/base_node.cc', + 'internal_api/base_transaction.cc', + 'internal_api/change_record.cc', + 'internal_api/change_reorder_buffer.cc', + 'internal_api/change_reorder_buffer.h', + 'internal_api/delete_journal.cc', + 'internal_api/debug_info_event_listener.cc', + 'internal_api/debug_info_event_listener.h', + 'internal_api/http_bridge.cc', + 'internal_api/internal_components_factory_impl.cc', + 'internal_api/js_mutation_event_observer.cc', + 'internal_api/js_mutation_event_observer.h', + 'internal_api/js_sync_encryption_handler_observer.cc', + 'internal_api/js_sync_encryption_handler_observer.h', + 'internal_api/js_sync_manager_observer.cc', + 'internal_api/js_sync_manager_observer.h', + 'internal_api/public/base/enum_set.h', + 'internal_api/public/base/invalidation.cc', + 'internal_api/public/base/invalidation.h', + 'internal_api/public/base/model_type.h', + 'internal_api/public/base/model_type_invalidation_map.cc', + 'internal_api/public/base/model_type_invalidation_map.h', + 'internal_api/public/base/node_ordinal.cc', + 'internal_api/public/base/node_ordinal.h', + 'internal_api/public/base/ordinal.h', + 'internal_api/public/base/progress_marker_map.cc', + 'internal_api/public/base/progress_marker_map.h', + 'internal_api/public/base/unique_position.cc', + 'internal_api/public/base/unique_position.h', + 'internal_api/public/base_node.h', + 'internal_api/public/base_transaction.h', + 'internal_api/public/change_record.h', + 'internal_api/public/configure_reason.h', + 'internal_api/public/data_type_association_stats.cc', + 'internal_api/public/data_type_association_stats.h', + 'internal_api/public/data_type_debug_info_listener.h', + 'internal_api/public/delete_journal.h', + 'internal_api/public/engine/model_safe_worker.cc', + 'internal_api/public/engine/model_safe_worker.h', + 'internal_api/public/engine/passive_model_worker.cc', + 'internal_api/public/engine/passive_model_worker.h', + 'internal_api/public/engine/polling_constants.cc', + 'internal_api/public/engine/polling_constants.h', + 'internal_api/public/engine/sync_status.cc', + 'internal_api/public/engine/sync_status.h', + 'internal_api/public/http_bridge.h', + 'internal_api/public/http_post_provider_factory.h', + 'internal_api/public/http_post_provider_interface.h', + 'internal_api/public/internal_components_factory_impl.h', + 'internal_api/public/internal_components_factory.h', + 'internal_api/public/read_node.h', + 'internal_api/public/read_transaction.h', + 'internal_api/public/sessions/model_neutral_state.cc', + 'internal_api/public/sessions/model_neutral_state.h', + 'internal_api/public/sessions/sync_session_snapshot.cc', + 'internal_api/public/sessions/sync_session_snapshot.h', + 'internal_api/public/sessions/sync_source_info.cc', + 'internal_api/public/sessions/sync_source_info.h', + 'internal_api/public/sync_encryption_handler.cc', + 'internal_api/public/sync_encryption_handler.h', + 'internal_api/public/sync_manager_factory.h', + 'internal_api/public/sync_manager.cc', + 'internal_api/public/sync_manager.h', + 'internal_api/public/user_share.h', + 'internal_api/public/util/experiments.h', + 'internal_api/public/util/immutable.h', + 'internal_api/public/util/report_unrecoverable_error_function.h', + 'internal_api/public/util/sync_string_conversions.cc', + 'internal_api/public/util/sync_string_conversions.h', + 'internal_api/public/util/syncer_error.cc', + 'internal_api/public/util/syncer_error.h', + 'internal_api/public/util/unrecoverable_error_handler.h', + 'internal_api/public/util/unrecoverable_error_info.cc', + 'internal_api/public/util/unrecoverable_error_info.h', + 'internal_api/public/util/weak_handle.cc', + 'internal_api/public/util/weak_handle.h', + 'internal_api/public/write_node.h', + 'internal_api/public/write_transaction.h', + 'internal_api/read_node.cc', + 'internal_api/read_transaction.cc', + 'internal_api/sync_encryption_handler_impl.cc', + 'internal_api/sync_encryption_handler_impl.h', + 'internal_api/sync_manager_factory.cc', + 'internal_api/sync_manager_impl.cc', + 'internal_api/sync_manager_impl.h', + 'internal_api/syncapi_internal.cc', + 'internal_api/syncapi_internal.h', + 'internal_api/syncapi_server_connection_manager.cc', + 'internal_api/syncapi_server_connection_manager.h', + 'internal_api/user_share.cc', + 'internal_api/write_node.cc', + 'internal_api/write_transaction.cc', + ], +} diff --git a/sync/sync_notifier.gypi b/sync/sync_notifier.gypi new file mode 100644 index 0000000..18ef4b9 --- /dev/null +++ b/sync/sync_notifier.gypi @@ -0,0 +1,64 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'include_dirs': [ + '..', + ], + 'defines': [ + 'SYNC_IMPLEMENTATION', + ], + 'dependencies': [ + '../base/base.gyp:base', + '../jingle/jingle.gyp:jingle_glue', + '../jingle/jingle.gyp:notifier', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', + # TODO(akalin): Remove this (http://crbug.com/133352). + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp', + '../third_party/libjingle/libjingle.gyp:libjingle', + ], + 'export_dependent_settings': [ + '../jingle/jingle.gyp:notifier', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', + ], + 'sources': [ + 'notifier/invalidation_handler.h', + 'notifier/invalidation_state_tracker.cc', + 'notifier/invalidation_state_tracker.h', + 'notifier/invalidation_util.cc', + 'notifier/invalidation_util.h', + 'notifier/invalidator_factory.cc', + 'notifier/invalidator_factory.h', + 'notifier/invalidator.h', + 'notifier/invalidator_registrar.cc', + 'notifier/invalidator_registrar.h', + 'notifier/invalidator_state.cc', + 'notifier/invalidator_state.h', + 'notifier/object_id_invalidation_map.cc', + 'notifier/object_id_invalidation_map.h', + ], + 'conditions': [ + ['OS != "android"', { + 'sources': [ + 'notifier/ack_tracker.cc', + 'notifier/ack_tracker.h', + 'notifier/invalidation_notifier.cc', + 'notifier/invalidation_notifier.h', + 'notifier/non_blocking_invalidator.cc', + 'notifier/non_blocking_invalidator.h', + 'notifier/p2p_invalidator.cc', + 'notifier/p2p_invalidator.h', + 'notifier/push_client_channel.cc', + 'notifier/push_client_channel.h', + 'notifier/registration_manager.cc', + 'notifier/registration_manager.h', + 'notifier/state_writer.h', + 'notifier/sync_invalidation_listener.cc', + 'notifier/sync_invalidation_listener.h', + 'notifier/sync_system_resources.cc', + 'notifier/sync_system_resources.h', + ], + }], + ], +} diff --git a/sync/sync_proto.gypi b/sync/sync_proto.gypi new file mode 100644 index 0000000..0e288fb --- /dev/null +++ b/sync/sync_proto.gypi @@ -0,0 +1,51 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'include_dirs': [ + '..', + ], + 'defines': [ + 'SYNC_IMPLEMENTATION', + ], + 'sources': [ + 'protocol/app_notification_specifics.proto', + 'protocol/app_setting_specifics.proto', + 'protocol/app_specifics.proto', + 'protocol/autofill_specifics.proto', + 'protocol/bookmark_specifics.proto', + 'protocol/client_commands.proto', + 'protocol/client_debug_info.proto', + 'protocol/device_info_specifics.proto', + 'protocol/dictionary_specifics.proto', + 'protocol/encryption.proto', + 'protocol/experiments_specifics.proto', + 'protocol/extension_setting_specifics.proto', + 'protocol/extension_specifics.proto', + 'protocol/get_updates_caller_info.proto', + 'protocol/history_delete_directive_specifics.proto', + 'protocol/nigori_specifics.proto', + 'protocol/password_specifics.proto', + 'protocol/preference_specifics.proto', + 'protocol/priority_preference_specifics.proto', + 'protocol/search_engine_specifics.proto', + 'protocol/session_specifics.proto', + 'protocol/sync.proto', + 'protocol/sync_enums.proto', + 'protocol/synced_notification_specifics.proto', + 'protocol/test.proto', + 'protocol/theme_specifics.proto', + 'protocol/typed_url_specifics.proto', + 'protocol/unique_position.proto', + ], + 'variables': { + 'proto_in_dir': './protocol', + 'proto_out_dir': 'sync/protocol', + 'cc_generator_options': 'dllexport_decl=SYNC_EXPORT:', + 'cc_include': 'sync/base/sync_export.h', + }, + 'includes': [ + '../build/protoc.gypi' + ], +} diff --git a/sync/sync_tests.gypi b/sync/sync_tests.gypi new file mode 100644 index 0000000..81424c8 --- /dev/null +++ b/sync/sync_tests.gypi @@ -0,0 +1,617 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + # Test support files for the 'sync_core' target. + { + 'target_name': 'test_support_sync_core', + 'type': 'static_library', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'include_dirs': [ + '..', + ], + 'defines': [ + 'SYNC_TEST' + ], + 'dependencies': [ + '../base/base.gyp:base', + '../testing/gmock.gyp:gmock', + '../testing/gtest.gyp:gtest', + 'sync', + ], + 'export_dependent_settings': [ + '../testing/gmock.gyp:gmock', + '../testing/gtest.gyp:gtest', + 'sync', + ], + 'sources': [ + 'js/js_test_util.cc', + 'js/js_test_util.h', + 'sessions/test_util.cc', + 'sessions/test_util.h', + 'syncable/syncable_mock.cc', + 'syncable/syncable_mock.h', + 'test/callback_counter.h', + 'test/engine/fake_model_worker.cc', + 'test/engine/fake_model_worker.h', + 'test/engine/fake_sync_scheduler.cc', + 'test/engine/fake_sync_scheduler.h', + 'test/engine/mock_connection_manager.cc', + 'test/engine/mock_connection_manager.h', + 'test/engine/syncer_command_test.cc', + 'test/engine/syncer_command_test.h', + 'test/engine/test_directory_setter_upper.cc', + 'test/engine/test_directory_setter_upper.h', + 'test/engine/test_id_factory.h', + 'test/engine/test_syncable_utils.cc', + 'test/engine/test_syncable_utils.h', + 'test/fake_encryptor.cc', + 'test/fake_encryptor.h', + 'test/fake_sync_encryption_handler.h', + 'test/fake_sync_encryption_handler.cc', + 'test/fake_extensions_activity_monitor.cc', + 'test/fake_extensions_activity_monitor.h', + 'test/test_transaction_observer.cc', + 'test/test_transaction_observer.h', + 'test/null_directory_change_delegate.cc', + 'test/null_directory_change_delegate.h', + 'test/null_transaction_observer.cc', + 'test/null_transaction_observer.h', + 'test/sessions/test_scoped_session_event_listener.h', + 'test/test_directory_backing_store.cc', + 'test/test_directory_backing_store.h', + 'util/test_unrecoverable_error_handler.cc', + 'util/test_unrecoverable_error_handler.h', + ], + }, + + # Test support files for the python sync test server. + { + 'target_name': 'test_support_sync_testserver', + 'type': 'static_library', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'include_dirs': [ + '..', + ], + 'dependencies': [ + '../base/base.gyp:base', + '../net/net.gyp:net_test_support', + # The sync test server uses Python modules generated by the sync protos. + '../third_party/protobuf/protobuf.gyp:py_proto', + 'sync', + ], + 'export_dependent_settings': [ + '../base/base.gyp:base', + '../net/net.gyp:net_test_support', + ], + 'sources': [ + 'test/local_sync_test_server.cc', + 'test/local_sync_test_server.h', + ], + }, + + # Test support files for the 'sync_notifier' target. + { + 'target_name': 'test_support_sync_notifier', + 'type': 'static_library', + 'include_dirs': [ + '..', + ], + 'defines': [ + 'SYNC_TEST' + ], + 'dependencies': [ + '../testing/gmock.gyp:gmock', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp', + 'sync', + ], + 'export_dependent_settings': [ + '../testing/gmock.gyp:gmock', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp', + 'sync', + ], + 'sources': [ + 'notifier/fake_invalidation_state_tracker.cc', + 'notifier/fake_invalidation_state_tracker.h', + 'notifier/fake_invalidator.cc', + 'notifier/fake_invalidator.h', + 'notifier/fake_invalidation_handler.cc', + 'notifier/fake_invalidation_handler.h', + 'notifier/invalidator_test_template.cc', + 'notifier/invalidator_test_template.h', + 'notifier/object_id_invalidation_map_test_util.cc', + 'notifier/object_id_invalidation_map_test_util.h', + ], + }, + + # Test support files for the 'sync_internal_api' target. + { + 'target_name': 'test_support_sync_internal_api', + 'type': 'static_library', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'include_dirs': [ + '..', + ], + 'defines': [ + 'SYNC_TEST' + ], + 'dependencies': [ + '../base/base.gyp:base', + '../testing/gtest.gyp:gtest', + 'sync', + 'test_support_sync_core', + ], + 'export_dependent_settings': [ + '../testing/gtest.gyp:gtest', + 'sync', + 'test_support_sync_core', + ], + 'sources': [ + 'internal_api/public/base/invalidation_test_util.cc', + 'internal_api/public/base/invalidation_test_util.h', + 'internal_api/public/base/model_type_invalidation_map_test_util.cc', + 'internal_api/public/base/model_type_invalidation_map_test_util.h', + 'internal_api/public/base/model_type_test_util.cc', + 'internal_api/public/base/model_type_test_util.h', + 'internal_api/public/test/fake_sync_manager.h', + 'internal_api/public/test/test_entry_factory.h', + 'internal_api/public/test/test_internal_components_factory.h', + 'internal_api/public/test/test_user_share.h', + 'internal_api/test/fake_sync_manager.cc', + 'internal_api/test/test_entry_factory.cc', + 'internal_api/test/test_internal_components_factory.cc', + 'internal_api/test/test_user_share.cc', + ], + }, + + # Test support files for the 'sync_api' target. + { + 'target_name': 'test_support_sync_api', + 'type': 'static_library', + 'include_dirs': [ + '..', + ], + 'defines': [ + 'SYNC_TEST' + ], + 'dependencies': [ + '../testing/gmock.gyp:gmock', + 'sync', + ], + 'export_dependent_settings': [ + '../testing/gmock.gyp:gmock', + 'sync', + ], + 'sources': [ + 'api/fake_syncable_service.cc', + 'api/fake_syncable_service.h', + 'api/sync_error_factory_mock.cc', + 'api/sync_error_factory_mock.h', + ], + }, + + # Unit tests for the 'sync_core' target. This cannot be a static + # library because the unit test files have to be compiled directly + # into the executable, so we push the target files to the + # depending executable target via direct_dependent_settings. + { + 'target_name': 'sync_core_tests', + 'type': 'none', + # We only want unit test executables to include this target. + 'suppress_wildcard': 1, + 'dependencies': [ + '../base/base.gyp:base', + '../sql/sql.gyp:sql', + '../testing/gmock.gyp:gmock', + '../testing/gtest.gyp:gtest', + 'sync', + 'test_support_sync_core', + ], + 'conditions': [ + ['OS=="linux" and chromeos==1', { + # Required by get_session_name_unittest.cc on Chrome OS. + 'dependencies': [ + '../chromeos/chromeos.gyp:chromeos', + ], + }], + ], + # Propagate all dependencies since the actual compilation + # happens in the dependents. + 'export_dependent_settings': [ + '../base/base.gyp:base', + '../sql/sql.gyp:sql', + '../testing/gmock.gyp:gmock', + '../testing/gtest.gyp:gtest', + 'sync', + 'test_support_sync_core', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '..', + ], + 'sources': [ + 'internal_api/public/base/enum_set_unittest.cc', + 'internal_api/public/base/model_type_invalidation_map_unittest.cc', + 'internal_api/public/base/node_ordinal_unittest.cc', + 'internal_api/public/base/ordinal_unittest.cc', + 'internal_api/public/base/unique_position_unittest.cc', + 'internal_api/public/engine/model_safe_worker_unittest.cc', + 'internal_api/public/util/immutable_unittest.cc', + 'internal_api/public/util/weak_handle_unittest.cc', + 'engine/apply_control_data_updates_unittest.cc', + 'engine/apply_updates_and_resolve_conflicts_command_unittest.cc', + 'engine/backoff_delay_provider_unittest.cc', + 'engine/build_commit_command_unittest.cc', + 'engine/download_updates_command_unittest.cc', + 'engine/model_changing_syncer_command_unittest.cc', + 'engine/process_commit_response_command_unittest.cc', + 'engine/process_updates_command_unittest.cc', + 'engine/store_timestamps_command_unittest.cc', + 'engine/sync_session_job_unittest.cc', + 'engine/sync_scheduler_unittest.cc', + 'engine/sync_scheduler_whitebox_unittest.cc', + 'engine/syncer_proto_util_unittest.cc', + 'engine/syncer_unittest.cc', + 'engine/throttled_data_type_tracker_unittest.cc', + 'engine/traffic_recorder_unittest.cc', + 'js/js_arg_list_unittest.cc', + 'js/js_event_details_unittest.cc', + 'js/sync_js_controller_unittest.cc', + 'protocol/proto_enum_conversions_unittest.cc', + 'protocol/proto_value_conversions_unittest.cc', + 'sessions/ordered_commit_set_unittest.cc', + 'sessions/status_controller_unittest.cc', + 'sessions/sync_session_unittest.cc', + 'syncable/directory_backing_store_unittest.cc', + 'syncable/model_type_unittest.cc', + 'syncable/nigori_util_unittest.cc', + 'syncable/syncable_enum_conversions_unittest.cc', + 'syncable/syncable_id_unittest.cc', + 'syncable/syncable_unittest.cc', + 'syncable/syncable_util_unittest.cc', + 'util/cryptographer_unittest.cc', + 'util/data_encryption_win_unittest.cc', + 'util/data_type_histogram_unittest.cc', + 'util/get_session_name_unittest.cc', + 'util/nigori_unittest.cc', + 'util/protobuf_unittest.cc', + ], + 'conditions': [ + ['OS == "ios" and coverage != 0', { + 'sources!': [ + # These sources can't be built with coverage due to a toolchain + # bug: http://openradar.appspot.com/radar?id=1499403 + 'engine/syncer_unittest.cc', + + # These tests crash when run with coverage turned on due to an + # issue with llvm_gcda_increment_indirect_counter: + # http://crbug.com/156058 + 'syncable/directory_backing_store_unittest.cc', + ], + }], + ], + }, + }, + + # Unit tests for the 'sync_notifier' target. This cannot be a static + # library because the unit test files have to be compiled directly + # into the executable, so we push the target files to the + # depending executable target via direct_dependent_settings. + { + 'target_name': 'sync_notifier_tests', + 'type': 'none', + # We only want unit test executables to include this target. + 'suppress_wildcard': 1, + 'dependencies': [ + '../base/base.gyp:base', + '../jingle/jingle.gyp:notifier_test_util', + '../net/net.gyp:net_test_support', + '../testing/gmock.gyp:gmock', + '../testing/gtest.gyp:gtest', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', + '../third_party/libjingle/libjingle.gyp:libjingle', + 'sync', + 'test_support_sync_notifier', + ], + # Propagate all dependencies since the actual compilation + # happens in the dependents. + 'export_dependent_settings': [ + '../base/base.gyp:base', + '../jingle/jingle.gyp:notifier_test_util', + '../net/net.gyp:net_test_support', + '../testing/gmock.gyp:gmock', + '../testing/gtest.gyp:gtest', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation', + '../third_party/libjingle/libjingle.gyp:libjingle', + 'sync', + 'test_support_sync_notifier', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '..', + ], + 'sources': [ + 'notifier/invalidator_factory_unittest.cc', + ], + 'conditions': [ + ['OS != "android"', { + 'sources': [ + 'notifier/ack_tracker_unittest.cc', + 'notifier/fake_invalidator_unittest.cc', + 'notifier/invalidation_notifier_unittest.cc', + 'notifier/invalidator_registrar_unittest.cc', + 'notifier/non_blocking_invalidator_unittest.cc', + 'notifier/p2p_invalidator_unittest.cc', + 'notifier/push_client_channel_unittest.cc', + 'notifier/registration_manager_unittest.cc', + 'notifier/sync_invalidation_listener_unittest.cc', + 'notifier/sync_system_resources_unittest.cc', + ], + }], + ], + }, + }, + + # Unit tests for the 'sync_internal_api' target. This cannot be a static + # library because the unit test files have to be compiled directly + # into the executable, so we push the target files to the + # depending executable target via direct_dependent_settings. + { + 'target_name': 'sync_internal_api_tests', + 'type': 'none', + # We only want unit test executables to include this target. + 'suppress_wildcard': 1, + 'dependencies': [ + '../base/base.gyp:base', + '../net/net.gyp:net', + '../net/net.gyp:net_test_support', + '../testing/gmock.gyp:gmock', + '../testing/gtest.gyp:gtest', + 'sync', + 'test_support_sync_internal_api', + ], + # Propagate all dependencies since the actual compilation + # happens in the dependents. + 'export_dependent_settings': [ + '../base/base.gyp:base', + '../net/net.gyp:net', + '../net/net.gyp:net_test_support', + '../testing/gmock.gyp:gmock', + '../testing/gtest.gyp:gtest', + 'sync', + 'test_support_sync_internal_api', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '..', + ], + 'sources': [ + 'internal_api/debug_info_event_listener_unittest.cc', + 'internal_api/http_bridge_unittest.cc', + 'internal_api/js_mutation_event_observer_unittest.cc', + 'internal_api/js_sync_encryption_handler_observer_unittest.cc', + 'internal_api/js_sync_manager_observer_unittest.cc', + 'internal_api/public/change_record_unittest.cc', + 'internal_api/public/sessions/sync_session_snapshot_unittest.cc', + 'internal_api/public/sessions/sync_source_info_unittest.cc', + 'internal_api/syncapi_server_connection_manager_unittest.cc', + 'internal_api/sync_encryption_handler_impl_unittest.cc', + 'internal_api/sync_manager_impl_unittest.cc', + ], + 'conditions': [ + ['OS == "ios"', { + 'sources!': [ + 'internal_api/http_bridge_unittest.cc', + ], + }], + ], + }, + }, + + # Unit tests for the 'sync_api' target. This cannot be a static + # library because the unit test files have to be compiled directly + # into the executable, so we push the target files to the + # depending executable target via direct_dependent_settings. + { + 'target_name': 'sync_api_tests', + 'type': 'none', + # We only want unit test executables to include this target. + 'suppress_wildcard': 1, + 'dependencies': [ + '../base/base.gyp:base', + '../testing/gtest.gyp:gtest', + 'sync', + 'test_support_sync_internal_api', + ], + # Propagate all dependencies since the actual compilation + # happens in the dependents. + 'export_dependent_settings': [ + '../base/base.gyp:base', + '../testing/gtest.gyp:gtest', + 'sync', + 'test_support_sync_internal_api', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '..', + ], + 'sources': [ + 'api/sync_change_unittest.cc', + 'api/sync_error_unittest.cc', + 'api/sync_merge_result_unittest.cc', + ], + }, + }, + + # The unit test executable for sync tests. + { + 'target_name': 'sync_unit_tests', + 'type': '<(gtest_target_type)', + # Typed-parametrized tests generate exit-time destructors. + 'variables': { 'enable_wexit_time_destructors': 0, }, + 'defines': [ + 'SYNC_TEST', + ], + 'dependencies': [ + '../base/base.gyp:run_all_unittests', + 'sync_api_tests', + 'sync_core_tests', + 'sync_internal_api_tests', + 'sync_notifier_tests', + ], + 'conditions': [ + # TODO(akalin): This is needed because histogram.cc uses + # leak_annotations.h, which pulls this in. Make 'base' + # propagate this dependency. + ['OS=="linux" and linux_use_tcmalloc==1', { + 'dependencies': [ + '../base/allocator/allocator.gyp:allocator', + ], + }], + ['OS == "android" and gtest_target_type == "shared_library"', { + 'dependencies': [ + '../testing/android/native_test.gyp:native_test_native_code', + ], + }], + ], + }, + ], + 'conditions': [ + ['OS != "ios"', { + 'targets': [ + { + 'target_name': 'sync_tools_helper', + 'type': 'static_library', + 'defines': [ + 'SYNC_IMPLEMENTATION', + ], + 'include_dirs': [ + '..', + ], + 'dependencies': [ + '../base/base.gyp:base', + 'sync', + ], + 'export_dependent_settings': [ + '../base/base.gyp:base', + 'sync', + ], + 'sources': [ + 'tools/null_invalidation_state_tracker.cc', + 'tools/null_invalidation_state_tracker.h', + ], + }, + + # A tool that can be used to launch a python sync server instance. + { + 'target_name': 'run_sync_testserver', + 'type': 'executable', + 'dependencies': [ + '../base/base.gyp:base', + '../base/base.gyp:test_support_base', + '../net/net.gyp:net_test_support', + '../testing/gtest.gyp:gtest', + 'test_support_sync_testserver', + ], + 'sources': [ + 'tools/testserver/run_sync_testserver.cc', + ], + }, + + # A tool to listen to sync notifications and print them out. + { + 'target_name': 'sync_listen_notifications', + 'type': 'executable', + 'defines': [ + 'SYNC_TEST', + ], + 'dependencies': [ + '../base/base.gyp:base', + '../jingle/jingle.gyp:notifier', + '../net/net.gyp:net', + '../net/net.gyp:net_test_support', + 'sync', + 'sync_tools_helper', + ], + 'sources': [ + 'tools/sync_listen_notifications.cc', + ], + }, + + # A standalone command-line sync client. + { + 'target_name': 'sync_client', + 'type': 'executable', + 'defines': [ + 'SYNC_TEST', + ], + 'dependencies': [ + '../base/base.gyp:base', + '../jingle/jingle.gyp:notifier', + '../net/net.gyp:net', + '../net/net.gyp:net_test_support', + 'sync', + 'sync_tools_helper', + 'test_support_sync_core' + ], + 'sources': [ + 'tools/sync_client.cc', + ], + }, + ], + }], + ['OS == "android"', { + 'targets': [ + { + 'target_name': 'sync_java', + 'type': 'none', + 'variables': { + 'package_name': 'sync', + 'java_in_dir': '../sync/android/java', + }, + 'dependencies': [ + '../base/base.gyp:base_java', + '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_javalib', + '../third_party/guava/guava.gyp:guava_javalib', + '../third_party/jsr-305/jsr-305.gyp:jsr_305_javalib', + ], + 'includes': [ '../build/java.gypi' ], + }, + { + 'target_name': 'sync_javatests', + 'type': 'none', + 'variables': { + 'package_name': 'sync_javatests', + 'java_in_dir': '../sync/android/javatests', + }, + 'dependencies': [ + 'sync_java', + '../base/base.gyp:base_java_test_support', + ], + 'includes': [ '../build/java.gypi' ], + }, + ], + }], + + # Special target to wrap a gtest_target_type==shared_library + # sync_unit_tests into an android apk for execution. + ['OS == "android" and gtest_target_type == "shared_library"', { + 'targets': [ + { + 'target_name': 'sync_unit_tests_apk', + 'type': 'none', + 'dependencies': [ + 'sync_unit_tests', + ], + 'variables': { + 'test_suite_name': 'sync_unit_tests', + 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)sync_unit_tests<(SHARED_LIB_SUFFIX)', + }, + 'includes': [ '../build/apk_test.gypi' ], + }, + ], + }], + ], +} diff --git a/sync/syncable/syncable_base_transaction.cc b/sync/syncable/syncable_base_transaction.cc index 0404d94..d068bb9 100644 --- a/sync/syncable/syncable_base_transaction.cc +++ b/sync/syncable/syncable_base_transaction.cc @@ -10,6 +10,14 @@ namespace syncer { namespace syncable { +Directory* BaseTransaction::directory() const { + return directory_; +} + +Id BaseTransaction::root_id() const { + return Id(); +} + void BaseTransaction::Lock() { TRACE_EVENT2("sync_lock_contention", "AcquireLock", "src_file", from_here_.file_name(), diff --git a/sync/syncable/syncable_base_transaction.h b/sync/syncable/syncable_base_transaction.h index 763f68d..e15a38b 100644 --- a/sync/syncable/syncable_base_transaction.h +++ b/sync/syncable/syncable_base_transaction.h @@ -31,10 +31,10 @@ enum WriterTag { // Make sure to update this if you update WriterTag. std::string WriterTagToString(WriterTag writer_tag); -class SYNC_EXPORT_PRIVATE BaseTransaction { +class SYNC_EXPORT BaseTransaction { public: - inline Directory* directory() const { return directory_; } - inline Id root_id() const { return Id(); } + Directory* directory() const; + Id root_id() const; virtual ~BaseTransaction(); diff --git a/sync/syncable/syncable_delete_journal.h b/sync/syncable/syncable_delete_journal.h index 7d4224f..a4bf9ce 100644 --- a/sync/syncable/syncable_delete_journal.h +++ b/sync/syncable/syncable_delete_journal.h @@ -9,6 +9,7 @@ #include "base/gtest_prod_util.h" #include "base/synchronization/lock.h" +#include "sync/base/sync_export.h" #include "sync/syncable/metahandle_set.h" #include "sync/syncable/syncable-inl.h" @@ -25,7 +26,7 @@ typedef std::set > JournalIndex; // DeleteJournal is thread-safe and can be accessed on any thread. Has to hold // a valid transaction object when calling methods of DeleteJournal, thus each // method requires a non-null |trans| parameter. -class DeleteJournal { +class SYNC_EXPORT_PRIVATE DeleteJournal { public: FRIEND_TEST_ALL_PREFIXES(SyncableDirectoryTest, ManageDeleteJournals); diff --git a/sync/syncable/syncable_read_transaction.h b/sync/syncable/syncable_read_transaction.h index ecaf59b..2b9729d 100644 --- a/sync/syncable/syncable_read_transaction.h +++ b/sync/syncable/syncable_read_transaction.h @@ -13,7 +13,7 @@ class ReadTransaction; namespace syncable { // Locks db in constructor, unlocks in destructor. -class SYNC_EXPORT_PRIVATE ReadTransaction : public BaseTransaction { +class SYNC_EXPORT ReadTransaction : public BaseTransaction { public: ReadTransaction(const tracked_objects::Location& from_here, Directory* directory); diff --git a/sync/syncable/syncable_write_transaction.h b/sync/syncable/syncable_write_transaction.h index ea52d45..0debaa5 100644 --- a/sync/syncable/syncable_write_transaction.h +++ b/sync/syncable/syncable_write_transaction.h @@ -15,7 +15,7 @@ namespace syncable { SYNC_EXPORT extern const int64 kInvalidTransactionVersion; // Locks db in constructor, unlocks in destructor. -class SYNC_EXPORT_PRIVATE WriteTransaction : public BaseTransaction { +class SYNC_EXPORT WriteTransaction : public BaseTransaction { public: WriteTransaction(const tracked_objects::Location& from_here, WriterTag writer, Directory* directory); -- cgit v1.1