| 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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 content::BrowserThread::UI), | 623 content::BrowserThread::UI), |
| 624 token_service_); | 624 token_service_); |
| 625 attachment_downloader = syncer::AttachmentDownloader::Create( | 625 attachment_downloader = syncer::AttachmentDownloader::Create( |
| 626 sync_service_url_, | 626 sync_service_url_, |
| 627 url_request_context_getter_, | 627 url_request_context_getter_, |
| 628 user_share.sync_credentials.email, | 628 user_share.sync_credentials.email, |
| 629 user_share.sync_credentials.scope_set, | 629 user_share.sync_credentials.scope_set, |
| 630 token_service_provider); | 630 token_service_provider); |
| 631 } | 631 } |
| 632 | 632 |
| 633 // It is important that the initial backoff delay is relatively large. For |
| 634 // whatever reason, the server may fail all requests for a short period of |
| 635 // time. When this happens we don't want to overwhelm the server with |
| 636 // requests so we use a large initial backoff. |
| 637 const base::TimeDelta initial_backoff_delay = |
| 638 base::TimeDelta::FromMinutes(30); |
| 639 const base::TimeDelta max_backoff_delay = base::TimeDelta::FromHours(4); |
| 633 scoped_ptr<syncer::AttachmentService> attachment_service( | 640 scoped_ptr<syncer::AttachmentService> attachment_service( |
| 634 new syncer::AttachmentServiceImpl(attachment_store, | 641 new syncer::AttachmentServiceImpl(attachment_store, |
| 635 attachment_uploader.Pass(), | 642 attachment_uploader.Pass(), |
| 636 attachment_downloader.Pass(), | 643 attachment_downloader.Pass(), |
| 637 delegate)); | 644 delegate, |
| 638 | 645 initial_backoff_delay, |
| 646 max_backoff_delay)); |
| 639 return attachment_service.Pass(); | 647 return attachment_service.Pass(); |
| 640 } | 648 } |
| 641 | 649 |
| 642 ProfileSyncComponentsFactory::SyncComponents | 650 ProfileSyncComponentsFactory::SyncComponents |
| 643 ProfileSyncComponentsFactoryImpl::CreateBookmarkSyncComponents( | 651 ProfileSyncComponentsFactoryImpl::CreateBookmarkSyncComponents( |
| 644 ProfileSyncService* profile_sync_service, | 652 ProfileSyncService* profile_sync_service, |
| 645 sync_driver::DataTypeErrorHandler* error_handler) { | 653 sync_driver::DataTypeErrorHandler* error_handler) { |
| 646 BookmarkModel* bookmark_model = | 654 BookmarkModel* bookmark_model = |
| 647 BookmarkModelFactory::GetForProfile(profile_sync_service->profile()); | 655 BookmarkModelFactory::GetForProfile(profile_sync_service->profile()); |
| 648 syncer::UserShare* user_share = profile_sync_service->GetUserShare(); | 656 syncer::UserShare* user_share = profile_sync_service->GetUserShare(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 674 new TypedUrlModelAssociator(profile_sync_service, | 682 new TypedUrlModelAssociator(profile_sync_service, |
| 675 history_backend, | 683 history_backend, |
| 676 error_handler); | 684 error_handler); |
| 677 TypedUrlChangeProcessor* change_processor = | 685 TypedUrlChangeProcessor* change_processor = |
| 678 new TypedUrlChangeProcessor(profile_, | 686 new TypedUrlChangeProcessor(profile_, |
| 679 model_associator, | 687 model_associator, |
| 680 history_backend, | 688 history_backend, |
| 681 error_handler); | 689 error_handler); |
| 682 return SyncComponents(model_associator, change_processor); | 690 return SyncComponents(model_associator, change_processor); |
| 683 } | 691 } |
| OLD | NEW |