summaryrefslogtreecommitdiffstats
path: root/sync/engine
Commit message (Collapse)AuthorAgeFilesLines
* [Sync] Accumulate GU response chunks in the Worker.maxbogue2016-03-245-93/+128
| | | | | | | | | | | | This change renames "pending" updates in the worker to "encrypted" updates and repurposes "pending" to refer to the updates being accumulated for sending to the processor. BUG=596232 Review URL: https://codereview.chromium.org/1814823006 Cr-Commit-Position: refs/heads/master@{#382994}
* [Sync] USS: Clean up ModelTypeWorker a little bit.maxbogue2016-03-215-129/+89
| | | | | | | | | | Add some helper functions, use cleaner syntax, and more. BUG= Review URL: https://codereview.chromium.org/1815793002 Cr-Commit-Position: refs/heads/master@{#382412}
* [Sync] Adding device count histogram based off pulsing device info.skym2016-03-051-1/+1
| | | | | | | | | | Currently pulsing device info once per day, and counting inactive at 14 days. The intention is to setup a delete directive from the server to remove significantly old device infos, for example 60 days, one this reaches stable. The pulsing is not triggered off other sync actions, was not able to find an elegant/simple way to do this. Keying off sessions changes doesn't work if the sessions data type is disabled, and keying off a sync thread commit is problematic because we'd need to jump threads. BUG=590006 Review URL: https://codereview.chromium.org/1764703002 Cr-Commit-Position: refs/heads/master@{#379421}
* [Sync] Rename to (Processor|Worker)EntityTracker for clarity.maxbogue2016-03-015-74/+78
| | | | | | | | | | | | The names ModelTypeEntity and EntityTracker did not express the purposes and the similarities between the classes well. They are each essentially internal to their respective components, and they each handle the logic of tracking what's necessary for an entity in that component. I think these names are much clearer. Review URL: https://codereview.chromium.org/1739423002 Cr-Commit-Position: refs/heads/master@{#378348}
* sync: Add out-of-line copy ctors for complex classes.vmpstr2016-02-262-0/+5
| | | | | | | | | | | | | This patch adds out of line copy constructors for classes that our clang-plugin considers heavy. This is an effort to enable copy constructor checks by default. BUG=436357 R=pavely@chromium.org, dcheng@chromium.org, thakis@chromium.org Review URL: https://codereview.chromium.org/1727833003 Cr-Commit-Position: refs/heads/master@{#377734}
* [Sync] USS: Remove pending updates from SharedModelTypeProcessor.maxbogue2016-02-253-31/+11
| | | | | | | | | | We are planning to handle these in the worker in a future update. BUG=529498 Review URL: https://codereview.chromium.org/1725573002 Cr-Commit-Position: refs/heads/master@{#377673}
* [Sync] Remove backup/rollback logic from Synczea2016-02-242-7/+0
| | | | | | | | BUG=586596 Review URL: https://codereview.chromium.org/1703173002 Cr-Commit-Position: refs/heads/master@{#377370}
* [Sync] Now also check get updates request types before performing sessions ↵skym2016-02-232-0/+7
| | | | | | | | | | garbage collection. BUG=129654 Review URL: https://codereview.chromium.org/1717383002 Cr-Commit-Position: refs/heads/master@{#377103}
* Change sync conflict resolution for extensionsasargent2016-02-202-25/+118
| | | | | | | | | | | | | | For extensions and apps, if the server has seen a delete action (corresponding to an uninstall) and the local state has a not-yet-synced change, we would prefer to resolve this conflict by keeping the server state and uninstalling locally. This helps to prevent uninstalled extensions "coming back to life". BUG=517910 Review URL: https://codereview.chromium.org/1664643003 Cr-Commit-Position: refs/heads/master@{#376603}
* Renaming EntityData::Pass to PassToPtr to avoid Pass->std::moveskym2016-02-123-8/+8
| | | | | | | | | | presubmit checks. BUG=586305 Review URL: https://codereview.chromium.org/1692733002 Cr-Commit-Position: refs/heads/master@{#375067}
* [Sync] Moving DataTypeState to be a proto so that it can easily beskym2016-02-103-33/+38
| | | | | | | | | | serialized to storage by model types. BUG=543405 Review URL: https://codereview.chromium.org/1678343002 Cr-Commit-Position: refs/heads/master@{#374667}
* Fix remaining incompatibilities between scoped_ptr and unique_ptr.dcheng2016-01-201-2/+2
| | | | | | | | | | | | | | | | | scoped_ptr is more convertible to bool than std::unique_ptr. bool x = scoped_ptr<int>(); // compiles bool y = std::unique_ptr<int>(); // explodes std::unique_ptr is not streamable: LOG(ERROR) << scoped_ptr<int>(); // compiles LOG(ERROR) << std::unique_ptr<int>(); // explodes BUG=579269,579270 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1609923002 Cr-Commit-Position: refs/heads/master@{#370266}
* [Sync] Sync should run canary cycle after any network related errorpavely2016-01-064-41/+7
| | | | | | | | | | | | | | | | | | Today sync only runs canary cycle after small subset of network errors that are related to connection/network failure. This leaves sync in exponential backoff when unexpected error is returned from network stack. In this change I make sync translate all network errors to CONNECTION_UNAVAILABLE therefore making it try canary job after network change. BUG=539943 R=zea@chromium.org Review URL: https://codereview.chromium.org/1553433002 Cr-Commit-Position: refs/heads/master@{#367746}
* Fix GetCommitIds local deletion case resulting in orphaning of directory entriesstanisc2016-01-052-61/+312
| | | | | | | | | | | | | | | | | | | | | | | | This fixes filtering of commits in the case when a hierarchy of bookmarks gets deleted and there is a conflict in the middle of the hierarchy. Before the fix the folder above the conflicting entry would be still committed and then subsequently deleted and that would leave the conflicting entry orphaned and unreachable on both the clint and the server. The fix provides a better implementation of FilterUnreadyEntries which removes not only entries that are in direct conflict themselves but also all other entries dependent on them. For conflicting deleted entries it removes all deleted folders above them. For conflicting non-deleted folders it removes all entries below (prior to the fix that was done in the ordering part of the algorithm). I've included a new unit test that reproduces the bug condition and verifies the fix. BUG=569775 Review URL: https://codereview.chromium.org/1548843002 Cr-Commit-Position: refs/heads/master@{#367565}
* Convert Pass()→std::move() in //syncdcheng2015-12-264-9/+10
| | | | | | | | BUG=557422 Review URL: https://codereview.chromium.org/1539843002 Cr-Commit-Position: refs/heads/master@{#366886}
* [Sync] Use account_id instead of username in a few places in syncpavely2015-12-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | Currently sync gets username from SigninManagerBase::GetAuthenticatedAccountInfo(). In some cases it returns empty result which prevents sync backend from starting. Username is used in following places: - passed to sync directory database to be stored as share id - passed to server in ClientToServerMessage.share - passed to attachment uploader/downloader to be used as account_id when requesting access tokens The change is to switch to more stable SigninManagerBase::GetAuthenticatedAccountId(). account_id will be passed to directory and attachment uploader/downloader. Username is still used in communications with server but it is not enforced to be nonempty. BUG=554551 R=zea@chromium.org Review URL: https://codereview.chromium.org/1544893002 Cr-Commit-Position: refs/heads/master@{#366721}
* Switch to standard integer types in sync/.avi2015-12-2250-286/+364
| | | | | | | | | BUG=138542 TBR=zea@chromium.org Review URL: https://codereview.chromium.org/1545553003 Cr-Commit-Position: refs/heads/master@{#366533}
* [Sync] Audited syncer unittest for gtest eq/bool and expected/actual usage, ↵skym2015-12-141-125/+96
| | | | | | | | | | removed a multi line macro comment that caused lint confusion. BUG=567301,567858 Review URL: https://codereview.chromium.org/1519713002 Cr-Commit-Position: refs/heads/master@{#365089}
* [Sync] Fixing all trivial lint violations in src/sync/*skym2015-12-1427-219/+249
| | | | | | | | BUG=567301 Review URL: https://codereview.chromium.org/1510023002 Cr-Commit-Position: refs/heads/master@{#365077}
* Sync: relax ordering constraints in GetCommitIdsstanisc2015-12-121-75/+9
| | | | | | | | | | | | | | | Removed code that order commits by predecessor because that isn't needed anymore (see the bug). Apparently there wasn't any test coverage for the commit ordering based on predecessors so none of the tests got broken by this change. I've verified that there are tests that verify commit ordering based on parent-child hierarchy. BUG=287938 Review URL: https://codereview.chromium.org/1510633002 Cr-Commit-Position: refs/heads/master@{#364939}
* [Sync] Replacing SYNC_EXPORT_PRIVATE with SYNC_EXPORT for all usage, and ↵skym2015-12-1124-67/+67
| | | | | | | | | | | | fixing lint violations on all touched files. Leaving the definition of the SYNC_EXPORT_PRIVATE macro because for some strange reason the iOS waterfall bot's incremental build doesn't re-generate the attachment's proto files. This causes a compile failure because the old versions of these generated files use the SYNC_EXPORT_MACRO. It has been difficult to reproduce this problem anywhere else, so it's unclear if something like a white-space change to the .proto definition would resolve this breakage. BUG=554242, 567301 Review URL: https://codereview.chromium.org/1503343002 Cr-Commit-Position: refs/heads/master@{#364546}
* [Sync] Remove ScopedServerStatusWatcherpavely2015-12-084-80/+19
| | | | | | | | | | | | | | Also deprecate a few error types that are not returned from server. Without this class it is more clear how server_status gets from HttpResponse to ServerConnectionManager's server_status. R=zea@chromium.org,timonvo@chromium.org BUG=567273 Review URL: https://codereview.chromium.org/1505953002 Cr-Commit-Position: refs/heads/master@{#363713}
* Revert of [Sync] Removing SYNC_EXPORT_PRIVATE macro and fixing lint ↵caitkp2015-12-0724-68/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | violations on (patchset #3 id:40001 of https://codereview.chromium.org/1509563002/ ) Reason for revert: Fails to compile for IOS https://build.chromium.org/p/chromium.mac/builders/iOS_Device/builds/30956/steps/compile/logs/stdio CompileC /b/build/slave/iOS_Device/build/src/xcodebuild/sync.build/Release-iphoneos/attachment_store_proto.build/Objects-normal/armv7/attachment_store.pb.o /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.cc normal armv7 c++ com.apple.compilers.llvm.clang.1_0.compiler cd /b/build/slave/iOS_Device/build/src/sync export LANG=en_US.US-ASCII export PATH="/Applications/Xcode7.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode7.0.app/Contents/Developer/usr/bin:/Users/chrome-bot/slavebin:/b/depot_tools:/usr/local/git/bin:/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" /b/build/slave/iOS_Device/build/src/sync/../third_party/llvm-build/Release+Asserts/bin/clang -x c++ -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs -fno-exceptions -fno-rtti -Os -Werror -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wnewline-eof -Wno-c++11-extensions -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DDISABLE_NACL -DCHROMIUM_BUILD -DCR_CLANG_REVISION=254049-1 -DUSE_LIBJPEG_TURBO=1 -DDONT_EMBED_BUILD_METADATA -DFIELDTRIAL_TESTING_ENABLED -DDISABLE_FTP_SUPPORT=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DSYNC_IMPLEMENTATION -DPROTOBUF_USE_DLLS -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DUSE_LIBPCI=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DNS_BLOCK_ASSERTIONS=1 -D_FORTIFY_SOURCE=2 -isysroot /Applications/Xcode7.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -miphoneos-version-min=7.0 -g -fvisibility=hidden -fvisibility-inlines-hidden -fno-threadsafe-statics -Wno-sign-conversion -I/b/build/slave/iOS_Device/build/src/xcodebuild/Release-iphoneos/include -I/b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release -I/b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out -I.. -I../third_party/protobuf -I../third_party/protobuf/src -I/b/build/slave/iOS_Device/build/src/xcodebuild/sync.build/Release-iphoneos/attachment_store_proto.build/DerivedSources/armv7 -I/b/build/slave/iOS_Device/build/src/xcodebuild/sync.build/Release-iphoneos/attachment_store_proto.build/DerivedSources -Wall -Wendif-labels -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-bitfield-width -Wexit-time-destructors -F/b/build/slave/iOS_Device/build/src/xcodebuild/Release-iphoneos -Xclang -load -Xclang /b/build/slave/iOS_Device/build/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang enforce-overriding-blink -MMD -MT dependencies -MF /b/build/slave/iOS_Device/build/src/xcodebuild/sync.build/Release-iphoneos/attachment_store_proto.build/Objects-normal/armv7/attachment_store.pb.d --serialize-diagnostics /b/build/slave/iOS_Device/build/src/xcodebuild/sync.build/Release-iphoneos/attachment_store_proto.build/Objects-normal/armv7/attachment_store.pb.dia -c /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.cc -o /b/build/slave/iOS_Device/build/src/xcodebuild/sync.build/Release-iphoneos/attachment_store_proto.build/Objects-normal/armv7/attachment_store.pb.o In file included from /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.cc:5: /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:34:6: error: variable has incomplete type 'void' void SYNC_EXPORT_PRIVATE protobuf_AddDesc_attachment_5fstore_2eproto(); ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:34:25: error: expected ';' after top level declarator void SYNC_EXPORT_PRIVATE protobuf_AddDesc_attachment_5fstore_2eproto(); ^ ; /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:46:1: error: unknown type name 'SYNC_EXPORT_PRIVATE' SYNC_EXPORT_PRIVATE bool RecordMetadata_Component_IsValid(int value); ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:46:21: error: expected unqualified-id SYNC_EXPORT_PRIVATE bool RecordMetadata_Component_IsValid(int value); ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:53:27: error: variable has incomplete type 'class SYNC_EXPORT_PRIVATE' class SYNC_EXPORT_PRIVATE StoreMetadata : public ::google::protobuf::MessageLite { ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:53:7: note: forward declaration of 'attachment_store_pb::SYNC_EXPORT_PRIVATE' class SYNC_EXPORT_PRIVATE StoreMetadata : public ::google::protobuf::MessageLite { ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:53:41: error: expected ';' after top level declarator class SYNC_EXPORT_PRIVATE StoreMetadata : public ::google::protobuf::MessageLite { ^ ; /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:53:43: error: expected unqualified-id class SYNC_EXPORT_PRIVATE StoreMetadata : public ::google::protobuf::MessageLite { ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:146:27: error: variable has incomplete type 'class SYNC_EXPORT_PRIVATE' class SYNC_EXPORT_PRIVATE RecordMetadata : public ::google::protobuf::MessageLite { ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:53:7: note: forward declaration of 'attachment_store_pb::SYNC_EXPORT_PRIVATE' class SYNC_EXPORT_PRIVATE StoreMetadata : public ::google::protobuf::MessageLite { ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:146:42: error: expected ';' after top level declarator class SYNC_EXPORT_PRIVATE RecordMetadata : public ::google::protobuf::MessageLite { ^ ; /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:146:44: error: expected unqualified-id class SYNC_EXPORT_PRIVATE RecordMetadata : public ::google::protobuf::MessageLite { ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:280:13: error: incomplete type 'attachment_store_pb::StoreMetadata' named in nested name specifier inline bool StoreMetadata::has_schema_version() const { ^~~~~~~~~~~~~~~ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:38:7: note: forward declaration of 'attachment_store_pb::StoreMetadata' class StoreMetadata; ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:283:13: error: incomplete type 'attachment_store_pb::StoreMetadata' named in nested name specifier inline void StoreMetadata::set_has_schema_version() { ^~~~~~~~~~~~~~~ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:38:7: note: forward declaration of 'attachment_store_pb::StoreMetadata' class StoreMetadata; ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:286:13: error: incomplete type 'attachment_store_pb::StoreMetadata' named in nested name specifier inline void StoreMetadata::clear_has_schema_version() { ^~~~~~~~~~~~~~~ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:38:7: note: forward declaration of 'attachment_store_pb::StoreMetadata' class StoreMetadata; ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:289:13: error: incomplete type 'attachment_store_pb::StoreMetadata' named in nested name specifier inline void StoreMetadata::clear_schema_version() { ^~~~~~~~~~~~~~~ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:38:7: note: forward declaration of 'attachment_store_pb::StoreMetadata' class StoreMetadata; ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:293:34: error: incomplete type 'attachment_store_pb::StoreMetadata' named in nested name specifier inline ::google::protobuf::int32 StoreMetadata::schema_version() const { ^~~~~~~~~~~~~~~ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:38:7: note: forward declaration of 'attachment_store_pb::StoreMetadata' class StoreMetadata; ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:296:13: error: incomplete type 'attachment_store_pb::StoreMetadata' named in nested name specifier inline void StoreMetadata::set_schema_version(::google::protobuf::int32 value) { ^~~~~~~~~~~~~~~ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:38:7: note: forward declaration of 'attachment_store_pb::StoreMetadata' class StoreMetadata; ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:306:13: error: incomplete type 'attachment_store_pb::RecordMetadata' named in nested name specifier inline bool RecordMetadata::has_attachment_size() const { ^~~~~~~~~~~~~~~~ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:39:7: note: forward declaration of 'attachment_store_pb::RecordMetadata' class RecordMetadata; ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:309:13: error: incomplete type 'attachment_store_pb::RecordMetadata' named in nested name specifier inline void RecordMetadata::set_has_attachment_size() { ^~~~~~~~~~~~~~~~ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:39:7: note: forward declaration of 'attachment_store_pb::RecordMetadata' class RecordMetadata; ^ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:312:13: error: incomplete type 'attachment_store_pb::RecordMetadata' named in nested name specifier inline void RecordMetadata::clear_has_attachment_size() { ^~~~~~~~~~~~~~~~ /b/build/slave/iOS_Device/build/src/xcodebuild/DerivedSources/Release/protoc_out/sync/internal_api/attachments/proto/attachment_store.pb.h:39:7: note: forward declaration of 'attachment_store_pb::RecordMetadata' class RecordMetadata; ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. Original issue's description: > [Sync] Removing SYNC_EXPORT_PRIVATE macro and fixing lint violations on > all touched files. > > BUG=554242,567301 > > Committed: https://crrev.com/1621aa930169650b0c4c371e743f3be58a70abae > Cr-Commit-Position: refs/heads/master@{#363603} TBR=zea@chromium.org,skym@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=554242,567301 Review URL: https://codereview.chromium.org/1503253004 Cr-Commit-Position: refs/heads/master@{#363609}
* [Sync] Removing SYNC_EXPORT_PRIVATE macro and fixing lint violations onskym2015-12-0724-69/+68
| | | | | | | | | | all touched files. BUG=554242,567301 Review URL: https://codereview.chromium.org/1509563002 Cr-Commit-Position: refs/heads/master@{#363603}
* [Sync] Ensure all values of SyncProtocolErrorType are handled in ↵pavely2015-12-041-3/+5
| | | | | | | | | | | | | | | | | | | | | | | ShouldRequestEarlyExit The issue is that in ShouldRequestEarlyExit (sync_scheduler_impl.cc) switch statement doesn't explicitly handle all SyncProtocolErrorType values and therefore they are handled by default: and cause NOTREACHED(). In the current code two values that are not handled are NON_RETRIABLE_ERROR and PARTIAL_FAILURE. The change is to remove default handler from switch so that adding new error type without handling it explicitly would cause compiler error. In addition I removed NON_RETRIABLE_ERROR as it seems to be not used. BUG=565102 R=zea@chromium.org Review URL: https://codereview.chromium.org/1500803002 Cr-Commit-Position: refs/heads/master@{#363283}
* sync/engine: switch base::ScopedPtrMap to std::map.vmpstr2015-12-012-5/+8
| | | | | | | | | | | | | | This patch switched ScopedPtrMap uses to std::map. It also adds DISALLOW_COPY_AND_ASSIGN to Commit which declares but doesn't define a copy ctor. If no copy ctor is specified, msvc would create it and fail to compile it. R=zea@chromium.org BUG=54291 Review URL: https://codereview.chromium.org/1488883003 Cr-Commit-Position: refs/heads/master@{#362515}
* base: Make ScopedPtrMap use DISALLOW_COPY_AND_ASSIGNdanakj2015-12-011-4/+4
| | | | | | | | | | | | | | Currently the class uses MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03 which adds a .Pass() method and works for passing with Callback. But there are no users of this passing ownership in Callback, so switch to the general DISALLOW_COPY_AND_ASSIGN macro. R=Nico, zea@chromium.org BUG=557422, 554291 Review URL: https://codereview.chromium.org/1480773002 Cr-Commit-Position: refs/heads/master@{#362488}
* ModelTypeEntity refactoring to use EntityData and EntityMetadatastanisc2015-12-015-601/+6
| | | | | | | | | | | | | | | | | | | | | | | | | 1) Changed existing ModelTypeEntity to be based on EntityMetadata, client key, and EntityDataPtr. Changed the class construction functions slighly to better reuse the code and to be able to pass the data without copying. 2) Moved model_type_entity* files next to shared_model_type_processor* 3) Did initial implementation of the data caching, although it might still need some refinement. The code that prepares commit request data structure now uses the cached EntityDataPtr. 4) Made necessary changes in SharedModelTypeProcessor to ensure that all existing tests pass. Had to disable two re-encryption tests because they expect the data received in updates to be cached in ModelTypeEntity which isn't the case anymore. BUG=517657, 553638 Review URL: https://codereview.chromium.org/1471293005 Cr-Commit-Position: refs/heads/master@{#362475}
* ScopedPtrMap -> std::map from /synclimasdf2015-11-303-17/+22
| | | | | | | | | | | C++ 11 enables containers that contain move-only type, scoped_ptr. So, Use std::map<key, scoped_ptr<Foo>> instead of ScopedPtrMap. BUG=554291 Review URL: https://codereview.chromium.org/1459773002 Cr-Commit-Position: refs/heads/master@{#362191}
* Cleanup: Correctly spell success(ful).thestig2015-11-231-3/+1
| | | | | | | | | TBR=brettw@chromium.org NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1469783002 Cr-Commit-Position: refs/heads/master@{#361166}
* USS refactoring with EntityDatastanisc2015-11-185-87/+132
| | | | | | | | | | | | Changed CommitRequestData and UpdateResponseData to leverage EntityData structure. ModelTypeEntity and EntityTracker will be changed in a separate change. BUG=553638 Review URL: https://codereview.chromium.org/1436943009 Cr-Commit-Position: refs/heads/master@{#360266}
* Sync: Conflict resolution code doesn't take into account implicit permanent ↵stanisc2015-10-292-1/+46
| | | | | | | | | | | | | | | | | folders The code that resolves simple conflicts detect the type of conflict incorrectly when occurs during transition to implicit root folder, when Parent ID changes from root folder ID to an empty string. This shouldn't be considered a hierarchy change as far as conflict type detection is concerned. BUG=548734 Review URL: https://codereview.chromium.org/1414663008 Cr-Commit-Position: refs/heads/master@{#356764}
* Sync: fix for the code that checks whether the initial download has completedstanisc2015-10-136-35/+160
| | | | | | | | | | | | | | | | | | | | | The code that detects whether the initial download has completed for a type had been inadvertently broken by https://codereview.chromium.org/1142423006/ This fix changes Directory::InitialSyncEndedForType back to the original implementation and adds special handling for implicitly created root folders (i.e. root folders auto-created locally by the update handling code). Since the locally created root folders don't get applied with the rest of downloaded nodes, their base version has to be explicitly changed from CHANGES_VERSION to some other value at the end of update application process. That would to indicate that at least one update has been applied for the type and be consistent with how the server generated root folders are handled. BUG=540814 Review URL: https://codereview.chromium.org/1393633003 Cr-Commit-Position: refs/heads/master@{#353913}
* [Sync] Client should prompt for passphrase after server data was cleared by ↵pavely2015-10-124-86/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | different client After server data was cleared as part of transition to passphrase encryption other clients should prompt for passphrase. To achieve this server will return error different from NOT_MY_BIRTHDAY (CLIENT_DATA_OBSOLETE). On receiving this error client should reset local sync data and restart sync. In this change: - Add CLIENT_DATA_OBSOLETE error type and RESET_LOCAL_SYNC_DATA client action - When server returns CLIENT_DATA_OBSOLETE notify ProfileSyncService with actionable error - In PSS shutdown sync engine, clearing sync data, then restart sync engine. Additionally: - I moved code that prepares SyncProtocolError into separate function. This allows to test that different responses from server result in correct error types and actions. - I renamed couple functions mentioned in TODO. BUG=490836 R=zea@chromium.org TEST=This change is covered by unittests (sync_unit_tests and unit_tests). Behavior is not accessible in chrome yet. Review URL: https://codereview.chromium.org/1385323005 Cr-Commit-Position: refs/heads/master@{#353630}
* [Sync] Move ModelTypeProcessor* and rename *Impl to Shared*.maxbogue2015-10-098-1218/+5
| | | | | | | | BUG=536895 Review URL: https://codereview.chromium.org/1382743004 Cr-Commit-Position: refs/heads/master@{#353323}
* USS: Refactoring of ModelTypeProcessorImpl to not dependstanisc2015-10-063-108/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | on SyncContextProxy This is an incremental change, a part of the larger NonBlockingDataTypeController refactoring. The following changes are included: 1) Some of ModelTypeProcessorImpl methods are changed/renamed to be closer to the new design: - Enable --> Start - Disconnect --> Stop - IsPreferred --> IsEnabled 2) ModelTypeProcessorImpl::Start gets a callback that it uses to return ActivationContext back to the controller. 3) ModelTypeProcessorImpl doesn't use SyncContextProxy anymore. 4) InjectableSyncContextProxy isn't needed anymore. 5) Some minor changes in NonBlockingDataTypeController to make it closer to the eventual implementation based on DataTypeController. More specifically, it doesn't pass SyncContextProxy to the processor anymore and instead receives and passes through the activation context. BUG=515962 Review URL: https://codereview.chromium.org/1389433002 Cr-Commit-Position: refs/heads/master@{#352661}
* Detecting and fixing stringprintf.h format bugsbrucedawson2015-10-061-6/+6
| | | | | | | | | | | | | | | | The print functions in stringprintf.h were not annotated for /analyze so 13 Windows specific format-string bugs accumulated. This annotates the functions so that the /analyze builder will find the problems and fixes the bugs. R=thestig@chromium.org,wfh@chromium.org,jam@chromium.org Skipping wstring presubmit checks - no new wstring usage is added NOPRESUBMIT=true BUG=427616 Review URL: https://codereview.chromium.org/1372153002 Cr-Commit-Position: refs/heads/master@{#352659}
* USS SyncContextProxy / data type activation refactoringstanisc2015-09-282-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This refactoring prepares the code to introduction of NonBlockingDataTypeController for USS datatypes. The goal was to split the very large NonBlockingDataTypeController change into a couple of smaller to make it easier to review and verify. The following changes are included here: 1) Introduced ActivationContext which is a structure that contains all arguments needed to activate a USS datatype. For now ActivationContext is passed via SyncContext / SyncContextProxy, but the goal is to pass it directly via BackendDataTypeConfigurer as an argument for ActivateNonBlockingDataType. ActivationContext is needed as a separate class because NonBlockingDataTypeController will have to receive it from the type processor's callback and temporarily hold on to it. 2) BackendDataTypeConfigurer - two activation methods are renamed to be directory specific and two more activation methods for non-blocking data types are added. 3) DataTypeController cleanup - OnModelLoaded() virtual method shouldn't be on the base class because it applies only to some of the subclasses and is never invoked via the base class. BUG=515962 Review URL: https://codereview.chromium.org/1368683003 Cr-Commit-Position: refs/heads/master@{#351110}
* base: Template methods on Timer classes instead of the classes themselves.danakj2015-09-241-4/+4
| | | | | | | | | | | | | | | | | | | The base class for OneShotTimer and DelayedTimer is templated but only the Start method needs to be (which has a TODO to make it go away entirely too). The DelayedTimer class is also templated but only its constructor needs to be, and the type can be inferred at the callsite, so less typing all around. R=thakis@chromium.org TBR=sky,brettw BUG=148832 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1355063004 Cr-Commit-Position: refs/heads/master@{#350496}
* [Sync] USS: Simplify EntityTracker to use data structs.maxbogue2015-09-164-234/+140
| | | | | | | | | | | This simplifies many of the signatures in the class and also saves on memory usage when there is no pending commit. BUG=515965 Review URL: https://codereview.chromium.org/1344733002 Cr-Commit-Position: refs/heads/master@{#349220}
* [Sync] Introduce ModelTypeStore interfacepavely2015-09-103-3/+15
| | | | | | | | | | | | | In this change: - Add empty ModelTypeStore interface - Pass WeakPtr to store into ModelTypeProcessorImpl::ctor. BUG=517663 R=stanisc@chromium.org Review URL: https://codereview.chromium.org/1311363009 Cr-Commit-Position: refs/heads/master@{#348255}
* [Sync] Use ModelTypeProcessor instead of ModelTypeProcessorImpl.maxbogue2015-09-091-25/+24
| | | | | | | | | | | | | | This CL doesn't touch ModelTypeProcessorImpl in DataTypeController because ModelTypeProcessor doesn't have the functionality for it. Those uses will be removed in a separate refactor. Also fixes a bunch of incorrect variable names. BUG=517953 Review URL: https://codereview.chromium.org/1321613003 Cr-Commit-Position: refs/heads/master@{#347880}
* [Sync] Rename ModelTypeSyncWorkerImpl to ModelTypeWorkerpavely2015-09-035-202/+171
| | | | | | | | | | | | | Following renames are in this change: ModelTypeSyncWorkerImpl -> ModelTypeWorker ModelTypeSyncWorkerWrapper -> CommitQueueProxy BUG=515964 R=stanisc@chromium.org Review URL: https://codereview.chromium.org/1328743004 Cr-Commit-Position: refs/heads/master@{#347173}
* Add OnConnect method to this interface ModelTypeProcessor.gangwu2015-09-022-8/+17
| | | | | | | | | | | | Use the interface ModelTypeProcessor instead of ModelTypeProcessorImpl when invoking OnConnect, OnCommitCompleted and OnUpdateReceived. BUG=525830 Review URL: https://codereview.chromium.org/1328513005 Cr-Commit-Position: refs/heads/master@{#346989}
* [Sync] Rename ModelTypeSyncProxyImpl to ModelTypeProcessorImpl.maxbogue2015-09-014-77/+77
| | | | | | | | BUG=522308 Review URL: https://codereview.chromium.org/1310663006 Cr-Commit-Position: refs/heads/master@{#346728}
* ModelTypeSyncProxy -> ModelTypeProcessorgangwu2015-08-3112-77/+80
| | | | | | | | | | ModelTypeSyncWorker -> CommitQueue BUG=525830 Review URL: https://codereview.chromium.org/1325453003 Cr-Commit-Position: refs/heads/master@{#346521}
* Remove base::debug::DumpWithoutCrashing() when UniquePositiongangwu2015-08-311-9/+9
| | | | | | | | | | | is invalid, and create UniquePosition base on position in parent. BUG=526617 Review URL: https://codereview.chromium.org/1311893008 Cr-Commit-Position: refs/heads/master@{#346511}
* When receive a bookmark with an invalid unique position from syncgangwu2015-08-283-1/+42
| | | | | | | | | | server, we create an unique position for this bookmark. BUG=332371 Review URL: https://codereview.chromium.org/1304063007 Cr-Commit-Position: refs/heads/master@{#346158}
* Measuring data use of different ModelTypes in Sync Service.amohammadkhan2015-08-254-4/+139
| | | | | | | | | | | | | | | To understand the contribution of each ModelType to total traffic of Sync service, SyncEntries of different ModelTypes in update and commit messages are counteda and sparse UMA histograms are made to record them. ModelTypes are buckets in these histograms. Beside the aforementioned information, a histogram records the amount of byte useage of ProgressMarkers in update messages. BUG=516455 Review URL: https://codereview.chromium.org/1273303002 Cr-Commit-Position: refs/heads/master@{#345461}
* move V2 classes in chrome/engine to syncer_v2 namespacestanisc2015-08-1418-304/+268
| | | | | | | | BUG=516512 Review URL: https://codereview.chromium.org/1285443002 Cr-Commit-Position: refs/heads/master@{#343452}