summaryrefslogtreecommitdiffstats
path: root/sync/util
Commit message (Collapse)AuthorAgeFilesLines
* Convert Pass()→std::move() in //syncdcheng2015-12-261-4/+4
| | | | | | | | BUG=557422 Review URL: https://codereview.chromium.org/1539843002 Cr-Commit-Position: refs/heads/master@{#366886}
* Switch to standard integer types in sync/.avi2015-12-2210-14/+27
| | | | | | | | | BUG=138542 TBR=zea@chromium.org Review URL: https://codereview.chromium.org/1545553003 Cr-Commit-Position: refs/heads/master@{#366533}
* [Sync] Fixing all trivial lint violations in src/sync/*skym2015-12-144-10/+12
| | | | | | | | BUG=567301 Review URL: https://codereview.chromium.org/1510023002 Cr-Commit-Position: refs/heads/master@{#365077}
* [Sync] Replacing SYNC_EXPORT_PRIVATE with SYNC_EXPORT for all usage, and ↵skym2015-12-113-3/+3
| | | | | | | | | | | | 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}
* Revert of [Sync] Removing SYNC_EXPORT_PRIVATE macro and fixing lint ↵caitkp2015-12-073-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-073-3/+3
| | | | | | | | | | all touched files. BUG=554242,567301 Review URL: https://codereview.chromium.org/1509563002 Cr-Commit-Position: refs/heads/master@{#363603}
* Remove base::MessageLoop::{Quit,QuitClosure} functionski.stfu2015-10-231-1/+1
| | | | | | | | | | | | | This patch removes aliases for base::MessageLoop::QuitWhenIdle & base::MessageLoop::QuitWhenIdleClosure, and includes minor formatting changes made by using git cl-format. BUG=131220 TEST= R=danakj@chromium.org,brettw@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1390513002 Cr-Commit-Position: refs/heads/master@{#355763}
* Cleanup: IWYU for base/gtest_prod_util.h.thestig2015-09-251-1/+0
| | | | | | | | | | CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel TBR=pneubeck@chromium.org Review URL: https://codereview.chromium.org/1366123002 Cr-Commit-Position: refs/heads/master@{#350770}
* Cleanup: Pass std::string as const reference from sync/ki.stfu2015-09-222-4/+4
| | | | | | | | | | | | Passing std::string by reference can prevent extra copying of object. BUG=367418 TEST= R=pavely@chromium.org,stanisc@chromium.org,zea@chromium.org Review URL: https://codereview.chromium.org/1348313003 Cr-Commit-Position: refs/heads/master@{#350126}
* Measuring data use of different ModelTypes in Sync Service.amohammadkhan2015-08-252-1/+22
| | | | | | | | | | | | | | | 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}
* [Sync] Remove backend unrecoverable error handlerzea2015-08-074-2/+25
| | | | | | | | | | | It was being used to allowed passing ownership of an error handler, but passing a weak handle works just as well. BUG=511235 Review URL: https://codereview.chromium.org/1275743002 Cr-Commit-Position: refs/heads/master@{#342384}
* [Sync] Gracefully handle keychain failureszea2015-07-071-1/+0
| | | | | | | | | | | | | | We trigger DCHECKs when we attempt to create bootstrap tokens while the Mac keychain isn't ready. This doesn't actually affect correctness, and is problematic for developers. Now, we'll simply persist empty bootstrap tokens, forcing the user to re-enter their passphrase on restart (or the client to redownload the server encryption key if they have a keystore type nigori). BUG=457153 Review URL: https://codereview.chromium.org/1211273012 Cr-Commit-Position: refs/heads/master@{#337704}
* Move WriteInto to base namespace.Brett Wilson2015-07-071-1/+1
| | | | | | | | | | | | | | | | | | Update all callers. De-inlines the template. For some reason touching the namespaces started givin errors about DCHECK not being defined. Indeed, this header does not include logging.h. Rather than include logging in this very common header, it seems preferable to move the implementation to the .cc file. This removes support for the wstring variant and updates the callers that used it. R=ben@chromium.org, ben TBR=jschuh (sandbox_win.cc) NOPRESUBMIT=true (this patch touches code using legacy wstrings) Review URL: https://codereview.chromium.org/1223983002. Cr-Commit-Position: refs/heads/master@{#337703}
* Make the ChromeOS session name more robust w.r.t. the device type.jdufault2015-07-072-11/+24
| | | | | | | | This CL uses a new utility introduced in https://codereview.chromium.org/1204783005. It may make sense to push the device-type-to-ascii conversion up to /chromeos, since it is also done in https://codereview.chromium.org/1204093003. Review URL: https://codereview.chromium.org/1203263003 Cr-Commit-Position: refs/heads/master@{#337638}
* Move more string_util functions to base namespace.brettw2015-06-241-1/+1
| | | | | | | | | | | | | | Rename IsWhitespace to IsUnicodeWhitespace (to contrast it to the already-existing IsAsciiWhitespace). De-inline HexDigitToInt. This is only used in a few places and I don't think it's necessary to inline. Remove some redundant base:: qualifications in base. TBR=sky Review URL: https://codereview.chromium.org/1200053004 Cr-Commit-Position: refs/heads/master@{#335827}
* Migrate callers of message_loop_proxy() to task_runner()skyostil2015-06-171-1/+1
| | | | | | | | | | | | | Migrate callers of {MessageLoop,Thread}::message_loop_proxy() to {MessageLoop,Thread}::task_runner(). Since the types at the call sites have already been updated, this is just a bulk rename. BUG=465354 TBR=armansito@chromium.org Review URL: https://codereview.chromium.org/1179163002 Cr-Commit-Position: refs/heads/master@{#334840}
* [Sync] Don't crash for encryption errorszea2015-06-101-2/+4
| | | | | | | | | | | Encryption errors can arise due to OS issues in some cases or simply directory corruption. Rather than crashing trigger an unrecoverable error. BUG=123223 Review URL: https://codereview.chromium.org/1161463005 Cr-Commit-Position: refs/heads/master@{#333644}
* [sync] Add AUTOFILL_WALLET_METADATA sync datatype.rouslan2015-05-221-0/+3
| | | | | | | | BUG=481595 Review URL: https://codereview.chromium.org/1125143006 Cr-Commit-Position: refs/heads/master@{#331130}
* Subject .mm files to the header sorting presubmittapted2015-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | The presubmit is already robust to handle Objective-C .h files. Not checking .mm files just adds extra review burden. Plus I can't just press F5 in Sublime to sort lines in .mm files due to import vs include, so it actually needs some brainpower when adding something and I keep forgetting to do that. This adds .mm to the list of file extensions the header sorting presubmit checks for, and fixes the current mistakes to avoid annoying people on presubmit with this change. BUG=None TBR=keybuk@chromium.org,jamescook@chromium.org,stuartmorgan@chromium.org,xhwang@chromium.org,rsesek@chromium.org,zea@chromium.org R=thakis@chromium.org,jochen@chromium.org Review URL: https://codereview.chromium.org/1133713009 Cr-Commit-Position: refs/heads/master@{#330509}
* [Sync] Erase sync DB when corruptedmaniscalco2015-04-302-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | Directory now registers to be notified of catastrophic sync DB errors. Upon notification, Directory triggers an unrecoverable sync error which causes ProfileSyncService to delete the sync DB. Add integration test that verifies the sync DB is deleted when DB corruption is detected. Remove unused member variable allow_failure_for_test_ from DirectoryBackingStore. Add MockUnrecoverableErrorHandler to assist in writing tests for Directory. BUG=470993 Committed: https://crrev.com/90a7f8d3e3b3a2aac43e71a93eac2731f084945c Cr-Commit-Position: refs/heads/master@{#327120} Review URL: https://codereview.chromium.org/1082893003 Cr-Commit-Position: refs/heads/master@{#327766}
* Revert of [Sync] Erase sync DB when corrupted (patchset #4 id:60001 of ↵vkuzkokov2015-04-282-61/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1082893003/) Reason for revert: Test fails on Win7 bots. see crbug.com/481895 Original issue's description: > [Sync] Erase sync DB when corrupted > > Directory now registers to be notified of catastrophic sync DB errors. > Upon notification, Directory triggers an unrecoverable sync error which > causes ProfileSyncService to delete the sync DB. > > Add integration test that verifies the sync DB is deleted when DB > corruption is detected. > > Remove unused member variable allow_failure_for_test_ from > DirectoryBackingStore. > > Add MockUnrecoverableErrorHandler to assist in writing tests for > Directory. > > BUG=470993 > > Committed: https://crrev.com/90a7f8d3e3b3a2aac43e71a93eac2731f084945c > Cr-Commit-Position: refs/heads/master@{#327120} TBR=zea@chromium.org,pvalenzuela@chromium.org,maniscalco@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=470993 Review URL: https://codereview.chromium.org/1104423005 Cr-Commit-Position: refs/heads/master@{#327264}
* [Sync] Erase sync DB when corruptedmaniscalco2015-04-272-0/+61
| | | | | | | | | | | | | | | | | | | | | Directory now registers to be notified of catastrophic sync DB errors. Upon notification, Directory triggers an unrecoverable sync error which causes ProfileSyncService to delete the sync DB. Add integration test that verifies the sync DB is deleted when DB corruption is detected. Remove unused member variable allow_failure_for_test_ from DirectoryBackingStore. Add MockUnrecoverableErrorHandler to assist in writing tests for Directory. BUG=470993 Review URL: https://codereview.chromium.org/1082893003 Cr-Commit-Position: refs/heads/master@{#327120}
* Add one test for Cryptographer::InstallKeysmalets2015-02-191-0/+46
| | | | | | | | | Add a test which covers the case of exporting all the keys and installing them back to fully bootstrap another cryptographer. Review URL: https://codereview.chromium.org/896313002 Cr-Commit-Position: refs/heads/master@{#317008}
* Re-enable some sync_unit_testshichris1232015-02-182-14/+2
| | | | | | | | | | This CL re-enables ImmutableTest.Dequeue, CryptographerTest.EncryptExportDecrypt, and SyncNigoriTest.ExportImport on Windows. BUG=55180, 55178, 129128 Review URL: https://codereview.chromium.org/930603003 Cr-Commit-Position: refs/heads/master@{#316764}
* Hook up wallet card and address syncbrettw2015-02-121-0/+3
| | | | | | | | | | | This syncs the masked credit card and addresses from wallet into Chrome autofill. R=estade, zea TBR=isherman (histograms) Review URL: https://codereview.chromium.org/902673002 Cr-Commit-Position: refs/heads/master@{#316008}
* Add a datatype for supervised user whitelists.bauerb2014-12-161-0/+3
| | | | | | | | BUG=436459 Review URL: https://codereview.chromium.org/754963004 Cr-Commit-Position: refs/heads/master@{#308569}
* Add UMA counting for Sync Attachments response codes.maxbogue2014-11-241-3/+8
| | | | | | | | | | | | | | | | sync/util/data_type_histogram_unittest.cc had to be edited because it initialized different types of histograms with identical names. Previously this did not crash because the tests had failed to invoke StatisticsRecorder::Initialize(). The HistogramTester this CL introduces in the attachments unittests does that initialization, so things broke in fun and unexpected ways. BUG=436134 Review URL: https://codereview.chromium.org/728323003 Cr-Commit-Position: refs/heads/master@{#305514}
* sync: add WIFI_CREDENTIALS protobuf, ModelType, and preferencequiche2014-10-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | - add a protobuf for WiFi credentials - add a ModelType for syncing WiFi credentials - add UI for controlling whether or not WiFi credentials are synced - add new data type to testserver While there: - update comment in sync_setup_overlay.js - fix ordering of arguments to EXPECT_EQ in CheckBool (sync_setup_handler_unittest) - move GetSelectableTypeNameMap from sync_setup_handler.cc to model_type.cc BUG=chromium:422045 TEST=ProfileSync, SyncSetup, SyncModel, ModelType, NigoriUtil, ProtoEnumConversions, ProtoValueConversions, SyncEncryptionHandlerImpl Review URL: https://codereview.chromium.org/674633002 Cr-Commit-Position: refs/heads/master@{#302159}
* Revert enhanced bookmarks sync datatypewittman2014-10-281-3/+0
| | | | | | | | | | | | | | | | | | | | We'd like to move to a new sync datatype like this, but there's not an effective way to do it while supporting existing encrypted bookmarks users. We'll eventually get there by extending BookmarkSpecifics to do what we need, then reintroducing the new type and converting client-side once feasible for all clients. By the time we're ready to reintroduce the new type many things will likely have changed, so just remove it for the time being. This reverts commit 72520cfbda25e457da26113b568c76171d716a3f. BUG=427727 Review URL: https://codereview.chromium.org/673983003 Cr-Commit-Position: refs/heads/master@{#301703}
* Standardize usage of virtual/override/final in sync/dcheng2014-10-211-3/+3
| | | | | | | | | | | | This patch was automatically generated by applying clang fixit hints generated by the plugin to the source tree. BUG=417463 TBR=maniscalco@chromium.org Review URL: https://codereview.chromium.org/642023004 Cr-Commit-Position: refs/heads/master@{#300499}
* replace OVERRIDE and FINAL with override and final in sync/mostynb2014-10-061-1/+1
| | | | | | | | BUG=417463 Review URL: https://codereview.chromium.org/629733002 Cr-Commit-Position: refs/heads/master@{#298300}
* Add enhanced bookmarks sync datatypeMike Wittman2014-10-011-0/+3
| | | | | | | | | | | | Adds a new sync datatype to handle the enhanced bookmarks representation. BUG=415822 R=mpearson@chromium.org, sky@chromium.org, zea@chromium.org Review URL: https://codereview.chromium.org/583863002 Cr-Commit-Position: refs/heads/master@{#297718}
* Ensure syncer::internal::GetComputerName returns a UTF-8 string.maniscalco2014-08-283-4/+15
| | | | | | | | | | | | | | | | | | | | | Prior to this change, on Windows, GetComputerName resulted in a call to GetComputerNameA, which returns an ANSI string (not ASCII, not UTF-8). Call GetComputerNameW instead and convert the returned wide string to UTF-8. Tested by adding U+00AB to the computer name. Saw in about:sync the name contained a U+FFFD instead (symbol for unrepresentable character). Performed sync dashboard clear, applied patch, saw that the name correctly contained U+00AB. This CL does not address corrupted device info that's already in the field. Depending on impact that may be addressed in a future CL. BUG=406470 Review URL: https://codereview.chromium.org/479703004 Cr-Commit-Position: refs/heads/master@{#292466}
* Add LOCAL_ prefix to non-UMA histogram macros.asvitkine2014-08-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it harder to accidently use the wrong macro. Also, removes the D* variants of the macros and associated DebugNow() function. These were rarely used and removing them removes clutter from the header file. Existing uses converted to be behind NDEBUG ifdefs. No functional changes except for a fix to the code in content_based_thumbnailing_algorithm.cc which was incorrectly using a ternary operator for the histogram name (which doesn't work since the macros cache the histogram object) and removal of local histograms Spellcheck.SuggestTime and Spellcheck.InitTime per groby@. Since this is an API rename, TBR'ing downstream owners. BUG=311349 TBR=groby@chromium.org,zea@chromium.org,jeremy@chromium.org,reveman@chromium.org,agl@chromium.org,jam@chromium.org Review URL: https://codereview.chromium.org/484603006 Cr-Commit-Position: refs/heads/master@{#291840}
* sync: Finish non-blocking type encryption supportrlarocque@chromium.org2014-08-163-1/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Undoes some previous work towards encryption support. That approach suffered from some subtle deadlock issues that could not be easily worked around. The new approach involves less sharing and less locks. Gives the ModelTypeSyncWorker its own copy of the Cryptographer. By passing around copies, it no longer needs to worry about acquiring locks in order to access the Directory's cryptographer. This required a rewrite of some changes to the way the ModelTypeSyncWorker detects the current encryption state. Most notably, its Cryptographer is NULL if encryption is not enabled for its model type. Makes the ModelTypeSyncRegistry responsible for observing changes emitted by the SyncEncryptionHandler and forwarding them to the ModelTypeSyncWorkers. It should receive callbacks from the SyncEncryptionHandler during startup, so it does not need to cache or query any new data. Removes the CryptographerProviders. Since the ModelTypeSyncWorker no longer need to access the directory's cryptographer, it's no longer necessary. BUG=351005 Review URL: https://codereview.chromium.org/452283003 Cr-Commit-Position: refs/heads/master@{#290067} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290067 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Add non-blocking type encryption (retry)rlarocque@chromium.org2014-08-062-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes some memory leak issues that were present in the first instance of this CL. Original description follows: Introduces the framework for dealing with sync encryption in non-blocking types. Unlike directory sync types, non-blocking type encryption only encrypts data before it is sent to the server. Encrypting the data on-disk is a separate problem. Adds code to the ModelTypeSyncWorker so it can access the directory's cryptographer (through a CryptographerProvider interface) and use it to encrypt entities before it sends them to the server. If the cryptographer is unable to encrypt with the desired key, the worker will not commit until the cryptographer returns to a good state. Adds the concept of a "desired encryption key" to the data type state. When the cryptographer key to be used to encrypt a type changes, this will be reflected in the data type state. The ModelTypeSyncProxy is responsible for ensuring that all items which have not yet been encrypted with this desired key are enqueued for commit. Makes the ModelTypeSyncWorker, EntityTracker, and ModelTypeSyncProxy collaborate on the management of undecryptable (inapplicable) updates. The EntityTracker keeps track of their version numbers and content, and prevents the committing of new items to the server until the inapplicable update has been dealt with. The ModelTypeSyncProxy is responsible for saving inapplicable updates across restarts. This CL alone is not enough to enable encryption support for non-blocking types. It requires additional code to hook up the ModelTypeSyncWorkers to receive cryptographer events. This will be added in a future commit. In the meantime, this CL includes plenty of unit tests to verify the functionality that's being added. BUG=351005 Review URL: https://codereview.chromium.org/442053002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287849 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of sync: Add non-blocking type encryption support ↵thestig@chromium.org2014-08-052-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/423193002/) Reason for revert: Both LSAN and Valgrind complains about leaks in the tests. Original issue's description: > sync: Add non-blocking type encryption support > > Introduces the framework for dealing with sync encryption in > non-blocking types. Unlike directory sync types, non-blocking type > encryption only encrypts data before it is sent to the server. > Encrypting the data on-disk is a separate problem. > > Adds code to the ModelTypeSyncWorker so it can access the directory's > cryptographer (through a CryptographerProvider interface) and use it to > encrypt entities before it sends them to the server. If the > cryptographer is unable to encrypt with the desired key, the worker will > not commit until the cryptographer returns to a good state. > > Adds the concept of a "desired encryption key" to the data type state. > When the cryptographer key to be used to encrypt a type changes, this > will be reflected in the data type state. The ModelTypeSyncProxy is > responsible for ensuring that all items which have not yet been > encrypted with this desired key are enqueued for commit. > > Makes the ModelTypeSyncWorker, EntityTracker, and ModelTypeSyncProxy > collaborate on the management of undecryptable (inapplicable) updates. > The EntityTracker keeps track of their version numbers and content, and > prevents the committing of new items to the server until the > inapplicable update has been dealt with. The ModelTypeSyncProxy is > responsible for saving inapplicable updates across restarts. > > This CL alone is not enough to enable encryption support for > non-blocking types. It requires additional code to hook up the > ModelTypeSyncWorkers to receive cryptographer events. This will be > added in a future commit. In the meantime, this CL includes plenty > of unit tests to verify the functionality that's being added. > > BUG=351005 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287428 TBR=zea@chromium.org,stanisc@chromium.org,rlarocque@chromium.org NOTREECHECKS=true NOTRY=true BUG=351005 Review URL: https://codereview.chromium.org/442623002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287433 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Add non-blocking type encryption supportrlarocque@chromium.org2014-08-052-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces the framework for dealing with sync encryption in non-blocking types. Unlike directory sync types, non-blocking type encryption only encrypts data before it is sent to the server. Encrypting the data on-disk is a separate problem. Adds code to the ModelTypeSyncWorker so it can access the directory's cryptographer (through a CryptographerProvider interface) and use it to encrypt entities before it sends them to the server. If the cryptographer is unable to encrypt with the desired key, the worker will not commit until the cryptographer returns to a good state. Adds the concept of a "desired encryption key" to the data type state. When the cryptographer key to be used to encrypt a type changes, this will be reflected in the data type state. The ModelTypeSyncProxy is responsible for ensuring that all items which have not yet been encrypted with this desired key are enqueued for commit. Makes the ModelTypeSyncWorker, EntityTracker, and ModelTypeSyncProxy collaborate on the management of undecryptable (inapplicable) updates. The EntityTracker keeps track of their version numbers and content, and prevents the committing of new items to the server until the inapplicable update has been dealt with. The ModelTypeSyncProxy is responsible for saving inapplicable updates across restarts. This CL alone is not enough to enable encryption support for non-blocking types. It requires additional code to hook up the ModelTypeSyncWorkers to receive cryptographer events. This will be added in a future commit. In the meantime, this CL includes plenty of unit tests to verify the functionality that's being added. BUG=351005 Review URL: https://codereview.chromium.org/423193002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287428 0039d316-1c4b-4281-b951-d872f2087c98
* Rename "managed (mode|user)" to "supervised user" (part 1)treib@chromium.org2014-06-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL changes: - "IsManaged" and similar methods in Profile, ProfileInfoCache, and a few other places (which mostly forward to either of those) - Enum and constant names - Variable names - Comments Still missing: - I almost certainly missed a few variables and comments - The actual SU implementation, i.e. c/b/managed_mode/ - JavaScript - Resource names But since this CL is already way too huge, I'll try to commit this part now and do the rest in one or more followup CLs. TBR=thakis@chromium.org (chrome/) TBR=rogerta@chromium.org (google_apis/) TBR=haitaol@chromium.org (sync/ and components/sync_driver/) All the TBRs are simple renames. BUG=none Review URL: https://codereview.chromium.org/316863002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276722 0039d316-1c4b-4281-b951-d872f2087c98
* Move IsStringUTF8/ASCII to base namespacebrettw@chromium.org2014-05-071-1/+1
| | | | | | | | TBR=sky@chromium.org Review URL: https://codereview.chromium.org/270183002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268754 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 257524 "Move IsStringASCII/UTF8 to base namespace."brettw@chromium.org2014-03-171-1/+1
| | | | | | | | | | | | | | | | > Move IsStringASCII/UTF8 to base namespace. > > Use StringPiece for IsStringUTF8. > > TBR=sky > > Review URL: https://codereview.chromium.org/196793010 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/198163004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257533 0039d316-1c4b-4281-b951-d872f2087c98
* Move IsStringASCII/UTF8 to base namespace.brettw@chromium.org2014-03-171-1/+1
| | | | | | | | | | Use StringPiece for IsStringUTF8. TBR=sky Review URL: https://codereview.chromium.org/196793010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257524 0039d316-1c4b-4281-b951-d872f2087c98
* New Sync datatype for Synced Notifications App Infopetewil@chromium.org2014-01-291-0/+3
| | | | | | | | | | This is the first checkin for creating a new sync datatype for the synced notifications app info. The new datatype will be used for synced notification metadata such as the name and icon of the service sending the synced notification. BUG=280266 Review URL: https://codereview.chromium.org/143973006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247551 0039d316-1c4b-4281-b951-d872f2087c98
* Update uses of UTF conversions in ppapi/, printing/, remoting/, rlz/, ↵avi@chromium.org2013-12-251-1/+1
| | | | | | | | | | | | sandbox/, skia/, sql/, sync/, tools/, webkit/, win8/ to use the base:: namespace. BUG=330556 TEST=no change TBR=ben@chromium.org Review URL: https://codereview.chromium.org/121123002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242502 0039d316-1c4b-4281-b951-d872f2087c98
* Add Sync datatype for shared managed user settings.bauerb@chromium.org2013-12-191-0/+3
| | | | | | | | BUG=316168 Review URL: https://codereview.chromium.org/76333002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241779 0039d316-1c4b-4281-b951-d872f2087c98
* Add AppListSpecifics .proto definition and support codestevenjb@chromium.org2013-12-111-0/+3
| | | | | | | | | | | | This CL introduces the AppList sync type. As of patchset #7 this CL depends on https://codereview.chromium.org/106033003/ BUG=313376 Review URL: https://codereview.chromium.org/78773004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240162 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 239921 "Revert 239759 "The comment in base64.h implies th..."vadimt@chromium.org2013-12-112-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ***************** Reverting the revert. Congrats, the original CL wasn't the cause for the failure; sorry for the mess. ***************** > Revert 239759 "The comment in base64.h implies that base::Base64..." > > > The comment in base64.h implies that base::Base64Encode() can return false, but > > this cannot happen in practice. Fix the comment. > > > > The implementation of Base64Encode() attempts to check for the return value > > MODP_B64_ERROR as a failure, but modp_b64_encode() cannot return this > > value. Remove the check. > > > > Remove unneeded integer cast. > > > > Change the return type to void. > > > > BUG=323357 > > TEST=base_unittests, compile all > > TBR=jochen@chromium.org,miket@chromium.org,joi@chromium.org,akalin@chromium.org,sergeyu@chromium.org > > > > Review URL: https://codereview.chromium.org/86913002 > > TBR=ricea@chromium.org > > Review URL: https://codereview.chromium.org/101113004 TBR=vadimt@chromium.org Review URL: https://codereview.chromium.org/111883004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239944 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 239759 "The comment in base64.h implies that base::Base64..."vadimt@chromium.org2013-12-112-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | > The comment in base64.h implies that base::Base64Encode() can return false, but > this cannot happen in practice. Fix the comment. > > The implementation of Base64Encode() attempts to check for the return value > MODP_B64_ERROR as a failure, but modp_b64_encode() cannot return this > value. Remove the check. > > Remove unneeded integer cast. > > Change the return type to void. > > BUG=323357 > TEST=base_unittests, compile all > TBR=jochen@chromium.org,miket@chromium.org,joi@chromium.org,akalin@chromium.org,sergeyu@chromium.org > > Review URL: https://codereview.chromium.org/86913002 TBR=ricea@chromium.org Review URL: https://codereview.chromium.org/101113004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239921 0039d316-1c4b-4281-b951-d872f2087c98
* The comment in base64.h implies that base::Base64Encode() can return false, butricea@chromium.org2013-12-102-6/+6
| | | | | | | | | | | | | | | | | | | | this cannot happen in practice. Fix the comment. The implementation of Base64Encode() attempts to check for the return value MODP_B64_ERROR as a failure, but modp_b64_encode() cannot return this value. Remove the check. Remove unneeded integer cast. Change the return type to void. BUG=323357 TEST=base_unittests, compile all TBR=jochen@chromium.org,miket@chromium.org,joi@chromium.org,akalin@chromium.org,sergeyu@chromium.org Review URL: https://codereview.chromium.org/86913002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239759 0039d316-1c4b-4281-b951-d872f2087c98
* Replace kChromeOSReleaseBoard with SysInfo::GetLsbReleaseBoard()stevenjb@chromium.org2013-10-283-46/+8
| | | | | | | | BUG=126732 Review URL: https://codereview.chromium.org/32043003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231396 0039d316-1c4b-4281-b951-d872f2087c98