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

Issue 2458013002: [Sync] Rename ModelTypeService to ModelTypeSyncBridge. (Closed)

Created:
4 years, 1 month ago by maxbogue
Modified:
4 years, 1 month ago
Reviewers:
skym
CC:
chromium-reviews, mac-reviews_chromium.org, sync-reviews_chromium.org, sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Rename ModelTypeService to ModelTypeSyncBridge. BUG=660072 Committed: https://crrev.com/bca8256b27ba1157b3fb6aaf178b56040f82bea2 Cr-Commit-Position: refs/heads/master@{#428477}

Patch Set 1 #

Total comments: 6

Patch Set 2 : sync_bridge -> bridge #

Patch Set 3 : Rebase + address other comments. #

Patch Set 4 : s/SetBridgeError/ErrorOnNextCall #

Unified diffs Side-by-side diffs Delta from patch set Stats (+484 lines, -1324 lines) Patch
M chrome/browser/sync/chrome_sync_client.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/chrome_sync_client.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/test/integration/two_client_uss_sync_test.cc View 1 2 3 13 chunks +56 lines, -55 lines 0 comments Download
M components/browser_sync/profile_sync_service.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M components/browser_sync/profile_sync_service.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/sync/BUILD.gn View 1 2 4 chunks +7 lines, -7 lines 0 comments Download
M components/sync/device_info/device_info_service.h View 3 chunks +3 lines, -3 lines 0 comments Download
M components/sync/device_info/device_info_service.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M components/sync/device_info/device_info_service_unittest.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M components/sync/driver/fake_sync_client.h View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M components/sync/driver/fake_sync_client.cc View 1 3 chunks +5 lines, -5 lines 0 comments Download
M components/sync/driver/model_type_controller.h View 1 chunk +1 line, -1 line 0 comments Download
M components/sync/driver/model_type_controller.cc View 1 3 chunks +12 lines, -13 lines 0 comments Download
M components/sync/driver/model_type_controller_unittest.cc View 1 5 chunks +16 lines, -15 lines 0 comments Download
M components/sync/driver/sync_client.h View 2 chunks +3 lines, -3 lines 0 comments Download
M components/sync/driver/sync_driver_switches.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/sync/model/entity_data.h View 1 chunk +1 line, -1 line 0 comments Download
M components/sync/model/fake_model_type_change_processor.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M components/sync/model/fake_model_type_change_processor.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
D components/sync/model/fake_model_type_service.h View 1 chunk +0 lines, -148 lines 0 comments Download
D components/sync/model/fake_model_type_service.cc View 1 chunk +0 lines, -323 lines 0 comments Download
A + components/sync/model/fake_model_type_sync_bridge.h View 1 2 3 6 chunks +15 lines, -15 lines 0 comments Download
A + components/sync/model/fake_model_type_sync_bridge.cc View 1 2 3 14 chunks +61 lines, -56 lines 0 comments Download
M components/sync/model/model_type_change_processor.h View 4 chunks +8 lines, -8 lines 0 comments Download
M components/sync/model/model_type_change_processor.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/sync/model/model_type_debug_info.h View 1 2 chunks +8 lines, -6 lines 0 comments Download
M components/sync/model/model_type_debug_info.cc View 3 chunks +14 lines, -11 lines 0 comments Download
D components/sync/model/model_type_service.h View 1 chunk +0 lines, -128 lines 0 comments Download
D components/sync/model/model_type_service.cc View 1 chunk +0 lines, -55 lines 0 comments Download
D components/sync/model/model_type_service_unittest.cc View 1 chunk +0 lines, -165 lines 0 comments Download
A + components/sync/model/model_type_sync_bridge.h View 4 chunks +9 lines, -9 lines 0 comments Download
A + components/sync/model/model_type_sync_bridge.cc View 4 chunks +7 lines, -7 lines 0 comments Download
A + components/sync/model/model_type_sync_bridge_unittest.cc View 10 chunks +33 lines, -31 lines 0 comments Download
D components/sync/model/stub_model_type_service.h View 1 chunk +0 lines, -39 lines 0 comments Download
D components/sync/model/stub_model_type_service.cc View 1 chunk +0 lines, -52 lines 0 comments Download
A + components/sync/model/stub_model_type_sync_bridge.h View 2 chunks +9 lines, -9 lines 0 comments Download
A components/sync/model/stub_model_type_sync_bridge.cc View 1 chunk +55 lines, -0 lines 0 comments Download
M components/sync/model_impl/shared_model_type_processor.h View 4 chunks +9 lines, -10 lines 0 comments Download
M components/sync/model_impl/shared_model_type_processor.cc View 17 chunks +24 lines, -24 lines 0 comments Download
M components/sync/model_impl/shared_model_type_processor_unittest.cc View 1 2 3 60 chunks +102 lines, -99 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_sync_client.h View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/sync/ios_chrome_sync_client.mm View 1 2 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 23 (17 generated)
maxbogue
Sky, PTAL.
4 years, 1 month ago (2016-10-28 16:35:22 UTC) #6
skym
lgtm As we talked about on chat, lets remove 'sync_' from all the variable names. ...
4 years, 1 month ago (2016-10-28 16:47:56 UTC) #7
maxbogue
https://codereview.chromium.org/2458013002/diff/1/components/sync/driver/fake_sync_client.h File components/sync/driver/fake_sync_client.h (right): https://codereview.chromium.org/2458013002/diff/1/components/sync/driver/fake_sync_client.h#newcode53 components/sync/driver/fake_sync_client.h:53: ModelTypeSyncBridge* model_type_sync_bridge_; On 2016/10/28 16:47:56, skym wrote: > I'd ...
4 years, 1 month ago (2016-10-28 18:28:53 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2458013002/60001
4 years, 1 month ago (2016-10-28 19:23:07 UTC) #20
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/bca8256b27ba1157b3fb6aaf178b56040f82bea2 Cr-Commit-Position: refs/heads/master@{#428477}
4 years, 1 month ago (2016-10-28 20:33:49 UTC) #22
commit-bot: I haz the power
4 years, 1 month ago (2016-10-28 20:34:25 UTC) #23
Message was sent while issue was closed.
Failed to apply patch for components/sync/model/fake_model_type_sync_bridge.cc:
While running git apply --index -3 -p1;
  error: components/sync/model/fake_model_type_service.cc: does not exist in
index

Patch:   NR 
components/sync/model/fake_model_type_service.cc->components/sync/model/fake_model_type_sync_bridge.cc
Index: components/sync/model/fake_model_type_sync_bridge.cc
diff --git a/components/sync/model/fake_model_type_service.cc
b/components/sync/model/fake_model_type_sync_bridge.cc
similarity index 69%
rename from components/sync/model/fake_model_type_service.cc
rename to components/sync/model/fake_model_type_sync_bridge.cc
index
78d60263729915c7787364568147fb7ddf269436..3c53b4d447b34b7c0a68c239c21ed82e180b3a17
100644
--- a/components/sync/model/fake_model_type_service.cc
+++ b/components/sync/model/fake_model_type_sync_bridge.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/sync/model/fake_model_type_service.h"
+#include "components/sync/model/fake_model_type_sync_bridge.h"
 
 #include <utility>
 
@@ -38,18 +38,18 @@ std::unique_ptr<EntityData> CopyEntityData(const EntityData&
old_data) {
 }  // namespace
 
 // static
-std::string FakeModelTypeService::ClientTagFromKey(const std::string& key) {
+std::string FakeModelTypeSyncBridge::ClientTagFromKey(const std::string& key) {
   return "ClientTag_" + key;
 }
 
 // static
-std::string FakeModelTypeService::TagHashFromKey(const std::string& key) {
+std::string FakeModelTypeSyncBridge::TagHashFromKey(const std::string& key) {
   return syncable::GenerateSyncableHash(
-      PREFERENCES, FakeModelTypeService::ClientTagFromKey(key));
+      PREFERENCES, FakeModelTypeSyncBridge::ClientTagFromKey(key));
 }
 
 // static
-EntitySpecifics FakeModelTypeService::GenerateSpecifics(
+EntitySpecifics FakeModelTypeSyncBridge::GenerateSpecifics(
     const std::string& key,
     const std::string& value) {
   EntitySpecifics specifics;
@@ -59,7 +59,7 @@ EntitySpecifics FakeModelTypeService::GenerateSpecifics(
 }
 
 // static
-std::unique_ptr<EntityData> FakeModelTypeService::GenerateEntityData(
+std::unique_ptr<EntityData> FakeModelTypeSyncBridge::GenerateEntityData(
     const std::string& key,
     const std::string& value) {
   std::unique_ptr<EntityData> entity_data = base::MakeUnique<EntityData>();
@@ -69,56 +69,57 @@ std::unique_ptr<EntityData>
FakeModelTypeService::GenerateEntityData(
   return entity_data;
 }
 
-FakeModelTypeService::Store::Store() {}
-FakeModelTypeService::Store::~Store() {}
+FakeModelTypeSyncBridge::Store::Store() {}
+FakeModelTypeSyncBridge::Store::~Store() {}
 
-void FakeModelTypeService::Store::PutData(const std::string& key,
-                                          const EntityData& data) {
+void FakeModelTypeSyncBridge::Store::PutData(const std::string& key,
+                                             const EntityData& data) {
   data_change_count_++;
   data_store_[key] = CopyEntityData(data);
 }
 
-void FakeModelTypeService::Store::PutMetadata(const std::string& key,
-                                              const EntityMetadata& metadata) {
+void FakeModelTypeSyncBridge::Store::PutMetadata(
+    const std::string& key,
+    const EntityMetadata& metadata) {
   metadata_change_count_++;
   metadata_store_[key] = metadata;
 }
 
-void FakeModelTypeService::Store::RemoveData(const std::string& key) {
+void FakeModelTypeSyncBridge::Store::RemoveData(const std::string& key) {
   data_change_count_++;
   data_store_.erase(key);
 }
 
-void FakeModelTypeService::Store::RemoveMetadata(const std::string& key) {
+void FakeModelTypeSyncBridge::Store::RemoveMetadata(const std::string& key) {
   metadata_change_count_++;
   metadata_store_.erase(key);
 }
 
-bool FakeModelTypeService::Store::HasData(const std::string& key) const {
+bool FakeModelTypeSyncBridge::Store::HasData(const std::string& key) const {
   return data_store_.find(key) != data_store_.end();
 }
 
-bool FakeModelTypeService::Store::HasMetadata(const std::string& key) const {
+bool FakeModelTypeSyncBridge::Store::HasMetadata(const std::string& key) const
{
   return metadata_store_.find(key) != metadata_store_.end();
 }
 
-const EntityData& FakeModelTypeService::Store::GetData(
+const EntityData& FakeModelTypeSyncBridge::Store::GetData(
     const std::string& key) const {
   return *data_store_.find(key)->second;
 }
 
-const std::string& FakeModelTypeService::Store::GetValue(
+const std::string& FakeModelTypeSyncBridge::Store::GetValue(
     const std::string& key) const {
   return GetData(key).specifics.preference().value();
 }
 
-const sync_pb::EntityMetadata& FakeModelTypeService::Store::GetMetadata(
+const sync_pb::EntityMetadata& FakeModelTypeSyncBridge::Store::GetMetadata(
     const std::string& key) const {
   return metadata_store_.find(key)->second;
 }
 
 std::unique_ptr<MetadataBatch>
-FakeModelTypeService::Store::CreateMetadataBatch() const {
+FakeModelTypeSyncBridge::Store::CreateMetadataBatch() const {
   std::unique_ptr<MetadataBatch> metadata_batch(new MetadataBatch());
   metadata_batch->SetModelTypeState(model_type_state_);
   for (const auto& kv : metadata_store_) {
@@ -127,7 +128,7 @@ FakeModelTypeService::Store::CreateMetadataBatch() const {
   return metadata_batch;
 }
 
-void FakeModelTypeService::Store::Reset() {
+void FakeModelTypeSyncBridge::Store::Reset() {
   data_change_count_ = 0;
   metadata_change_count_ = 0;
   data_store_.clear();
@@ -135,17 +136,17 @@ void FakeModelTypeService::Store::Reset() {
   model_type_state_.Clear();
 }
 
-FakeModelTypeService::FakeModelTypeService(
+FakeModelTypeSyncBridge::FakeModelTypeSyncBridge(
     const ChangeProcessorFactory& change_processor_factory)
-    : ModelTypeService(change_processor_factory, PREFERENCES),
+    : ModelTypeSyncBridge(change_processor_factory, PREFERENCES),
       db_(base::MakeUnique<Store>()) {}
 
-FakeModelTypeService::~FakeModelTypeService() {
+FakeModelTypeSyncBridge::~FakeModelTypeSyncBridge() {
   CheckPostConditions();
 }
 
-EntitySpecifics FakeModelTypeService::WriteItem(const std::string& key,
-                                                const std::string& value) {
+EntitySpecifics FakeModelTypeSyncBridge::WriteItem(const std::string& key,
+                                                   const std::string& value) {
   std::unique_ptr<EntityData> entity_data = GenerateEntityData(key, value);
   EntitySpecifics specifics_copy = entity_data->specifics;
   WriteItem(key, std::move(entity_data));
@@ -153,8 +154,9 @@ EntitySpecifics FakeModelTypeService::WriteItem(const
std::string& key,
 }
 
 // Overloaded form to allow passing of custom entity data.
-void FakeModelTypeService::WriteItem(const std::string& key,
-                                     std::unique_ptr<EntityData> entity_data) {
+void FakeModelTypeSyncBridge::WriteItem(
+    const std::string& key,
+    std::unique_ptr<EntityData> entity_data) {
   db_->PutData(key, *entity_data);
   if (change_processor()) {
     std::unique_ptr<MetadataChangeList> change_list(
@@ -164,7 +166,7 @@ void FakeModelTypeService::WriteItem(const std::string& key,
   }
 }
 
-void FakeModelTypeService::DeleteItem(const std::string& key) {
+void FakeModelTypeSyncBridge::DeleteItem(const std::string& key) {
   db_->RemoveData(key);
   if (change_processor()) {
     std::unique_ptr<MetadataChangeList> change_list(
@@ -175,16 +177,16 @@ void FakeModelTypeService::DeleteItem(const std::string&
key) {
 }
 
 std::unique_ptr<MetadataChangeList>
-FakeModelTypeService::CreateMetadataChangeList() {
+FakeModelTypeSyncBridge::CreateMetadataChangeList() {
   return std::unique_ptr<MetadataChangeList>(new SimpleMetadataChangeList());
 }
 
-SyncError FakeModelTypeService::MergeSyncData(
+SyncError FakeModelTypeSyncBridge::MergeSyncData(
     std::unique_ptr<MetadataChangeList> metadata_changes,
     EntityDataMap data_map) {
-  if (service_error_.IsSet()) {
-    SyncError error = service_error_;
-    service_error_ = SyncError();
+  if (bridge_error_.IsSet()) {
+    SyncError error = bridge_error_;
+    bridge_error_ = SyncError();
     return error;
   }
   // Commit any local entities that aren't being overwritten by the server.
@@ -202,12 +204,12 @@ SyncError FakeModelTypeService::MergeSyncData(
   return SyncError();
 }
 
-SyncError FakeModelTypeService::ApplySyncChanges(
+SyncError FakeModelTypeSyncBridge::ApplySyncChanges(
     std::unique_ptr<MetadataChangeList> metadata_changes,
     EntityChangeList entity_changes) {
-  if (service_error_.IsSet()) {
-    SyncError error = service_error_;
-    service_error_ = SyncError();
+  if (bridge_error_.IsSet()) {
+    SyncError error = bridge_error_;
+    bridge_error_ = SyncError();
     return error;
   }
   for (const EntityChange& change : entity_changes) {
@@ -230,7 +232,7 @@ SyncError FakeModelTypeService::ApplySyncChanges(
   return SyncError();
 }
 
-void FakeModelTypeService::ApplyMetadataChangeList(
+void FakeModelTypeSyncBridge::ApplyMetadataChangeList(
     std::unique_ptr<MetadataChangeList> change_list) {
   DCHECK(change_list);
   SimpleMetadataChangeList* changes =
@@ -261,10 +263,11 @@ void FakeModelTypeService::ApplyMetadataChangeList(
   }
 }
 
-void FakeModelTypeService::GetData(StorageKeyList keys, DataCallback callback)
{
-  if (service_error_.IsSet()) {
-    callback.Run(service_error_, nullptr);
-    service_error_ = SyncError();
+void FakeModelTypeSyncBridge::GetData(StorageKeyList keys,
+                                      DataCallback callback) {
+  if (bridge_error_.IsSet()) {
+    callback.Run(bridge_error_, nullptr);
+    bridge_error_ = SyncError();
     return;
   }
 
@@ -276,10 +279,10 @@ void FakeModelTypeService::GetData(StorageKeyList keys,
DataCallback callback) {
   callback.Run(SyncError(), std::move(batch));
 }
 
-void FakeModelTypeService::GetAllData(DataCallback callback) {
-  if (service_error_.IsSet()) {
-    callback.Run(service_error…
(message too large)

Powered by Google App Engine
This is Rietveld 408576698