summaryrefslogtreecommitdiffstats
path: root/components/sync_driver
diff options
context:
space:
mode:
authormaniscalco@chromium.org <maniscalco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-01 16:56:55 +0000
committermaniscalco@chromium.org <maniscalco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-01 16:56:55 +0000
commit9f3dee14008a167bcde2120548238b79b0913a61 (patch)
tree90a146573ee434ccf1bfde43cdfa22629e9b839e /components/sync_driver
parent629ba8d28270198ec8aafbb308004e26b1ef038d (diff)
downloadchromium_src-9f3dee14008a167bcde2120548238b79b0913a61.zip
chromium_src-9f3dee14008a167bcde2120548238b79b0913a61.tar.gz
chromium_src-9f3dee14008a167bcde2120548238b79b0913a61.tar.bz2
Pass account_id and scope_set to CreateAttachmentService via UserShare.
Add scope set to SyncCredentials so it can be used by AttachmentUploader and AttachmentDownloader. Upgrade SynCredentials from struct to simple class with accessors. Populate UserShare's account id and scope set using SyncCredentials. Remove account id and scope set from ProfileSyncComponentsFactoryImpl because PSCFI lives across signin/signout events. Instead, get this stuff from UserShare. BUG= Review URL: https://codereview.chromium.org/360033005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/sync_driver')
-rw-r--r--components/sync_driver/generic_change_processor.cc3
-rw-r--r--components/sync_driver/generic_change_processor_unittest.cc1
-rw-r--r--components/sync_driver/shared_change_processor_unittest.cc1
-rw-r--r--components/sync_driver/sync_api_component_factory.h1
-rw-r--r--components/sync_driver/ui_data_type_controller_unittest.cc1
5 files changed, 6 insertions, 1 deletions
diff --git a/components/sync_driver/generic_change_processor.cc b/components/sync_driver/generic_change_processor.cc
index 7d8ef4d..7917edc 100644
--- a/components/sync_driver/generic_change_processor.cc
+++ b/components/sync_driver/generic_change_processor.cc
@@ -97,7 +97,8 @@ GenericChangeProcessor::GenericChangeProcessor(
local_service_(local_service),
merge_result_(merge_result),
share_handle_(user_share),
- attachment_service_(sync_factory->CreateAttachmentService(this)),
+ attachment_service_(
+ sync_factory->CreateAttachmentService(*user_share, this)),
attachment_service_weak_ptr_factory_(attachment_service_.get()),
attachment_service_proxy_(
base::MessageLoopProxy::current(),
diff --git a/components/sync_driver/generic_change_processor_unittest.cc b/components/sync_driver/generic_change_processor_unittest.cc
index 09af1d4..9b38445 100644
--- a/components/sync_driver/generic_change_processor_unittest.cc
+++ b/components/sync_driver/generic_change_processor_unittest.cc
@@ -87,6 +87,7 @@ class MockSyncApiComponentFactory : public SyncApiComponentFactory {
}
virtual scoped_ptr<syncer::AttachmentService> CreateAttachmentService(
+ const syncer::UserShare& user_share,
syncer::AttachmentService::Delegate* delegate) OVERRIDE {
EXPECT_TRUE(attachment_service_ != NULL);
return attachment_service_.Pass();
diff --git a/components/sync_driver/shared_change_processor_unittest.cc b/components/sync_driver/shared_change_processor_unittest.cc
index 9f371b3..0282b15 100644
--- a/components/sync_driver/shared_change_processor_unittest.cc
+++ b/components/sync_driver/shared_change_processor_unittest.cc
@@ -44,6 +44,7 @@ class SyncSharedChangeProcessorTest :
}
virtual scoped_ptr<syncer::AttachmentService> CreateAttachmentService(
+ const syncer::UserShare& user_share,
syncer::AttachmentService::Delegate* delegate) OVERRIDE {
return syncer::AttachmentServiceImpl::CreateForTest();
}
diff --git a/components/sync_driver/sync_api_component_factory.h b/components/sync_driver/sync_api_component_factory.h
index cb54365..0ba2c5d 100644
--- a/components/sync_driver/sync_api_component_factory.h
+++ b/components/sync_driver/sync_api_component_factory.h
@@ -32,6 +32,7 @@ class SyncApiComponentFactory {
// provided. AttachmentService doesn't take ownership of delegate, the pointer
// must be valid throughout AttachmentService lifetime.
virtual scoped_ptr<syncer::AttachmentService> CreateAttachmentService(
+ const syncer::UserShare& user_share,
syncer::AttachmentService::Delegate* delegate) = 0;
};
diff --git a/components/sync_driver/ui_data_type_controller_unittest.cc b/components/sync_driver/ui_data_type_controller_unittest.cc
index 554197a..5185692 100644
--- a/components/sync_driver/ui_data_type_controller_unittest.cc
+++ b/components/sync_driver/ui_data_type_controller_unittest.cc
@@ -59,6 +59,7 @@ class SyncUIDataTypeControllerTest : public testing::Test,
}
virtual scoped_ptr<syncer::AttachmentService> CreateAttachmentService(
+ const syncer::UserShare& user_share,
syncer::AttachmentService::Delegate* delegate) OVERRIDE {
return syncer::AttachmentServiceImpl::CreateForTest();
}