summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2016-01-19 17:41:02 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-20 01:43:18 +0000
commit5d64b5269aa9293c992f41235290366d21cb38ac (patch)
tree2cf3091ddc052686b434d4a4f6d90cfd518d7004 /sync
parentec933290454c4a92f9dd720fc38191f732bdfc7b (diff)
downloadchromium_src-5d64b5269aa9293c992f41235290366d21cb38ac.zip
chromium_src-5d64b5269aa9293c992f41235290366d21cb38ac.tar.gz
chromium_src-5d64b5269aa9293c992f41235290366d21cb38ac.tar.bz2
Fix remaining incompatibilities between scoped_ptr and unique_ptr.
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}
Diffstat (limited to 'sync')
-rw-r--r--sync/engine/non_blocking_type_commit_contribution.cc4
-rw-r--r--sync/internal_api/public/util/proto_value_ptr_unittest.cc2
-rw-r--r--sync/sessions/data_type_tracker.cc2
3 files changed, 4 insertions, 4 deletions
diff --git a/sync/engine/non_blocking_type_commit_contribution.cc b/sync/engine/non_blocking_type_commit_contribution.cc
index 5216ed0..d4506b3 100644
--- a/sync/engine/non_blocking_type_commit_contribution.cc
+++ b/sync/engine/non_blocking_type_commit_contribution.cc
@@ -62,13 +62,13 @@ syncer::SyncerError NonBlockingTypeCommitContribution::ProcessCommitResponse(
case sync_pb::CommitResponse::INVALID_MESSAGE:
LOG(ERROR) << "Server reports commit message is invalid.";
DLOG(ERROR) << "Message was: "
- << syncer::SyncEntityToValue(entities_.Get(i), false);
+ << syncer::SyncEntityToValue(entities_.Get(i), false).get();
unknown_error = true;
break;
case sync_pb::CommitResponse::CONFLICT:
DVLOG(1) << "Server reports conflict for commit message.";
DVLOG(1) << "Message was: "
- << syncer::SyncEntityToValue(entities_.Get(i), false);
+ << syncer::SyncEntityToValue(entities_.Get(i), false).get();
commit_conflict = true;
break;
case sync_pb::CommitResponse::SUCCESS: {
diff --git a/sync/internal_api/public/util/proto_value_ptr_unittest.cc b/sync/internal_api/public/util/proto_value_ptr_unittest.cc
index f439825..1420980 100644
--- a/sync/internal_api/public/util/proto_value_ptr_unittest.cc
+++ b/sync/internal_api/public/util/proto_value_ptr_unittest.cc
@@ -45,7 +45,7 @@ class TestValue {
int value() const { return value_->value(); }
IntValue* value_ptr() const { return value_.get(); }
- bool is_initialized() const { return value_; }
+ bool is_initialized() const { return !!value_; }
bool is_default() const { return is_default_; }
// TestValue uses the default traits struct with ProtoValuePtr<TestValue>.
diff --git a/sync/sessions/data_type_tracker.cc b/sync/sessions/data_type_tracker.cc
index 63cf523..4a8d8d0 100644
--- a/sync/sessions/data_type_tracker.cc
+++ b/sync/sessions/data_type_tracker.cc
@@ -202,7 +202,7 @@ void DataTypeTracker::FillGetUpdatesTriggersMessage(
msg->set_server_dropped_hints(
!pending_invalidations_.empty() &&
(*pending_invalidations_.begin())->IsUnknownVersion());
- msg->set_client_dropped_hints(last_dropped_invalidation_);
+ msg->set_client_dropped_hints(!!last_dropped_invalidation_);
msg->set_local_modification_nudges(local_nudge_count_);
msg->set_datatype_refresh_nudges(local_refresh_request_count_);
msg->set_initial_sync_in_progress(initial_sync_required_);