OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
10 #include "chrome/browser/history/history_service.h" | 10 #include "chrome/browser/history/history_service.h" |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 TokenServiceProvider::GetTokenServiceTaskRunner() { | 633 TokenServiceProvider::GetTokenServiceTaskRunner() { |
634 return task_runner_; | 634 return task_runner_; |
635 } | 635 } |
636 | 636 |
637 OAuth2TokenService* TokenServiceProvider::GetTokenService() { | 637 OAuth2TokenService* TokenServiceProvider::GetTokenService() { |
638 return token_service_; | 638 return token_service_; |
639 } | 639 } |
640 | 640 |
641 scoped_ptr<syncer::AttachmentService> | 641 scoped_ptr<syncer::AttachmentService> |
642 ProfileSyncComponentsFactoryImpl::CreateAttachmentService( | 642 ProfileSyncComponentsFactoryImpl::CreateAttachmentService( |
643 scoped_ptr<syncer::AttachmentStore> attachment_store, | 643 const scoped_refptr<syncer::AttachmentStore>& attachment_store, |
644 const syncer::UserShare& user_share, | 644 const syncer::UserShare& user_share, |
645 const std::string& store_birthday, | 645 const std::string& store_birthday, |
646 syncer::ModelType model_type, | 646 syncer::ModelType model_type, |
647 syncer::AttachmentService::Delegate* delegate) { | 647 syncer::AttachmentService::Delegate* delegate) { |
648 scoped_ptr<syncer::AttachmentUploader> attachment_uploader; | 648 scoped_ptr<syncer::AttachmentUploader> attachment_uploader; |
649 scoped_ptr<syncer::AttachmentDownloader> attachment_downloader; | 649 scoped_ptr<syncer::AttachmentDownloader> attachment_downloader; |
650 // Only construct an AttachmentUploader and AttachmentDownload if we have sync | 650 // Only construct an AttachmentUploader and AttachmentDownload if we have sync |
651 // credentials. We may not have sync credentials because there may not be a | 651 // credentials. We may not have sync credentials because there may not be a |
652 // signed in sync user (e.g. sync is running in "backup" mode). | 652 // signed in sync user (e.g. sync is running in "backup" mode). |
653 if (!user_share.sync_credentials.email.empty() && | 653 if (!user_share.sync_credentials.email.empty() && |
(...skipping 24 matching lines...) Expand all Loading... |
678 } | 678 } |
679 | 679 |
680 // It is important that the initial backoff delay is relatively large. For | 680 // It is important that the initial backoff delay is relatively large. For |
681 // whatever reason, the server may fail all requests for a short period of | 681 // whatever reason, the server may fail all requests for a short period of |
682 // time. When this happens we don't want to overwhelm the server with | 682 // time. When this happens we don't want to overwhelm the server with |
683 // requests so we use a large initial backoff. | 683 // requests so we use a large initial backoff. |
684 const base::TimeDelta initial_backoff_delay = | 684 const base::TimeDelta initial_backoff_delay = |
685 base::TimeDelta::FromMinutes(30); | 685 base::TimeDelta::FromMinutes(30); |
686 const base::TimeDelta max_backoff_delay = base::TimeDelta::FromHours(4); | 686 const base::TimeDelta max_backoff_delay = base::TimeDelta::FromHours(4); |
687 scoped_ptr<syncer::AttachmentService> attachment_service( | 687 scoped_ptr<syncer::AttachmentService> attachment_service( |
688 new syncer::AttachmentServiceImpl( | 688 new syncer::AttachmentServiceImpl(attachment_store, |
689 attachment_store.Pass(), attachment_uploader.Pass(), | 689 attachment_uploader.Pass(), |
690 attachment_downloader.Pass(), delegate, initial_backoff_delay, | 690 attachment_downloader.Pass(), |
691 max_backoff_delay)); | 691 delegate, |
| 692 initial_backoff_delay, |
| 693 max_backoff_delay)); |
692 return attachment_service.Pass(); | 694 return attachment_service.Pass(); |
693 } | 695 } |
694 | 696 |
695 ProfileSyncComponentsFactory::SyncComponents | 697 ProfileSyncComponentsFactory::SyncComponents |
696 ProfileSyncComponentsFactoryImpl::CreateBookmarkSyncComponents( | 698 ProfileSyncComponentsFactoryImpl::CreateBookmarkSyncComponents( |
697 ProfileSyncService* profile_sync_service, | 699 ProfileSyncService* profile_sync_service, |
698 sync_driver::DataTypeErrorHandler* error_handler) { | 700 sync_driver::DataTypeErrorHandler* error_handler) { |
699 BookmarkModel* bookmark_model = | 701 BookmarkModel* bookmark_model = |
700 BookmarkModelFactory::GetForProfile(profile_sync_service->profile()); | 702 BookmarkModelFactory::GetForProfile(profile_sync_service->profile()); |
701 syncer::UserShare* user_share = profile_sync_service->GetUserShare(); | 703 syncer::UserShare* user_share = profile_sync_service->GetUserShare(); |
(...skipping 25 matching lines...) Expand all Loading... |
727 new TypedUrlModelAssociator(profile_sync_service, | 729 new TypedUrlModelAssociator(profile_sync_service, |
728 history_backend, | 730 history_backend, |
729 error_handler); | 731 error_handler); |
730 TypedUrlChangeProcessor* change_processor = | 732 TypedUrlChangeProcessor* change_processor = |
731 new TypedUrlChangeProcessor(profile_, | 733 new TypedUrlChangeProcessor(profile_, |
732 model_associator, | 734 model_associator, |
733 history_backend, | 735 history_backend, |
734 error_handler); | 736 error_handler); |
735 return SyncComponents(model_associator, change_processor); | 737 return SyncComponents(model_associator, change_processor); |
736 } | 738 } |
OLD | NEW |